* [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
@ 2021-07-06 7:49 ` Thomas Zimmermann
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2021-07-06 7:49 UTC (permalink / raw)
To: laurent.pinchart, kieran.bingham+renesas, airlied, daniel
Cc: linux-renesas-soc, Thomas Zimmermann, dri-devel
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
don't benefit from using it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 0a02b7092c04..032a2fff5efd 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -18,7 +18,6 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h>
-#include <drm/drm_irq.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>
@@ -130,7 +129,6 @@ DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);
static const struct drm_driver shmob_drm_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET,
- .irq_handler = shmob_drm_irq,
DRM_GEM_CMA_DRIVER_OPS,
.fops = &shmob_drm_fops,
.name = "shmob-drm",
@@ -183,7 +181,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
drm_dev_unregister(ddev);
drm_kms_helper_poll_fini(ddev);
- drm_irq_uninstall(ddev);
+ free_irq(platform_get_irq(pdev, 0), ddev);
drm_dev_put(ddev);
return 0;
@@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
goto err_modeset_cleanup;
}
- ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
+ ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
if (ret < 0) {
dev_err(&pdev->dev, "failed to install IRQ handler\n");
goto err_modeset_cleanup;
@@ -275,7 +273,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
return 0;
err_irq_uninstall:
- drm_irq_uninstall(ddev);
+ free_irq(platform_get_irq(pdev, 0), ddev);
err_modeset_cleanup:
drm_kms_helper_poll_fini(ddev);
err_free_drm_dev:
--
2.32.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
2021-07-06 7:49 ` Thomas Zimmermann
(?)
@ 2021-07-10 6:39 ` Sam Ravnborg
-1 siblings, 0 replies; 9+ messages in thread
From: Sam Ravnborg @ 2021-07-10 6:39 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: airlied, dri-devel, linux-renesas-soc, kieran.bingham+renesas,
laurent.pinchart
Hi Thomas,
On Tue, Jul 06, 2021 at 09:49:00AM +0200, Thomas Zimmermann wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Looks fine,
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Sam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
2021-07-06 7:49 ` Thomas Zimmermann
@ 2021-07-10 20:33 ` Laurent Pinchart
-1 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2021-07-10 20:33 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: kieran.bingham+renesas, airlied, daniel, dri-devel, linux-renesas-soc
Hi Thomas,
Thank you for the patch.
On Tue, Jul 06, 2021 at 09:49:00AM +0200, Thomas Zimmermann wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 0a02b7092c04..032a2fff5efd 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -18,7 +18,6 @@
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_gem_cma_helper.h>
> -#include <drm/drm_irq.h>
> #include <drm/drm_probe_helper.h>
> #include <drm/drm_vblank.h>
>
> @@ -130,7 +129,6 @@ DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);
>
> static const struct drm_driver shmob_drm_driver = {
> .driver_features = DRIVER_GEM | DRIVER_MODESET,
> - .irq_handler = shmob_drm_irq,
> DRM_GEM_CMA_DRIVER_OPS,
> .fops = &shmob_drm_fops,
> .name = "shmob-drm",
> @@ -183,7 +181,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> drm_kms_helper_poll_fini(ddev);
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
> drm_dev_put(ddev);
>
> return 0;
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
Could you store the irq number in a local variable, and wrap this line
at 80 columns ? You can then use the local variable in the free_irq()
call below. With this addressed,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> if (ret < 0) {
> dev_err(&pdev->dev, "failed to install IRQ handler\n");
> goto err_modeset_cleanup;
> @@ -275,7 +273,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> return 0;
>
> err_irq_uninstall:
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
> err_modeset_cleanup:
> drm_kms_helper_poll_fini(ddev);
> err_free_drm_dev:
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
@ 2021-07-10 20:33 ` Laurent Pinchart
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2021-07-10 20:33 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: airlied, linux-renesas-soc, kieran.bingham+renesas, dri-devel
Hi Thomas,
Thank you for the patch.
On Tue, Jul 06, 2021 at 09:49:00AM +0200, Thomas Zimmermann wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 0a02b7092c04..032a2fff5efd 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -18,7 +18,6 @@
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_gem_cma_helper.h>
> -#include <drm/drm_irq.h>
> #include <drm/drm_probe_helper.h>
> #include <drm/drm_vblank.h>
>
> @@ -130,7 +129,6 @@ DEFINE_DRM_GEM_CMA_FOPS(shmob_drm_fops);
>
> static const struct drm_driver shmob_drm_driver = {
> .driver_features = DRIVER_GEM | DRIVER_MODESET,
> - .irq_handler = shmob_drm_irq,
> DRM_GEM_CMA_DRIVER_OPS,
> .fops = &shmob_drm_fops,
> .name = "shmob-drm",
> @@ -183,7 +181,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> drm_kms_helper_poll_fini(ddev);
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
> drm_dev_put(ddev);
>
> return 0;
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
Could you store the irq number in a local variable, and wrap this line
at 80 columns ? You can then use the local variable in the free_irq()
call below. With this addressed,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> if (ret < 0) {
> dev_err(&pdev->dev, "failed to install IRQ handler\n");
> goto err_modeset_cleanup;
> @@ -275,7 +273,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> return 0;
>
> err_irq_uninstall:
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
> err_modeset_cleanup:
> drm_kms_helper_poll_fini(ddev);
> err_free_drm_dev:
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
2021-07-06 7:49 ` Thomas Zimmermann
@ 2021-07-12 11:43 ` Geert Uytterhoeven
-1 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-07-12 11:43 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Laurent Pinchart, Kieran Bingham, David Airlie, Daniel Vetter,
DRI Development, Linux-Renesas
Hi Thomas,
On Tue, Jul 6, 2021 at 9:49 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for your patch!
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
platform_get_irq() can return a negative error code.
While drm_irq_install() took a signed irq parameter (and only
considered zero an error, oops), request_irq() takes an unsigned irq.
So you better check for errors before calling request_irq().
> if (ret < 0) {
> dev_err(&pdev->dev, "failed to install IRQ handler\n");
> goto err_modeset_cleanup;
> @@ -275,7 +273,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> return 0;
>
> err_irq_uninstall:
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
Similar issue here.
> err_modeset_cleanup:
> drm_kms_helper_poll_fini(ddev);
> err_free_drm_dev:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
@ 2021-07-12 11:43 ` Geert Uytterhoeven
0 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-07-12 11:43 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: David Airlie, DRI Development, Linux-Renesas, Kieran Bingham,
Laurent Pinchart
Hi Thomas,
On Tue, Jul 6, 2021 at 9:49 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for your patch!
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
platform_get_irq() can return a negative error code.
While drm_irq_install() took a signed irq parameter (and only
considered zero an error, oops), request_irq() takes an unsigned irq.
So you better check for errors before calling request_irq().
> if (ret < 0) {
> dev_err(&pdev->dev, "failed to install IRQ handler\n");
> goto err_modeset_cleanup;
> @@ -275,7 +273,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> return 0;
>
> err_irq_uninstall:
> - drm_irq_uninstall(ddev);
> + free_irq(platform_get_irq(pdev, 0), ddev);
Similar issue here.
> err_modeset_cleanup:
> drm_kms_helper_poll_fini(ddev);
> err_free_drm_dev:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
2021-07-06 7:49 ` Thomas Zimmermann
@ 2021-07-12 15:45 ` Sergei Shtylyov
-1 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2021-07-12 15:45 UTC (permalink / raw)
To: Thomas Zimmermann, laurent.pinchart, kieran.bingham+renesas,
airlied, daniel
Cc: dri-devel, linux-renesas-soc
On 7/6/21 10:49 AM, Thomas Zimmermann wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 0a02b7092c04..032a2fff5efd 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
[...]
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
You can't call request_irq() on the result of platfrom_get_irq(), you need to check ifq >= 0 first!
You really need a local (or even global) variable for the IRQ #...
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/shmobile: Convert to Linux IRQ interfaces
@ 2021-07-12 15:45 ` Sergei Shtylyov
0 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2021-07-12 15:45 UTC (permalink / raw)
To: Thomas Zimmermann, laurent.pinchart, kieran.bingham+renesas,
airlied, daniel
Cc: linux-renesas-soc, dri-devel
On 7/6/21 10:49 AM, Thomas Zimmermann wrote:
> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
> don't benefit from using it.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 0a02b7092c04..032a2fff5efd 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
[...]
> @@ -258,7 +256,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> goto err_modeset_cleanup;
> }
>
> - ret = drm_irq_install(ddev, platform_get_irq(pdev, 0));
> + ret = request_irq(platform_get_irq(pdev, 0), shmob_drm_irq, 0, ddev->driver->name, ddev);
You can't call request_irq() on the result of platfrom_get_irq(), you need to check ifq >= 0 first!
You really need a local (or even global) variable for the IRQ #...
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 9+ messages in thread