[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251031-b4-vc-sm-cma-v1-11-0dd5c0ec3f5c@ideasonboard.com>
Date: Fri, 31 Oct 2025 22:57:31 +0530
From: Jai Luthra <jai.luthra@...asonboard.com>
To: Florian Fainelli <florian.fainelli@...adcom.com>,
Raspberry Pi Kernel Maintenance <kernel-list@...pberrypi.com>,
bcm-kernel-feedback-list@...adcom.com
Cc: Dave Stevenson <dave.stevenson@...pberrypi.com>,
Phil Elwell <phil@...pberrypi.com>, Stefan Wahren <wahrenst@....net>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Sumit Semwal <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Jai Luthra <jai.luthra@...asonboard.com>
Subject: [PATCH 11/13] platform/raspberrypi: vchiq-mmal: Reset
buffers_with_vpu on port_enable
From: Dave Stevenson <dave.stevenson@...pberrypi.com>
Should we go through the timeout failure case with port_disable
not returning all buffers for whatever reason, the
buffers_with_vpu counter gets left at a non-zero value, which
will cause reference counting issues should the instance be
reused.
Reset the count when the port is enabled again, but before
any buffers have been sent to the VPU.
Signed-off-by: Dave Stevenson <dave.stevenson@...pberrypi.com>
Signed-off-by: Jai Luthra <jai.luthra@...asonboard.com>
---
drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
index 02fbf061c171cba287657266aa1731333609b3b0..f9e1a773fa55f885f240f4945b980f77676d83a6 100644
--- a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
@@ -1490,6 +1490,8 @@ static int port_enable(struct vchiq_mmal_instance *instance,
port->enabled = true;
+ atomic_set(&port->buffers_with_vpu, 0);
+
if (port->buffer_cb) {
/* send buffer headers to videocore */
hdr_count = 1;
--
2.51.0
Powered by blists - more mailing lists