Re: [PATCH v4 3/3] drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs

From: Steven Price

Date: Wed Aug 19 2026 - 11:38:14 EST


On 12/08/2026 15:07, Nicolas Frattaroli wrote:
> panthor_gpu_soft_reset() sets pending_reqs to 0 without taking the
> requisite reqs_lock.
>
> Fix this by taking the lock for the duration of the modification.
>
> Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
> Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@xxxxxxxxxxxxx>

Reviewed-by: Steven Price <steven.price@xxxxxxx>

> ---
> drivers/gpu/drm/panthor/panthor_gpu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
> index 55e33f145b40..fb2702e1e0a2 100644
> --- a/drivers/gpu/drm/panthor/panthor_gpu.c
> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c
> @@ -424,7 +424,10 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev)
> return -ETIMEDOUT;
> }
>
> - ptdev->gpu->pending_reqs = 0;
> + scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
> + ptdev->gpu->pending_reqs = 0;
> + }
> +
> return 0;
> }
>
>