dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: arcfb: add missed free_irq
@ 2019-11-16 15:44 ` Chuhong Yuan
  2019-11-16 15:44   ` Chuhong Yuan
  2020-01-15 15:09   ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 3+ messages in thread
From: Chuhong Yuan @ 2019-11-16 15:44 UTC (permalink / raw)
  Cc: Jaya Kumar, Bartlomiej Zolnierkiewicz, dri-devel, linux-fbdev,
	linux-kernel, Chuhong Yuan

The driver forgets to free irq in remove which is requested in
probe.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/video/fbdev/arcfb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index a48741aab240..7aed01f001a4 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -590,8 +590,11 @@ static int arcfb_probe(struct platform_device *dev)
 static int arcfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
+	struct arcfb_par *par = info->par;
 
 	if (info) {
+		if (irq)
+			free_irq(par->irq, info);
 		unregister_framebuffer(info);
 		vfree((void __force *)info->screen_base);
 		framebuffer_release(info);
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] video: fbdev: arcfb: add missed free_irq
  2019-11-16 15:44 ` [PATCH] video: fbdev: arcfb: add missed free_irq Chuhong Yuan
@ 2019-11-16 15:44   ` Chuhong Yuan
  2020-01-15 15:09   ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 3+ messages in thread
From: Chuhong Yuan @ 2019-11-16 15:44 UTC (permalink / raw)
  Cc: linux-fbdev, Bartlomiej Zolnierkiewicz, Chuhong Yuan,
	linux-kernel, dri-devel, Jaya Kumar

The driver forgets to free irq in remove which is requested in
probe.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/video/fbdev/arcfb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index a48741aab240..7aed01f001a4 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -590,8 +590,11 @@ static int arcfb_probe(struct platform_device *dev)
 static int arcfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
+	struct arcfb_par *par = info->par;
 
 	if (info) {
+		if (irq)
+			free_irq(par->irq, info);
 		unregister_framebuffer(info);
 		vfree((void __force *)info->screen_base);
 		framebuffer_release(info);
-- 
2.24.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] video: fbdev: arcfb: add missed free_irq
  2019-11-16 15:44 ` [PATCH] video: fbdev: arcfb: add missed free_irq Chuhong Yuan
  2019-11-16 15:44   ` Chuhong Yuan
@ 2020-01-15 15:09   ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-15 15:09 UTC (permalink / raw)
  To: Chuhong Yuan; +Cc: linux-fbdev, linux-kernel, dri-devel, Jaya Kumar


On 11/16/19 4:44 PM, Chuhong Yuan wrote:
> The driver forgets to free irq in remove which is requested in
> probe.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/video/fbdev/arcfb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
> index a48741aab240..7aed01f001a4 100644
> --- a/drivers/video/fbdev/arcfb.c
> +++ b/drivers/video/fbdev/arcfb.c
> @@ -590,8 +590,11 @@ static int arcfb_probe(struct platform_device *dev)
>  static int arcfb_remove(struct platform_device *dev)
>  {
>  	struct fb_info *info = platform_get_drvdata(dev);
> +	struct arcfb_par *par = info->par;
>  
>  	if (info) {
> +		if (irq)
> +			free_irq(par->irq, info);
>  		unregister_framebuffer(info);

We cannot free IRQ while framebuffer is registered (as we can
deadlock in arcfb_ioctl()).

Also it seems that ordering in the probe function is wrong
(it should not request IRQ or initialize the hardware after
registering framebuffer).

>  		vfree((void __force *)info->screen_base);
>  		framebuffer_release(info);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-15 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20191116154430eucas1p21c738a988e3bc0c3544a388c71f4a75c@eucas1p2.samsung.com>
2019-11-16 15:44 ` [PATCH] video: fbdev: arcfb: add missed free_irq Chuhong Yuan
2019-11-16 15:44   ` Chuhong Yuan
2020-01-15 15:09   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).