Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/rockchip: Fix shutdown when no drm-device is set up

When the drm-driver probes, it mainly creates the component device, where
all the sub-drivers (vops, hdmi, etc) hook into.

This will cause the shutdown handler to get called on shutdown, even
though the drm-device might not have been set up, or the component bind
might have failed.

So use the new component helper to check whether the drm-device is up
and only then call the drm-atomic helper to release all the drm magic.

This prevents failures when the drm-device is never set, or has been
freed up already for example by a probe-defer during the component bind.

Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250220234141.2788785-3-heiko@sntech.de

+4 -2
+4 -2
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
··· 484 484 485 485 static void rockchip_drm_platform_shutdown(struct platform_device *pdev) 486 486 { 487 - struct drm_device *drm = platform_get_drvdata(pdev); 487 + if (component_master_is_bound(&pdev->dev, &rockchip_drm_ops)) { 488 + struct drm_device *drm = platform_get_drvdata(pdev); 488 489 489 - drm_atomic_helper_shutdown(drm); 490 + drm_atomic_helper_shutdown(drm); 491 + } 490 492 } 491 493 492 494 static const struct of_device_id rockchip_drm_dt_ids[] = {