From f49cd77f73a211dce3421b22cc9f3e5d2a3c079a Mon Sep 17 00:00:00 2001 From: Tony Truong Date: Thu, 8 Aug 2024 16:24:32 -0700 Subject: [PATCH] rpmsg: glink_cma: Add msg type to reclaim inbuf There are cases where the device receives an inbuf msg type related to an ack and hold on to the buffer without it being reclaimed by the driver. Add a new msg type, MSG_INBUF_RECLAIM, so the driver can reclaim inbuf that the device no longer needs. Change-Id: Id92371f06134569031ee3ea4454104f83f790561 Signed-off-by: Tony Truong --- drivers/rpmsg/virtio_glink_cma.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/rpmsg/virtio_glink_cma.c b/drivers/rpmsg/virtio_glink_cma.c index c58c51d7b8b4..82132ac7b93f 100644 --- a/drivers/rpmsg/virtio_glink_cma.c +++ b/drivers/rpmsg/virtio_glink_cma.c @@ -51,6 +51,7 @@ enum { MSG_SSR_AFTER_POWERUP, /* outbound */ MSG_SSR_SETUP, /* inbound */ MSG_SSR_SETUP_ACK, /* outbound */ + MSG_INBUF_RECLAIM, /* inbound */ MSG_MAX, MSG_ERR = 0xff, }; @@ -121,6 +122,7 @@ static int virtio_glink_bridge_msg_type_supported(u32 msg_type) switch (msg_type) { case MSG_SETUP: case MSG_SSR_SETUP: + case MSG_INBUF_RECLAIM: return true; default: return false; @@ -264,6 +266,9 @@ static void virtio_glink_bridge_rx_work(struct work_struct *work) goto out; } + if (msg_type == MSG_INBUF_RECLAIM) + return; + msg_ack_type = virtio_glink_bridge_to_msg_ack_type(msg_type); dsp_info = virtio_glink_bridge_get_dsp_info(vgbridge, label);