Commits
Laurentiu Palcu committed ee1d6001c8f
LF-900: drm/imx/dcss: Fix kernel panic during suspend If the HDMI FW is not loaded and the HDP driver fails to bind, we'll get the following kernel panic when suspending: [ 390.463445] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000028 [ 390.472240] Mem abort info: [ 390.475044] ESR = 0x96000006 [ 390.478109] EC = 0x25: DABT (current EL), IL = 32 bits [ 390.483429] SET = 0, FnV = 0 [ 390.486492] EA = 0, S1PTW = 0 [ 390.489641] Data abort info: [ 390.492521] ISV = 0, ISS = 0x00000006 [ 390.496368] CM = 0, WnR = 0 [ 390.499347] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000f7313000 [ 390.505796] [0000000000000028] pgd=00000000f6fb1003, pud=00000000f6f0a003, pmd=0000000000000000 [ 390.514509] Internal error: Oops: 96000006 [#1] PREEMPT SMP [ 390.520080] Modules linked in: rpcsec_gss_krb5 crct10dif_ce [ 390.525660] CPU: 0 PID: 810 Comm: rtc_testapp_6 Not tainted 5.4.3-00011-g6a04861-dirty #4 [ 390.533835] Hardware name: NXP i.MX8MQ EVK (DT) [ 390.538366] pstate: 00000005 (nzcv daif -PAN -UAO) [ 390.543165] pc : dcss_dev_suspend+0x54/0xc0 [ 390.547348] lr : dcss_dev_suspend+0x48/0xc0 [ 390.551530] sp : ffff80001304bae0 [ 390.554843] x29: ffff80001304bae0 x28: 0000000000000000 [ 390.560156] x27: ffff800011a04000 x26: 0000000000000002 [ 390.565469] x25: ffff800011a04bb0 x24: ffff800011b35000 [ 390.570781] x23: 0000000000000000 x22: ffff800011ae9000 [ 390.576093] x21: ffff0000ba412810 x20: 0000000000000000 [ 390.581405] x19: ffff0000ba412810 x18: ffffffffffffffff [ 390.586718] x17: 0000000000000000 x16: 0000000000000000 [ 390.592030] x15: ffff8000119988c8 x14: ffff80009304b837 [ 390.597342] x13: ffff80001304b845 x12: ffff8000119b1000 [ 390.602654] x11: 0000000005f5e0ff x10: ffff800011999120 [ 390.607966] x9 : 00000000ffffffd0 x8 : 00000000000001c1 [ 390.613279] x7 : 0000000000000006 x6 : ffff0000bf96b188 [ 390.618591] x5 : ffff0000bf96b188 x4 : 0000000000000000 [ 390.623903] x3 : ffff0000bf971f20 x2 : 4c972fd4ba12ac00 [ 390.629215] x1 : 0000000000000000 x0 : 0000000000000041 [ 390.634527] Call trace: [ 390.636976] dcss_dev_suspend+0x54/0xc0 [ 390.640813] platform_pm_suspend+0x24/0x68 [ 390.644913] dpm_run_callback.isra.18+0x3c/0xe0 [ 390.649445] __device_suspend+0x138/0x3d0 [ 390.653456] dpm_suspend+0xec/0x1f0 [ 390.656945] dpm_suspend_start+0x98/0xa0 [ 390.660871] suspend_devices_and_enter+0xd8/0x618 [ 390.665576] pm_suspend+0x29c/0x330 [ 390.669064] state_store+0x88/0x108 [ 390.672556] kobj_attr_store+0x14/0x28 [ 390.676309] sysfs_kf_write+0x3c/0x50 [ 390.679972] kernfs_fop_write+0x138/0x228 [ 390.683983] __vfs_write+0x18/0x38 [ 390.687385] vfs_write+0xb4/0x1e8 [ 390.690701] ksys_write+0x68/0xf8 [ 390.694016] __arm64_sys_write+0x14/0x20 [ 390.697943] el0_svc_common.constprop.2+0x64/0x168 [ 390.702735] el0_svc_handler+0x20/0x80 [ 390.706485] el0_svc+0x8/0xc [ 390.709370] Code: 97e7d098 b941b660 7100081f 54000200 (f9401680) [ 390.715465] ---[ end trace 274b7ccd273e0df4 ]--- This happens because the DCSS driver's suspend/resume routines will be called anyway, even if the pipeline is not entirely bound and DCSS structure not initialized. So, add extra checks in the DCSS suspend/resume routines. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>