[PATCH 1/2] drm/tilcdc: use drm_fbdev_generic_setup

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Mar 6 01:23:50 UTC 2019


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 at 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 at 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:

-- 
Regards,

Laurent Pinchart


More information about the dri-devel mailing list