summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-11-25 10:31:50 -0800
committerStefan Agner <stefan.agner@toradex.com>2016-11-25 18:41:05 -0800
commit204bcdf40d856bb91cfeeebdbd5f6181cf012ba0 (patch)
tree10c50fbba6f41099a8ec8b37fd5b53584ec449bd
parent5b2250b30d5c1178b552d7609a7853805b094e64 (diff)
ARM: imx: define buffer count per VirtIO queue
Let RPMSG_NUM_BUFS to be the number of buffers per VirtIO queue, so that each queue (TX/RX) has 256 buffers. The change does not affect the number of buffers. But specifing per VirtIO queue aligns better with the way buffer sizes are specified on the FreeRTOS side (in platform_info.c). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--arch/arm/mach-imx/imx_rpmsg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/imx_rpmsg.c b/arch/arm/mach-imx/imx_rpmsg.c
index 440d0437de75..978aeee4033d 100644
--- a/arch/arm/mach-imx/imx_rpmsg.c
+++ b/arch/arm/mach-imx/imx_rpmsg.c
@@ -44,9 +44,8 @@ struct imx_rpmsg_vproc {
* 3 pages for every vring (the size of the vring depends on the number of
* buffers it supports).
*/
-#define RPMSG_NUM_BUFS (512)
+#define RPMSG_NUM_BUFS (256)
#define RPMSG_BUF_SIZE (512)
-#define RPMSG_BUFS_SPACE (RPMSG_NUM_BUFS * RPMSG_BUF_SIZE)
/*
* The alignment between the consumer and producer parts of the vring.
@@ -56,7 +55,7 @@ struct imx_rpmsg_vproc {
#define RPMSG_VRING_ALIGN (4096)
/* With 256 buffers, our vring will occupy 3 pages */
-#define RPMSG_RING_SIZE ((DIV_ROUND_UP(vring_size(RPMSG_NUM_BUFS / 2, \
+#define RPMSG_RING_SIZE ((DIV_ROUND_UP(vring_size(RPMSG_NUM_BUFS, \
RPMSG_VRING_ALIGN), PAGE_SIZE)) * PAGE_SIZE)
#define to_imx_rpdev(vd) container_of(vd, struct imx_rpmsg_vproc, vdev)
@@ -156,7 +155,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
pr_debug("vring%d: phys 0x%x, virt 0x%x\n", index, rpdev->vring[index],
(unsigned int) rpvq->addr);
- vq = vring_new_virtqueue(index, RPMSG_NUM_BUFS / 2, RPMSG_VRING_ALIGN,
+ vq = vring_new_virtqueue(index, RPMSG_NUM_BUFS, RPMSG_VRING_ALIGN,
vdev, true, rpvq->addr, imx_rpmsg_notify, callback,
name);
if (!vq) {