Skip to content

Commit 3312db0

Browse files
committed
Merge tag 'rpmsg-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull rpmsg updates from Bjorn Andersson: "The major part of the rpmsg changes for v5.18 relates to improvements in the rpmsg char driver, which now allow automatically attaching to rpmsg channels as well as initiating new communication channels from the Linux side. The SMD driver is moved to arch_initcall with the purpose of registering root clocks earlier during boot. Also in the SMD driver, a workaround for the resource power management (RPM) channel is introduced to resolve an issue where both the RPM and Linux side waits for the other to close the communication established by the bootloader - this unblocks support for clocks and regulators on some older Qualcomm platforms" * tag 'rpmsg-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls rpmsg: char: Introduce the "rpmsg-raw" channel rpmsg: char: Add possibility to use default endpoint of the rpmsg device rpmsg: char: Refactor rpmsg_chrdev_eptdev_create function rpmsg: Update rpmsg_chrdev_register_device function rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl rpmsg: Create the rpmsg class in core instead of in rpmsg char rpmsg: char: Export eptdev create and destroy functions rpmsg: char: treat rpmsg_trysend() ENOMEM as EAGAIN rpmsg: qcom_smd: Fix redundant channel->registered assignment rpmsg: use struct_size over open coded arithmetic rpmsg: smd: allow opening rpm_requests even if already opened rpmsg: qcom_smd: Promote to arch_initcall
2 parents f18e345 + 8109517 commit 3312db0

File tree

11 files changed

+428
-162
lines changed

11 files changed

+428
-162
lines changed

drivers/rpmsg/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ config RPMSG_CHAR
1515
in /dev. They make it possible for user-space programs to send and
1616
receive rpmsg packets.
1717

18+
config RPMSG_CTRL
19+
tristate "RPMSG control interface"
20+
depends on RPMSG && ( RPMSG_CHAR || RPMSG_CHAR=n )
21+
help
22+
Say Y here to enable the support of the /dev/rpmsg_ctrlX API. This API
23+
allows user-space programs to create endpoints with specific service name,
24+
source and destination addresses.
25+
1826
config RPMSG_NS
1927
tristate "RPMSG name service announcement"
2028
depends on RPMSG

drivers/rpmsg/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_RPMSG) += rpmsg_core.o
33
obj-$(CONFIG_RPMSG_CHAR) += rpmsg_char.o
4+
obj-$(CONFIG_RPMSG_CTRL) += rpmsg_ctrl.o
45
obj-$(CONFIG_RPMSG_NS) += rpmsg_ns.o
56
obj-$(CONFIG_RPMSG_MTK_SCP) += mtk_rpmsg.o
67
qcom_glink-objs := qcom_glink_native.o qcom_glink_ssr.o

drivers/rpmsg/qcom_glink_native.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static int qcom_glink_rx_defer(struct qcom_glink *glink, size_t extra)
792792
return -ENXIO;
793793
}
794794

795-
dcmd = kzalloc(sizeof(*dcmd) + extra, GFP_ATOMIC);
795+
dcmd = kzalloc(struct_size(dcmd, data, extra), GFP_ATOMIC);
796796
if (!dcmd)
797797
return -ENOMEM;
798798

@@ -1715,7 +1715,7 @@ static int qcom_glink_create_chrdev(struct qcom_glink *glink)
17151715
rpdev->dev.parent = glink->dev;
17161716
rpdev->dev.release = qcom_glink_device_release;
17171717

1718-
return rpmsg_chrdev_register_device(rpdev);
1718+
return rpmsg_ctrldev_register_device(rpdev);
17191719
}
17201720

17211721
struct qcom_glink *qcom_glink_native_probe(struct device *dev,

drivers/rpmsg/qcom_smd.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ static int qcom_smd_create_chrdev(struct qcom_smd_edge *edge)
11131113
qsdev->rpdev.dev.parent = &edge->dev;
11141114
qsdev->rpdev.dev.release = qcom_smd_release_device;
11151115

1116-
return rpmsg_chrdev_register_device(&qsdev->rpdev);
1116+
return rpmsg_ctrldev_register_device(&qsdev->rpdev);
11171117
}
11181118

11191119
/*
@@ -1288,19 +1288,22 @@ static void qcom_channel_state_worker(struct work_struct *work)
12881288
if (channel->state != SMD_CHANNEL_CLOSED)
12891289
continue;
12901290

1291+
/*
1292+
* Always open rpm_requests, even when already opened which is
1293+
* required on some SoCs like msm8953.
1294+
*/
12911295
remote_state = GET_RX_CHANNEL_INFO(channel, state);
12921296
if (remote_state != SMD_CHANNEL_OPENING &&
1293-
remote_state != SMD_CHANNEL_OPENED)
1297+
remote_state != SMD_CHANNEL_OPENED &&
1298+
strcmp(channel->name, "rpm_requests"))
12941299
continue;
12951300

12961301
if (channel->registered)
12971302
continue;
12981303

12991304
spin_unlock_irqrestore(&edge->channels_lock, flags);
13001305
qcom_smd_create_device(channel);
1301-
channel->registered = true;
13021306
spin_lock_irqsave(&edge->channels_lock, flags);
1303-
13041307
channel->registered = true;
13051308
}
13061309

@@ -1605,7 +1608,7 @@ static int __init qcom_smd_init(void)
16051608
{
16061609
return platform_driver_register(&qcom_smd_driver);
16071610
}
1608-
subsys_initcall(qcom_smd_init);
1611+
arch_initcall(qcom_smd_init);
16091612

16101613
static void __exit qcom_smd_exit(void)
16111614
{

0 commit comments

Comments
 (0)