ImmortalWrt/target/linux/bcm27xx/patches-5.15/950-0510-staging-mmal-vchiq-Reset-buffers_with_vpu-on-port_en.patch
Álvaro Fernández Rojas 20ea6adbf1 bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-17 15:11:22 +02:00

32 lines
1.1 KiB
Diff

From 346d7cf505387721ec8b2e678eada08be2179a0b Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 21 Sep 2021 17:17:57 +0100
Subject: [PATCH] staging: mmal-vchiq: Reset buffers_with_vpu on
port_enable
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@raspberrypi.com>
---
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1500,6 +1500,8 @@ static int port_enable(struct vchiq_mmal
port->enabled = 1;
+ atomic_set(&port->buffers_with_vpu, 0);
+
if (port->buffer_cb) {
/* send buffer headers to videocore */
hdr_count = 1;