diff mbox series

[1/2] drm/tilcdc: use drm_fbdev_generic_setup

Message ID a1cf2a08064a06d89a4a906712f6d82de605b01a.1550217735.git.jsarha@ti.com (mailing list archive)
State New, archived
Headers show
Series drm/tilcdc: A fix and a clean-up for tilcdc | expand

Commit Message

kernel test robot via dri-devel Feb. 15, 2019, 8:13 a.m. UTC
Calling drm_fbdev_cma_fini() after drm_dev_unregister() started to
cause a crash when unloading tilcdc some time between 4.14 and
4.19. Instead of changing the unload order it looks like using
drm_fbdev_generic_setup() is the direction to go.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Laurent Pinchart March 6, 2019, 1:23 a.m. UTC | #1
Hi Jyri,

Thank you for the patch.

On Fri, Feb 15, 2019 at 10:13:15AM +0200, Jyri Sarha wrote:
> Calling drm_fbdev_cma_fini() after drm_dev_unregister() started to
> cause a crash when unloading tilcdc some time between 4.14 and
> 4.19. Instead of changing the unload order it looks like using
> drm_fbdev_generic_setup() is the direction to go.

Yes, it's the way to go, but I'm afraid you're a bit too late:

commit 45cf87566e5686c919247610200af7b365e86a1f
Author: Noralf Trønnes <noralf@tronnes.org>
Date:   Thu Oct 25 22:13:39 2018 +0200

    drm/tilcdc: Use drm_fbdev_generic_setup()

got merged in v5.0.

> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 33e533268488..6d84491f2a4f 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -192,8 +192,6 @@ static void tilcdc_fini(struct drm_device *dev)
>  
>  	drm_kms_helper_poll_fini(dev);
>  
> -	drm_fb_cma_fbdev_fini(dev);
> -
>  	drm_irq_uninstall(dev);
>  	drm_mode_config_cleanup(dev);
>  	tilcdc_remove_external_device(dev);
> @@ -396,10 +394,6 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
>  
>  	drm_mode_config_reset(ddev);
>  
> -	ret = drm_fb_cma_fbdev_init(ddev, bpp, 0);
> -	if (ret)
> -		goto init_failed;
> -
>  	drm_kms_helper_poll_init(ddev);
>  
>  	ret = drm_dev_register(ddev, 0);
> @@ -407,6 +401,9 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
>  		goto init_failed;
>  
>  	priv->is_registered = true;
> +
> +	drm_fbdev_generic_setup(ddev, bpp);
> +
>  	return 0;
>  
>  init_failed:
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 33e533268488..6d84491f2a4f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -192,8 +192,6 @@  static void tilcdc_fini(struct drm_device *dev)
 
 	drm_kms_helper_poll_fini(dev);
 
-	drm_fb_cma_fbdev_fini(dev);
-
 	drm_irq_uninstall(dev);
 	drm_mode_config_cleanup(dev);
 	tilcdc_remove_external_device(dev);
@@ -396,10 +394,6 @@  static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
 
 	drm_mode_config_reset(ddev);
 
-	ret = drm_fb_cma_fbdev_init(ddev, bpp, 0);
-	if (ret)
-		goto init_failed;
-
 	drm_kms_helper_poll_init(ddev);
 
 	ret = drm_dev_register(ddev, 0);
@@ -407,6 +401,9 @@  static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
 		goto init_failed;
 
 	priv->is_registered = true;
+
+	drm_fbdev_generic_setup(ddev, bpp);
+
 	return 0;
 
 init_failed: