mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
drm/rockchip: vop2: fix NULL point issue when access VOP internal PD.
Only VOP for RK3588 has internal PD. VOP in other SoC try to get PD will return NULL, which may cause NULL pointer issue as follow: [08/16/10:45:00:494][ 44.750259][ T278] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 [08/16/10:45:00:494][ 44.751855][ T278] Mem abort info: [08/16/10:45:00:494][ 44.752174][ T278] ESR = 0x96000005 [08/16/10:45:00:494][ 44.752513][ T278] EC = 0x25: DABT (current EL), IL = 32 bits [08/16/10:45:00:494][ 44.753042][ T278] SET = 0, FnV = 0 [08/16/10:45:00:494][ 44.753402][ T278] EA = 0, S1PTW = 0 [08/16/10:45:00:494][ 44.753752][ T278] Data abort info: [08/16/10:45:00:494][ 44.754076][ T278] ISV = 0, ISS = 0x00000005 [08/16/10:45:00:494][ 44.754478][ T278] CM = 0, WnR = 0 [08/16/10:45:00:494][ 44.754804][ T278] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000002961000 [08/16/10:45:00:495][ 44.755434][ T278] [0000000000000020] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 [08/16/10:45:00:495][ 44.756272][ T278] Internal error: Oops: 96000005 [#1] PREEMPT SMP [08/16/10:45:00:495][ 44.756830][ T278] Modules linked in: bcmdhd dhd_static_buf [08/16/10:45:00:495][ 44.757343][ T278] CPU: 0 PID: 278 Comm: composer@2.1-se Not tainted 5.10.110 #206 [08/16/10:45:00:495][ 44.758019][ T278] Hardware name: Rockchip RK3566 RK817 TABLET LP4X Board (DT) [08/16/10:45:00:495][ 44.758664][ T278] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--) [08/16/10:45:00:495][ 44.759268][ T278] pc : vop2_power_domain_status+0x30/0x10c [08/16/10:45:00:496][ 44.759781][ T278] lr : vop2_crtc_atomic_disable+0x1bc/0xb70 [08/16/10:45:00:496][ 44.760288][ T278] sp : ffffffc01497b9e0 [08/16/10:45:00:496][ 44.760645][ T278] x29: ffffffc01497b9f0 x28: ffffff8041362800 [08/16/10:45:00:496][ 44.761182][ T278] x27: ffffffc0122b9000 x26: ffffff81f1662938 [08/16/10:45:00:496][ 44.761713][ T278] x25: 0000000000000000 x24: ffffff8041360400 [08/16/10:45:00:496][ 44.762243][ T278] x23: 0000000000000000 x22: ffffff8041362800 [08/16/10:45:00:496][ 44.762775][ T278] x21: ffffff81f1660080 x20: 0000000000000000 [08/16/10:45:00:496][ 44.763306][ T278] x19: 0000000000000000 x18: ffffffc014955070 [08/16/10:45:00:496][ 44.763836][ T278] x17: 071c71c71c71c71c x16: 0000000000000001 [08/16/10:45:00:497][ 44.764366][ T278] x15: 0000000000000000 x14: 00000000000017d4 [08/16/10:45:00:497][ 44.764896][ T278] x13: 0000000000000000 x12: ffffffc0112e2f60 [08/16/10:45:00:497][ 44.765427][ T278] x11: ffffffc012c58000 x10: 0000000000000000 [08/16/10:45:00:497][ 44.765957][ T278] x9 : ffffff81f16629a8 x8 : 6b3fc41c13181400 [08/16/10:45:00:497][ 44.766487][ T278] x7 : 0000000000000000 x6 : 0000000000000000 [08/16/10:45:00:497][ 44.767018][ T278] x5 : fffffffebff8efe8 x4 : ffffff81ff6d8c70 [08/16/10:45:00:497][ 44.767547][ T278] x3 : 0000000000000008 x2 : ffffffc01497b9e4 [08/16/10:45:00:497][ 44.768077][ T278] x1 : 0000000000000010 x0 : 0000000000000000 [08/16/10:45:00:497][ 44.768608][ T278] Call trace: [08/16/10:45:00:498][ 44.768895][ T278] vop2_power_domain_status+0x30/0x10c [08/16/10:45:00:498][ 44.769371][ T278] vop2_crtc_atomic_disable+0x1bc/0xb70 [08/16/10:45:00:498][ 44.769849][ T278] drm_atomic_helper_commit_modeset_disables+0x26c/0x4d0 [08/16/10:45:00:498][ 44.770462][ T278] rockchip_drm_atomic_helper_commit_tail_rpm+0x44/0x184 [08/16/10:45:00:498][ 44.771071][ T278] commit_tail+0x110/0x200 [08/16/10:45:00:498][ 44.771453][ T278] drm_atomic_helper_commit+0x1f0/0x210 [08/16/10:45:00:498][ 44.771940][ T278] drm_atomic_commit+0x50/0x64 [08/16/10:45:00:498][ 44.772360][ T278] drm_mode_atomic_ioctl+0x620/0x744 [08/16/10:45:00:498][ 44.772823][ T278] drm_ioctl+0x24c/0x3b8 [08/16/10:45:00:498][ 44.773201][ T278] __arm64_sys_ioctl+0x94/0xd0 [08/16/10:45:00:498][ 44.773623][ T278] el0_svc_common+0xc0/0x23c [08/16/10:45:00:499][ 44.774017][ T278] do_el0_svc+0x28/0x88 [08/16/10:45:00:499][ 44.774381][ T278] el0_svc+0x14/0x24 [08/16/10:45:00:499][ 44.774719][ T278] el0_sync_handler+0x88/0xec [08/16/10:45:00:499][ 44.775124][ T278] el0_sync+0x1a8/0x1c0 Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com> Change-Id: I8054625f600598fe413a5d6f5ee691ae2782ec8f
This commit is contained in:
@@ -3828,12 +3828,12 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
vop2_disable_all_planes_for_crtc(crtc);
|
||||
|
||||
/*
|
||||
* A workaround for PD_ESMART, we can't dynamic
|
||||
* turn on/off it at runtime, so it can only be
|
||||
* turn down when the whole VOP_PD off.
|
||||
* A workaround for RK3588's PD_ESMART, we can't
|
||||
* dynamic turn on/off it at runtime, so it can
|
||||
* only be turn down when the whole VOP_PD off.
|
||||
* see vop2_power_domain_put at vop2_win_disable
|
||||
*/
|
||||
if (vop2->enable_count == 1)
|
||||
if (vop2->version == VOP_VERSION_RK3588 && vop2->enable_count == 1)
|
||||
vop2_power_domain_esmat_off(crtc);
|
||||
|
||||
if (vop2->dscs[vcstate->dsc_id].enabled &&
|
||||
|
||||
Reference in New Issue
Block a user