Skip to content

Commit 3ee348e

Browse files
Andy Yanmmind
authored andcommitted
drm/rockchip: vop2: Avoid use regmap_reinit_cache at runtime
Marek Report a possible irq lock inversion dependency warning when commit 81a06f1 ("Revert "drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume"") lands linux-next. I can reproduce this warning with: CONFIG_PROVE_LOCKING=y CONFIG_DEBUG_LOCKDEP=y It seems than when use regmap_reinit_cache at runtime whith Mark's commit 3d59c22 ("drm/rockchip: vop2: Convert to use maple tree register cache"), it will trigger a possible irq lock inversion dependency warning. One solution is switch back to REGCACHE_RBTREE, but it seems that REGCACHE_MAPLE is the future, so I avoid using regmap_reinit_cache, and drop all the regcache when vop is disabled, then we get a fresh start at next enbable time. Fixes: 81a06f1 ("Revert "drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume"") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Closes: https://lore.kernel.org/all/98a9f15d-30ac-47bf-9b93-3aa2c9900f7b@samsung.com/ Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> [dropped the large kernel log of the lockdep report from the message] Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20231217084415.2373043-1-andyshrk@163.com
1 parent 971740a commit 3ee348e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -959,12 +959,6 @@ static void vop2_enable(struct vop2 *vop2)
959959
return;
960960
}
961961

962-
ret = regmap_reinit_cache(vop2->map, &vop2_regmap_config);
963-
if (ret) {
964-
drm_err(vop2->drm, "failed to reinit cache: %d\n", ret);
965-
return;
966-
}
967-
968962
if (vop2->data->soc_id == 3566)
969963
vop2_writel(vop2, RK3568_OTP_WIN_EN, 1);
970964

@@ -996,6 +990,8 @@ static void vop2_disable(struct vop2 *vop2)
996990

997991
pm_runtime_put_sync(vop2->dev);
998992

993+
regcache_drop_region(vop2->map, 0, vop2_regmap_config.max_register);
994+
999995
clk_disable_unprepare(vop2->pclk);
1000996
clk_disable_unprepare(vop2->aclk);
1001997
clk_disable_unprepare(vop2->hclk);

0 commit comments

Comments
 (0)