From: 黄涛 Date: Fri, 1 Feb 2013 09:37:55 +0000 (+0800) Subject: rk: ddr_freq: version 2.1 X-Git-Tag: firefly_0821_release~7648 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=55fb7315afda554b947c5ec20ecff6094e6b2b9d;p=firefly-linux-kernel-4.4.55.git rk: ddr_freq: version 2.1 fix this bug: BUG: scheduling while atomic: ddrfreqd/65/0x00000002 [] (unwind_backtrace+0x0/0xf8) from [] (__schedule+0x7ec/0x8a8) [] (__schedule+0x7ec/0x8a8) from [] (__mutex_lock_slowpath+0x128/0x1bc) [] (__mutex_lock_slowpath+0x128/0x1bc) from [] (mutex_lock+0x6c/0x70) [] (mutex_lock+0x6c/0x70) from [] (ddr_scale_rate_for_dvfs+0x30/0x16c) [] (ddr_scale_rate_for_dvfs+0x30/0x16c) from [] (dvfs_target+0x12c/0x1a0) [] (dvfs_target+0x12c/0x1a0) from [] (dvfs_set_rate+0x48/0x68) [] (dvfs_set_rate+0x48/0x68) from [] (ddrfreq_mode+0x70/0xc4) [] (ddrfreq_mode+0x70/0xc4) from [] (ddrfreq_task+0x38/0x160) [] (ddrfreq_task+0x38/0x160) from [] (kthread+0x80/0x88) [] (kthread+0x80/0x88) from [] (kernel_thread_exit+0x0/0x8) --- diff --git a/arch/arm/plat-rk/ddr_freq.c b/arch/arm/plat-rk/ddr_freq.c index f46d8d412b62..8a2a3184b973 100644 --- a/arch/arm/plat-rk/ddr_freq.c +++ b/arch/arm/plat-rk/ddr_freq.c @@ -165,7 +165,8 @@ static void _ddr_change_freq(uint32_t nMHz) { u32 timeout = MAX_TIMEOUT; unsigned int cpu; - unsigned int this_cpu = get_cpu(); + unsigned int this_cpu = smp_processor_id(); + cpu_maps_update_begin(); set_other_cpus_pause(false); @@ -187,7 +188,6 @@ static void _ddr_change_freq(uint32_t nMHz) out: cpu_maps_update_done(); - put_cpu(); } #else static void _ddr_change_freq(uint32_t nMHz) @@ -416,7 +416,7 @@ static int ddrfreq_late_init(void) kthread_bind(ddr.task, 0); wake_up_process(ddr.task); - pr_info("verion 2.0\n"); + pr_info("verion 2.1\n"); dprintk(DEBUG_DDR, "normal %luMHz video %luMHz idle %luMHz suspend %luMHz\n", ddr.normal_rate / MHZ, ddr.video_rate / MHZ, ddr.idle_rate / MHZ, ddr.suspend_rate / MHZ);