[Openpvrsgx-devgroup] [Letux-kernel] [RFC PATCH] pvrsgx: do not call mode_config stuff at suspend/resume

H. Nikolaus Schaller hns at goldelico.com
Thu Dec 19 07:47:32 CET 2019


Hi Tony,
what do you think?

Can the mode_config stuff be initialized or is it ok to drop?

BR and thanks,
Nikolaus

> Am 18.12.2019 um 21:42 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> mode_config stuff is not initialized, so there are accesses
> to uninitialized mutexes leading to kernel panics,
> at least on gta04 with letux-5.5-rc2
> 
> [   49.387023] 8<--- cut here ---
> [   49.390258] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
> [   49.398834] pgd = edc5f312
> [   49.401702] [0000000c] *pgd=8fa24831, *pte=00000000, *ppte=00000000
> [   49.408386] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
> [   49.414093] Modules linked in: omapdrm libertas_sdio libertas cfg80211 bmp280_spi snd_soc_simple_card snd_soc_simple_card_utils snd_soc_omap_twl4030 eny
> [   49.499786] CPU: 0 PID: 1400 Comm: rtcwake Tainted: G        W         5.5.0-rc2-letux+ #1
> [   49.508483] Hardware name: Generic OMAP36xx (Flattened Device Tree)
> [   49.515075] PC is at atomic_cmpxchg_relaxed+0xc/0x28
> [   49.520324] LR is at atomic_cmpxchg_relaxed+0xc/0x28
> [   49.525543] pc : [<c016e7f8>]    lr : [<c016e7f8>]    psr: 600f0013
> [   49.532135] sp : cf3f9d30  ip : 00000000  fp : c05484bc
> [   49.537628] r10: c0c6a1ac  r9 : c0cd94dc  r8 : cf4169bc
> [   49.543121] r7 : 00000000  r6 : cf3f9d8c  r5 : 0000000c  r4 : cf3f9d40
> [   49.549987] r3 : 0000000c  r2 : de210780  r1 : 00000000  r0 : 0000000c
> [   49.556854] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [   49.564361] Control: 10c5387d  Table: 8f3f0019  DAC: 00000051
> [   49.570434] Process rtcwake (pid: 1400, stack limit = 0xc166b889)
> [   49.576843] Stack: (0xcf3f9d30 to 0xcf3fa000)
> [   49.581420] 9d20:                                     cf3f9d40 c016eaf4 c0c03f48 c07f6244
> [   49.590057] 9d40: 00000000 c2ad0af1 0000000c cf3f9d8c 00000000 bf03f7c4 cf416800 fffffff8
> [   49.598663] 9d60: 00000000 cf3f9d8c cf4169bc bf03f88c cf416800 ffffffea c0c03f48 cf416800
> [   49.607299] 9d80: bf2c1a38 bf27d3b0 c0cd94dc de210780 00000073 00000001 00000000 00000000
> [   49.615905] 9da0: cf416908 cf416908 00000000 c2ad0af1 00000000 cf416800 cf416800 bf2c1a38
> [   49.624511] 9dc0: 00000002 bf27ecbc dc6df010 dc6df000 bf2c1a38 bf2c1a50 bf2c1a38 dc6df010
> [   49.633148] 9de0: bf2c1a38 c0546950 dc6df010 c0c03f48 00000001 c05481bc c0990e25 c2ad0af1
> [   49.641754] 9e00: 00000000 00000000 c0cd94dc dc6df010 dc6df0a0 00000002 c0c6a190 c05483c4
> [   49.650390] 9e20: 00000002 c0ca4488 00000000 c0cad408 c0cd94dc c0c03f48 00000003 c0c03f48
> [   49.658996] 9e40: c0ca4414 00000000 bee1ac9b c0173874 00000003 00000003 c0c04378 c2ad0af1
> [   49.667602] 9e60: 00000000 c0cd94dc c0c03f48 00000003 c0ca4414 c0cad41c 00000004 c0173de8
> [   49.676239] 9e80: 00000006 c2ad0af1 00000003 00000003 00000004 cfaf79c0 c093c18e c01727e0
> [   49.684844] 9ea0: 00000004 cf39e100 cfaf79c0 cf3f9f70 cf39e110 00000051 00000004 c02d5f44
> [   49.693450] 9ec0: 00000000 00000000 00000004 c0c03f48 00000004 00000000 b6f59000 c02d5e1c
> [   49.702087] 9ee0: b6f59000 c0259ebc 000b6f59 b6f59000 cf3f2db8 cf3f2db8 00000000 00000000
> [   49.710693] 9f00: 00000000 00000000 cf52e564 dfbdb5d4 00000000 c2ad0af1 c0c03f48 cf3f9fb0
> [   49.719299] 9f20: de45b600 c03d6dac c09d135c de45b600 00000002 b6f59000 cf3f9f70 c2ad0af1
> [   49.727935] 9f40: de45b600 00000004 00000000 b6f59000 cf3f9f70 c025b338 de45b600 b6f59000
> [   49.736541] 9f60: cf3f9f70 c0c03f48 cf3f9f7c c025b4c0 00000000 00000000 00000003 de45b600
> [   49.745178] 9f80: 00000000 c2ad0af1 00000004 b6f59000 000260d0 00000004 c0101204 cf3f8000
> [   49.753784] 9fa0: 00000004 c0101000 00000004 b6f59000 00000004 b6f59000 00000004 00000000
> [   49.762390] 9fc0: 00000004 b6f59000 000260d0 00000004 00000004 00000000 00013978 bee1ac9b
> [   49.770996] 9fe0: 00000000 bee1ab9c b6e97c3d b6ed0cf6 400f0030 00000004 00000000 00000000
> [   49.779632] [<c016e7f8>] (atomic_cmpxchg_relaxed) from [<c016eaf4>] (atomic_try_cmpxchg_acquire.constprop.12+0x10/0x28)
> [   49.790985] [<c016eaf4>] (atomic_try_cmpxchg_acquire.constprop.12) from [<c07f6244>] (ww_mutex_lock+0x38/0x74)
> [   49.802001] [<c07f6244>] (ww_mutex_lock) from [<bf03f7c4>] (modeset_lock+0xe4/0xf4 [drm])
> [   49.811401] [<bf03f7c4>] (modeset_lock [drm]) from [<bf03f88c>] (drm_modeset_lock_all_ctx+0x38/0xb4 [drm])
> [   49.822204] [<bf03f88c>] (drm_modeset_lock_all_ctx [drm]) from [<bf27d3b0>] (drm_atomic_helper_suspend+0x34/0xc8 [drm_kms_helper])
> [   49.834838] [<bf27d3b0>] (drm_atomic_helper_suspend [drm_kms_helper]) from [<bf27ecbc>] (drm_mode_config_helper_suspend+0x28/0x5c [drm_kms_helper])
> [   49.849273] [<bf27ecbc>] (drm_mode_config_helper_suspend [drm_kms_helper]) from [<bf2c1a50>] (pvr_suspend+0x18/0x48 [pvrsrvkm_omap3630_sgx530_125])
> [   49.863494] [<bf2c1a50>] (pvr_suspend [pvrsrvkm_omap3630_sgx530_125]) from [<c0546950>] (dpm_run_callback+0x28/0x54)
> [   49.874572] [<c0546950>] (dpm_run_callback) from [<c05481bc>] (__device_suspend_noirq+0xec/0x258)
> [   49.883941] [<c05481bc>] (__device_suspend_noirq) from [<c05483c4>] (dpm_suspend_noirq+0x9c/0x194)
> [   49.893371] [<c05483c4>] (dpm_suspend_noirq) from [<c0173874>] (suspend_devices_and_enter+0x168/0x504)
> [   49.903167] [<c0173874>] (suspend_devices_and_enter) from [<c0173de8>] (pm_suspend+0x1d8/0x270)
> [   49.912322] [<c0173de8>] (pm_suspend) from [<c01727e0>] (state_store+0x9c/0xcc)
> [   49.920043] [<c01727e0>] (state_store) from [<c02d5f44>] (kernfs_fop_write+0x128/0x1f4)
> [   49.928497] [<c02d5f44>] (kernfs_fop_write) from [<c0259ebc>] (__vfs_write+0x28/0xe0)
> [   49.936737] [<c0259ebc>] (__vfs_write) from [<c025b338>] (vfs_write+0x98/0xbc)
> [   49.944366] [<c025b338>] (vfs_write) from [<c025b4c0>] (ksys_write+0x68/0xb4)
> [   49.951873] [<c025b4c0>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
> [   49.959930] Exception stack(0xcf3f9fa8 to 0xcf3f9ff0)
> [   49.965270] 9fa0:                   00000004 b6f59000 00000004 b6f59000 00000004 00000000
> [   49.973876] 9fc0: 00000004 b6f59000 000260d0 00000004 00000004 00000000 00013978 bee1ac9b
> [   49.982482] 9fe0: 00000000 bee1ab9c b6e97c3d b6ed0cf6
> [   49.987823] Code: e12fff1e e92d4010 e1a03000 ebfffffa (e1930f9f)
> [   49.994537] ---[ end trace b9c5a6ec140cc4b0 ]---
> 
> Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
> ---
> drivers/gpu/drm/pvrsgx/pvr-drv.c | 14 --------------
> 1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/pvrsgx/pvr-drv.c b/drivers/gpu/drm/pvrsgx/pvr-drv.c
> index 86ebbec7f65b..9b17f6bb09f5 100644
> --- a/drivers/gpu/drm/pvrsgx/pvr-drv.c
> +++ b/drivers/gpu/drm/pvrsgx/pvr-drv.c
> @@ -183,13 +183,6 @@ static int __maybe_unused pvr_runtime_resume(struct device *dev)
> static int pvr_suspend(struct device *dev)
> {
> 	struct platform_device *pdev = to_platform_device(dev);
> -	struct pvr *ddata = dev_get_drvdata(dev);
> -	struct drm_device *drm_dev = ddata->ddev;
> -	int error;
> -
> -	error = drm_mode_config_helper_suspend(drm_dev);
> -	if (error)
> -		dev_warn(dev, "%s: error: %i\n", __func__, error);
> 
> 	return PVRSRVDriverSuspend(pdev, PMSG_SUSPEND);
> }
> @@ -197,13 +190,6 @@ static int pvr_suspend(struct device *dev)
> static int pvr_resume(struct device *dev)
> {
> 	struct platform_device *pdev = to_platform_device(dev);
> -	struct pvr *ddata = dev_get_drvdata(dev);
> -	struct drm_device *drm_dev = ddata->ddev;
> -	int error;
> -
> -	error = drm_mode_config_helper_resume(drm_dev);
> -	if (error)
> -		dev_warn(dev, "%s: error: %i\n", __func__, error);
> 
> 	return PVRSRVDriverResume(pdev);
> }
> -- 
> 2.20.1
> 
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel



More information about the openpvrsgx-devgroup mailing list