diff mbox series

[v3,3/3] drm/panthor: Drop the dev_enter/exit() sections in _irq_suspend/resume()

Message ID 20240326111205.510019-3-boris.brezillon@collabora.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] drm/panthor: Fix IO-page mmap() for 32-bit userspace on 64-bit kernel | expand

Commit Message

Boris Brezillon March 26, 2024, 11:12 a.m. UTC
There's no reason for _irq_suspend/resume() to be called after the
device has been unplugged, and keeping this dev_enter/exit()
section in _irq_suspend() is turns _irq_suspend() into a NOP
when called from the _unplug() functions, which we don't want.

v3:
- New patch

Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/gpu/drm/panthor/panthor_device.h | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

Comments

Boris Brezillon March 26, 2024, 11:14 a.m. UTC | #1
On Tue, 26 Mar 2024 12:12:05 +0100
Boris Brezillon <boris.brezillon@collabora.com> wrote:

> There's no reason for _irq_suspend/resume() to be called after the
> device has been unplugged, and keeping this dev_enter/exit()
> section in _irq_suspend() is turns _irq_suspend() into a NOP

                            ^ s/is turns/turns/

> when called from the _unplug() functions, which we don't want.
Liviu Dudau March 26, 2024, 2:10 p.m. UTC | #2
On Tue, Mar 26, 2024 at 12:12:05PM +0100, Boris Brezillon wrote:
> There's no reason for _irq_suspend/resume() to be called after the
> device has been unplugged, and keeping this dev_enter/exit()
> section in _irq_suspend() is turns _irq_suspend() into a NOP
> when called from the _unplug() functions, which we don't want.
> 
> v3:
> - New patch
> 
> Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/panthor/panthor_device.h | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
> index 3a930a368ae1..99ddc41f2626 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.h
> +++ b/drivers/gpu/drm/panthor/panthor_device.h
> @@ -326,13 +326,8 @@ static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq)
>  	int cookie;										\
>  												\
>  	pirq->mask = 0;										\
> -												\
> -	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);				\
> -		synchronize_irq(pirq->irq);							\
> -		drm_dev_exit(cookie);								\
> -	}											\
> -												\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);					\
> +	synchronize_irq(pirq->irq);								\
>  	atomic_set(&pirq->suspended, true);							\
>  }												\
>  												\
> @@ -342,12 +337,8 @@ static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u
>  												\
>  	atomic_set(&pirq->suspended, false);							\
>  	pirq->mask = mask;									\
> -												\
> -	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);			\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);			\
> -		drm_dev_exit(cookie);								\
> -	}											\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);				\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);				\
>  }												\
>  												\
>  static int panthor_request_ ## __name ## _irq(struct panthor_device *ptdev,			\
> -- 
> 2.44.0
>
Steven Price March 27, 2024, 3:25 p.m. UTC | #3
On 26/03/2024 11:12, Boris Brezillon wrote:
> There's no reason for _irq_suspend/resume() to be called after the
> device has been unplugged, and keeping this dev_enter/exit()
> section in _irq_suspend() is turns _irq_suspend() into a NOP
> when called from the _unplug() functions, which we don't want.
> 
> v3:
> - New patch
> 
> Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

LGTM

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

> ---
>  drivers/gpu/drm/panthor/panthor_device.h | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
> index 3a930a368ae1..99ddc41f2626 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.h
> +++ b/drivers/gpu/drm/panthor/panthor_device.h
> @@ -326,13 +326,8 @@ static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq)
>  	int cookie;										\
>  												\
>  	pirq->mask = 0;										\
> -												\
> -	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);				\
> -		synchronize_irq(pirq->irq);							\
> -		drm_dev_exit(cookie);								\
> -	}											\
> -												\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);					\
> +	synchronize_irq(pirq->irq);								\
>  	atomic_set(&pirq->suspended, true);							\
>  }												\
>  												\
> @@ -342,12 +337,8 @@ static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u
>  												\
>  	atomic_set(&pirq->suspended, false);							\
>  	pirq->mask = mask;									\
> -												\
> -	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);			\
> -		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);			\
> -		drm_dev_exit(cookie);								\
> -	}											\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);				\
> +	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);				\
>  }												\
>  												\
>  static int panthor_request_ ## __name ## _irq(struct panthor_device *ptdev,			\
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index 3a930a368ae1..99ddc41f2626 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -326,13 +326,8 @@  static inline void panthor_ ## __name ## _irq_suspend(struct panthor_irq *pirq)
 	int cookie;										\
 												\
 	pirq->mask = 0;										\
-												\
-	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
-		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);				\
-		synchronize_irq(pirq->irq);							\
-		drm_dev_exit(cookie);								\
-	}											\
-												\
+	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, 0);					\
+	synchronize_irq(pirq->irq);								\
 	atomic_set(&pirq->suspended, true);							\
 }												\
 												\
@@ -342,12 +337,8 @@  static inline void panthor_ ## __name ## _irq_resume(struct panthor_irq *pirq, u
 												\
 	atomic_set(&pirq->suspended, false);							\
 	pirq->mask = mask;									\
-												\
-	if (drm_dev_enter(&pirq->ptdev->base, &cookie)) {					\
-		gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);			\
-		gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);			\
-		drm_dev_exit(cookie);								\
-	}											\
+	gpu_write(pirq->ptdev, __reg_prefix ## _INT_CLEAR, mask);				\
+	gpu_write(pirq->ptdev, __reg_prefix ## _INT_MASK, mask);				\
 }												\
 												\
 static int panthor_request_ ## __name ## _irq(struct panthor_device *ptdev,			\