diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-28 07:17:28 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-28 07:17:28 -1000 |
| commit | 0d314add22247c91c74ef6ec093feee43fa2a9aa (patch) | |
| tree | 7d75e00d32f9c9d41098460c3f64da8dafef1956 /samples | |
| parent | f9350d59d7c186608a86326f2dad96ee6a2c9842 (diff) | |
| parent | 7dd4cffdf4c2a496ccf783303a03d687a2127baf (diff) | |
| download | linux-0d314add22247c91c74ef6ec093feee43fa2a9aa.tar.gz linux-0d314add22247c91c74ef6ec093feee43fa2a9aa.zip | |
Merge tag 'rpmsg-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull rpmsg updates from Bjorn Andersson:
- Allow virtio rpmsg to use separate transmit and receive buffer counts
based on the vring sizes, and obtain buffer sizes from virtio config
space when the feature is negotiated. Document the configuration and
report the MTU in the sample driver.
- Fix signal interruption and timeout handling while waiting for a
virtio transmit buffer. Release the device tree node reference on
MediaTek channel teardown.
- Convert the rpmsg control ioctl comments to kernel-doc format.
* tag 'rpmsg-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
rpmsg: virtio: fix error handling in TX buffer wait
rpmsg: mtk: release channel OF node on device teardown
samples: rpmsg: Fix mtu printk specifiers
samples: rpmsg: Add MTU size info
docs: rpmsg: Add virtio config space details
rpmsg: virtio_rpmsg_bus: Get buffer size from config space
rpmsg: virtio_rpmsg_bus: Allow different size of tx and rx bufs
rpmsg: virtio_rpmsg_bus: Rename rbufs and sbufs
rpmsg: ctrl: use kernel-doc format for ioctl macros
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/rpmsg/rpmsg_client_sample.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c index ae5081662283..8c629065c64c 100644 --- a/samples/rpmsg/rpmsg_client_sample.c +++ b/samples/rpmsg/rpmsg_client_sample.c @@ -52,6 +52,7 @@ static int rpmsg_sample_probe(struct rpmsg_device *rpdev) { int ret; struct instance_data *idata; + ssize_t mtu, msg_len; dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n", rpdev->src, rpdev->dst); @@ -62,8 +63,25 @@ static int rpmsg_sample_probe(struct rpmsg_device *rpdev) dev_set_drvdata(&rpdev->dev, idata); + mtu = rpmsg_get_mtu(rpdev->ept); + if (mtu < 0) { + dev_warn(&rpdev->dev, "invalid rpmsg MTU size = %zd\n", mtu); + return mtu; + } + + dev_info(&rpdev->dev, "rpmsg MTU size = %zd\n", mtu); + + msg_len = strlen(MSG); + /* make sure our message fits in a single rpmsg buffer */ + if (msg_len > mtu) { + dev_err(&rpdev->dev, + "message size %zd exceeds rpmsg MTU size %zd\n", + msg_len, mtu); + return -EMSGSIZE; + } + /* send a message to our remote processor */ - ret = rpmsg_send(rpdev->ept, MSG, strlen(MSG)); + ret = rpmsg_send(rpdev->ept, MSG, msg_len); if (ret) { dev_err(&rpdev->dev, "rpmsg_send failed: %d\n", ret); return ret; |
