drm/rockchip: drv: move clk unprotect to the end of drm_bind

rockchip_drm_bind() may be delayed for others driver delay probe,
this maybe cause rockchip_drm_show_logo() be called after
rockchip_clocks_loader_unprotect() and lead to display error,
so move clk unprotect to the end of drm_bind.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6eeae1c1307f91777fec23c66c5d5413443335d0
This commit is contained in:
Sandy Huang
2025-02-21 09:31:06 +08:00
committed by Tao Huang
parent 8ad85fa81d
commit 82294562bc
3 changed files with 12 additions and 3 deletions

View File

@@ -1906,6 +1906,7 @@ static int rockchip_drm_bind(struct device *dev)
goto err_drm_fbdev_fini;
rockchip_drm_error_event_init(drm_dev);
rockchip_clocks_loader_unprotect();
return 0;
err_drm_fbdev_fini:

View File

@@ -1316,7 +1316,7 @@ static const char *const loader_protect_clocks[] __initconst = {
"dclk_vp3",
};
static struct clk **loader_clocks __initdata;
static struct clk **loader_clocks;
static int __init rockchip_clocks_loader_protect(void)
{
int nclocks = ARRAY_SIZE(loader_protect_clocks);
@@ -1340,7 +1340,7 @@ static int __init rockchip_clocks_loader_protect(void)
}
arch_initcall_sync(rockchip_clocks_loader_protect);
static int __init rockchip_clocks_loader_unprotect(void)
int rockchip_clocks_loader_unprotect(void)
{
int i;
@@ -1354,8 +1354,8 @@ static int __init rockchip_clocks_loader_unprotect(void)
clk_disable_unprepare(clk);
}
kfree(loader_clocks);
loader_clocks = NULL;
return 0;
}
late_initcall_sync(rockchip_clocks_loader_unprotect);
#endif

View File

@@ -42,5 +42,13 @@ struct rockchip_drm_mode_set {
void rockchip_drm_show_logo(struct drm_device *drm_dev);
void rockchip_free_loader_memory(struct drm_device *drm);
#ifndef MODULE
int rockchip_clocks_loader_unprotect(void);
#else
static inline int rockchip_clocks_loader_unprotect(void)
{
return 0;
}
#endif
#endif