From 378cb4994df4e32db5d93611519cc4e30ad448fd Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 10 Jul 2019 08:31:04 +0800 Subject: [PATCH] Revert "PM / devfreq: rockchip_dmc: Fix using smp_processor_id() in preemptible warning" This reverts commit 67721b1381452b7a3b957a58e35a720ee3ab2a5a. The get_cup() will disable preemption and the clk_set_rate() may call schedule() on some platforms, otherwise we may schedule while atomic. BUG: scheduling while atomic: sh/552/0x00000002 Modules linked in: CPU: 1 PID: 552 Comm: sh Not tainted 4.4.179 #1122 Hardware name: Rockchip RK1808 EVB V10 Board (DT) Call trace: [] dump_backtrace+0x0/0x1cc [] show_stack+0x14/0x1c [] dump_stack+0x94/0xbc [] __schedule_bug+0x3c/0x54 [] __schedule+0x88/0x460[root@rk1808:/]# [] schedule+0x74/0x94 [] schedule_timeout+0x148/0x178 [] rockchip_dmcfreq_wait_complete+0x11c/0x144 [] rockchip_ddrclk_sip_set_rate_v2+0x64/0x74 [] clk_change_rate+0xd4/0x208 [] clk_core_set_rate_nolock+0x90/0xa4 [] clk_set_rate+0x28/0x48 [] rockchip_dmcfreq_target+0x1f0/0x320 [] update_devfreq+0x118/0x1ac [] store_freq+0x5c/0x84 [] dev_attr_store+0x18/0x28 [] sysfs_kf_write+0x38/0x50 [] kernfs_fop_write+0x114/0x170 [] __vfs_write+0x1c/0xc4 [] vfs_write+0x9c/0x150 [] SyS_write+0x44/0x88 [] el0_svc_naked+0x24/0x28 Change-Id: I18f3ee81139ca2908d91a7ef59d3635d1a7e69cb Signed-off-by: Tao Huang --- drivers/devfreq/rockchip_dmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/devfreq/rockchip_dmc.c b/drivers/devfreq/rockchip_dmc.c index 9b08cb98f107..5eda7b59b47f 100644 --- a/drivers/devfreq/rockchip_dmc.c +++ b/drivers/devfreq/rockchip_dmc.c @@ -1353,7 +1353,7 @@ static int rockchip_dmcfreq_target(struct device *dev, unsigned long *freq, * Go to specified cpufreq and block other cpufreq changes since * set_rate needs to complete during vblank. */ - cpu_cur = get_cpu(); + cpu_cur = smp_processor_id(); policy = cpufreq_cpu_get(cpu_cur); if (!policy) { dev_err(dev, "cpu%d policy NULL\n", cpu_cur); @@ -1443,7 +1443,6 @@ out: up_write(&policy->rwsem); cpufreq_cpu_put(policy); cpufreq: - put_cpu(); put_online_cpus(); return err; }