From 73b5dde370957bcfddb30e2ac5a3cd4f56197824 Mon Sep 17 00:00:00 2001 From: Zhen Chen Date: Wed, 14 Jun 2023 11:52:35 +0800 Subject: [PATCH] MALI: bifrost: Not to call kbase_ipa_reset_data() if rockchip simple-power-model is used When rockchip simple-power-model is used, kbase_ipa_reset_data() for the default mali power models should not be called. The issue is exposed by the following exception logs: [ 3.406039] ------------[ cut here ]------------ [ 3.406056] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 3.406081] WARNING: CPU: 1 PID: 154 at kernel/locking/mutex.c:955 __mutex_lock_common+0x974/0xbc0 [ 3.406094] Modules linked in: [ 3.406111] CPU: 1 PID: 154 Comm: kworker/u16:3 Not tainted 5.10.157 #110 [ 3.406118] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT) [ 3.406132] Workqueue: devfreq_wq devfreq_monitor [ 3.406144] pstate: 60c00009 (nZCv daif +PAN +UAO -TCO BTYPE=--) [ 3.406152] pc : __mutex_lock_common+0x974/0xbc0 [ 3.406161] lr : __mutex_lock_common+0x974/0xbc0 ... [ 3.406342] Call trace: [ 3.406351] __mutex_lock_common+0x974/0xbc0 [ 3.406361] mutex_lock_nested+0x50/0x5c [ 3.406374] kbase_ipa_reset_data+0x40/0x154 [ 3.406384] kbase_devfreq_status+0x60/0x90 [ 3.406394] devfreq_simple_ondemand_func+0x34/0x104 [ 3.406401] update_devfreq+0x60/0xf0 [ 3.406408] devfreq_monitor+0x34/0x9c [ 3.406421] process_one_work+0x218/0x358 [ 3.406429] worker_thread+0x230/0x4e0 [ 3.406439] kthread+0x144/0x160 [ 3.406449] ret_from_fork+0x10/0x30 Fixes: 68c4487930fc ("MALI: bifrost: not to call kbase_ipa_init() if rockchip simple-power-model is used") Change-Id: I5fb5d4b6e63df77e6ea45ab3c60d627e3d0a03a2 Signed-off-by: Zhen Chen --- drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_devfreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_devfreq.c b/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_devfreq.c index 4e21334ceeb8..02fb00da365c 100644 --- a/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_devfreq.c +++ b/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_devfreq.c @@ -304,7 +304,8 @@ kbase_devfreq_status(struct device *dev, struct devfreq_dev_status *stat) stat->private_data = NULL; #if MALI_USE_CSF && defined CONFIG_DEVFREQ_THERMAL - kbase_ipa_reset_data(kbdev); + if (!kbdev->dfc_power.dyn_power_coeff) + kbase_ipa_reset_data(kbdev); #endif return 0;