From: Tanmay Shah <tanmay.shah@amd.com>
To: <andersson@kernel.org>, <mathieu.poirier@linaro.org>,
<arnaud.pouliquen@foss.st.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-remoteproc@vger.kernel.org>,
Tanmay Shah <tanmay.shah@amd.com>
Subject: [PATCH v2 0/3] Enhance RPMsg buffer management
Date: Wed, 29 Apr 2026 09:10:50 -0700 [thread overview]
Message-ID: <20260429161052.528015-1-tanmay.shah@amd.com> (raw)
Take rx and tx buffer size from the virtio device config space in the
resource table. This allows each firmware to configure RPMsg buffer size
as needed in each direction.
Test performed:
- Test [1/2] patch with existing firmware as it is, rpmsg working.
- Verify [2/2] patch works with the existing firmware
- Verify [2/2] patch works with the firmware that configures
different tx & rx buf size via vdev config space.
Corresponding OpenAMP project PR:
- open-amp library: https://github.com/OpenAMP/open-amp/pull/684
- openamp-system-reference demo:
https://github.com/OpenAMP/openamp-system-reference/pull/106
Changes in v2:
- Change author
- fix commit message with better explanation
- %s/sbuf/tx_buf
- %s/rbuf/rx_buf
- %s/num_rbuf/num_rx_buf/
- %s/num_sbuf/num_tx_buf/
- %s/sbuf_size/tx_buf_size/
- %s/rbuf_size/rx_buf_size/
- fix typo
- do not use ALIGN on buf size, rely on allocator
- make err msg more explicit, %s/vdev config:/bad vdev config/
- fix license and add AMD copyrights in the header virtio_rpmsg.h
- Assign bit 1 to VIRTIO_RPMSG_F_BUFSZ feature
- use __virtio32 over __u32
- add version field to virtio rpmsg config structure
- Introduce new patch to print rpmsg mtu size in the sample rpmsg driver
- move linux/virtio_rpmsg.h to linux/rpmsg/virtio_rpmsg.h
Original seris:
https://lore.kernel.org/all/1548949280-31794-1-git-send-email-xiaoxiang@xiaomi.com/
Following modificaitons are done to the original series in v1:
- Separate dma allocation is not done for tx and rx buffers. Instead
allocated chunk of memory is split between tx and rx buffers.
- If vdev doesn't support VIRTIO_RPMSG_F_BUFSZ feature then use the
default size of 512 bytes for buffers
- Change MAX_RPMSG_BUF_SIZE to DEFAULT_RPMSG_BUF_SIZE
- move virtio_rpmsg.h from uapi to linux dir
- RPMsg buffer size must be set to hold rpmsg header at minimum in the
vdev config space of the firmware.
- align total buf size to page size when allocating and deallocating
memory
Tanmay Shah (3):
rpmsg: virtio_rpmsg_bus: allow different size of tx and rx bufs
rpmsg: virtio_rpmsg_bus: get buffer size from config space
samples: rpmsg: add mtu size info
drivers/rpmsg/virtio_rpmsg_bus.c | 124 ++++++++++++++++++----------
include/linux/rpmsg/virtio_rpmsg.h | 27 ++++++
samples/rpmsg/rpmsg_client_sample.c | 3 +
3 files changed, 109 insertions(+), 45 deletions(-)
create mode 100644 include/linux/rpmsg/virtio_rpmsg.h
base-commit: fcdf2df56d34a3f04cab0725c5bc3abdaa73c2be
--
2.34.1
next reply other threads:[~2026-04-29 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 16:10 Tanmay Shah [this message]
2026-04-29 16:10 ` [PATCH v2 1/3] rpmsg: virtio_rpmsg_bus: allow different size of tx and rx bufs Tanmay Shah
2026-04-29 16:10 ` [PATCH v2 2/3] rpmsg: virtio_rpmsg_bus: get buffer size from config space Tanmay Shah
2026-04-29 16:10 ` [PATCH v2 3/3] samples: rpmsg: add mtu size info Tanmay Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260429161052.528015-1-tanmay.shah@amd.com \
--to=tanmay.shah@amd.com \
--cc=andersson@kernel.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox