diff mbox series

[2/8] drm/etnaviv: free events the usual way in recover worker

Message ID 20230607130223.3533464-2-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/8] drm/etnaviv: move down etnaviv_gpu_recover_hang() in file | expand

Commit Message

Lucas Stach June 7, 2023, 1:02 p.m. UTC
Clearing the whole bitmap at once is only a minor optimization in
a path that should be extremely cold. Free the events by calling
event_free() instead of directly manipulating the completion count
and event bitmap.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Christian Gmeiner June 14, 2023, 6:39 p.m. UTC | #1
Hi Lucas

>
> Clearing the whole bitmap at once is only a minor optimization in
> a path that should be extremely cold. Free the events by calling
> event_free() instead of directly manipulating the completion count
> and event bitmap.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 6d4df9f1aeff..4e18aa8566c6 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1442,8 +1442,7 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gem_submit *submit)
>         /* complete all events, the GPU won't do it after the reset */
>         spin_lock(&gpu->event_spinlock);
>         for_each_set_bit(i, gpu->event_bitmap, ETNA_NR_EVENTS)
> -               complete(&gpu->event_free);
> -       bitmap_zero(gpu->event_bitmap, ETNA_NR_EVENTS);
> +               event_free(gpu, i);
>         spin_unlock(&gpu->event_spinlock);
>
>         etnaviv_gpu_hw_init(gpu);
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 6d4df9f1aeff..4e18aa8566c6 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1442,8 +1442,7 @@  void etnaviv_gpu_recover_hang(struct etnaviv_gem_submit *submit)
 	/* complete all events, the GPU won't do it after the reset */
 	spin_lock(&gpu->event_spinlock);
 	for_each_set_bit(i, gpu->event_bitmap, ETNA_NR_EVENTS)
-		complete(&gpu->event_free);
-	bitmap_zero(gpu->event_bitmap, ETNA_NR_EVENTS);
+		event_free(gpu, i);
 	spin_unlock(&gpu->event_spinlock);
 
 	etnaviv_gpu_hw_init(gpu);