mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
cpufreq: interactive: fix: slack timer may be modified before start
cpufreq_interactive_idle_end() may modify slack timer before the timer is started, so hold the icpu->enable_sem lock when start slack timer to avoid cpufreq_interactive_idle_end() modify the slack timer. [ 3.661627] Call trace: [ 3.664080] add_timer_on+0x1f8/0x200 [ 3.667744] slack_timer_resched+0x9c/0xf8 [ 3.671850] cpufreq_interactive_start+0xa8/0x140 [ 3.676560] cpufreq_start_governor+0x4c/0x98 [ 3.680921] cpufreq_set_policy+0x274/0x290 [ 3.685112] cpufreq_init_policy+0x6c/0xc0 [ 3.689219] cpufreq_online+0x510/0x6a8 [ 3.693062] cpufreq_add_dev+0x78/0x88 [ 3.696822] subsys_interface_register+0xb4/0x128 [ 3.701530] cpufreq_register_driver+0x168/0x1e8 [ 3.706153] dt_cpufreq_probe+0xb0/0x150 [ 3.710081] platform_drv_probe+0x50/0xa8 [ 3.714092] really_probe+0x1f8/0x298 [ 3.717755] driver_probe_device+0x58/0x100 [ 3.721946] __device_attach_driver+0x90/0xe0 [ 3.726304] bus_for_each_drv+0x70/0xc8 [ 3.730146] __device_attach+0xdc/0x138 [ 3.733988] device_initial_probe+0x10/0x18 [ 3.738178] bus_probe_device+0x94/0xa0 [ 3.742023] device_add+0x5e0/0x6d0 [ 3.745519] platform_device_add+0x10c/0x258 [ 3.749795] platform_device_register_full+0x100/0x130 [ 3.754939] rockchip_cpufreq_driver_init+0x30c/0x3c0 [ 3.759996] do_one_initcall+0x48/0x240 [ 3.763841] kernel_init_freeable+0x210/0x37c [ 3.768203] kernel_init+0x10/0x108 [ 3.771698] ret_from_fork+0x10/0x18 Change-Id: Ie5d67721def448b7bbf9e3b9a6d60341eb0b8a0b Signed-off-by: Liang Chen <cl@rock-chips.com>
This commit is contained in:
@@ -1502,9 +1502,8 @@ int cpufreq_interactive_start(struct cpufreq_policy *policy)
|
||||
|
||||
down_write(&icpu->enable_sem);
|
||||
icpu->ipolicy = ipolicy;
|
||||
up_write(&icpu->enable_sem);
|
||||
|
||||
slack_timer_resched(icpu, cpu, false);
|
||||
up_write(&icpu->enable_sem);
|
||||
}
|
||||
|
||||
gov_set_update_util(ipolicy);
|
||||
|
||||
Reference in New Issue
Block a user