linux/arch/arm
Mike Turquette 2b25d9f64b ARM: 7535/1: Reprogram smp_twd based on new common clk framework notifiers
Running cpufreq driver on imx6q, the following warning is seen.

$ BUG: sleeping function called from invalid context at kernel/mutex.c:269

<snip>

stack backtrace:
Backtrace:
[<80011d64>] (dump_backtrace+0x0/0x10c) from [<803fc164>] (dump_stack+0x18/0x1c)
 r6:bf8142e0 r5:bf814000 r4:806ac794 r3:bf814000
[<803fc14c>] (dump_stack+0x0/0x1c) from [<803fd444>] (print_usage_bug+0x250/0x2b
8)
[<803fd1f4>] (print_usage_bug+0x0/0x2b8) from [<80060f90>] (mark_lock+0x56c/0x67
0)
[<80060a24>] (mark_lock+0x0/0x670) from [<80061a20>] (__lock_acquire+0x98c/0x19b
4)
[<80061094>] (__lock_acquire+0x0/0x19b4) from [<80062f14>] (lock_acquire+0x68/0x
7c)
[<80062eac>] (lock_acquire+0x0/0x7c) from [<80400f28>] (mutex_lock_nested+0x78/0
x344)
 r7:00000000 r6:bf872000 r5:805cc858 r4:805c2a04
[<80400eb0>] (mutex_lock_nested+0x0/0x344) from [<803089ac>] (clk_get_rate+0x1c/
0x58)
[<80308990>] (clk_get_rate+0x0/0x58) from [<80013c48>] (twd_update_frequency+0x1
8/0x50)
 r5:bf253d04 r4:805cadf4
[<80013c30>] (twd_update_frequency+0x0/0x50) from [<80068e20>] (generic_smp_call
_function_single_interrupt+0xd4/0x13c)
 r4:bf873ee0 r3:80013c30
[<80068d4c>] (generic_smp_call_function_single_interrupt+0x0/0x13c) from [<80013
34c>] (handle_IPI+0xc0/0x194)
 r8:00000001 r7:00000000 r6:80574e48 r5:bf872000 r4:80593958
[<8001328c>] (handle_IPI+0x0/0x194) from [<800084e8>] (gic_handle_irq+0x58/0x60)
 r8:00000000 r7:bf873f8c r6:bf873f58 r5:80593070 r4:f4000100
r3:00000005
[<80008490>] (gic_handle_irq+0x0/0x60) from [<8000e124>] (__irq_svc+0x44/0x60)
Exception stack(0xbf873f58 to 0xbf873fa0)
3f40:                                                       00000001 00000001
3f60: 00000000 bf814000 bf872000 805cab48 80405aa4 80597648 00000000 412fc09a
3f80: bf872000 bf873fac bf873f70 bf873fa0 80063844 8000f1f8 20000013 ffffffff
 r6:ffffffff r5:20000013 r4:8000f1f8 r3:bf814000
[<8000f1b8>] (default_idle+0x0/0x4c) from [<8000f428>] (cpu_idle+0x98/0x114)
[<8000f390>] (cpu_idle+0x0/0x114) from [<803f9834>] (secondary_start_kernel+0x11
c/0x140)
[<803f9718>] (secondary_start_kernel+0x0/0x140) from [<103f9234>] (0x103f9234)
 r6:10c03c7d r5:0000001f r4:4f86806a r3:803f921c

It looks that the warning is caused by that twd_update_frequency() gets
called from an atomic context while it calls clk_get_rate() where a
mutex gets held.

To fix the warning, let's convert common clk users over to clk notifiers
in place of CPUfreq notifiers.  This works out nicely for Cortex-A9
MPcore designs that scale all CPUs at the same frequency.

Platforms that have not been converted to the common clk framework and
support CPUfreq will rely on the old mechanism.  Once these platforms
are converted over fully then we can remove the CPUfreq-specific bits
for good.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-09-19 22:04:43 +01:00
..
boot ARM: 7532/1: decompressor: reset SCTLR.TRE for VMSA ARMv7 cores 2012-09-16 00:16:16 +01:00
common ARM: dma-mapping: add support for dma_get_sgtable() 2012-07-30 12:25:47 +02:00
configs Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes 2012-09-04 21:41:35 -07:00
include/asm Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm 2012-09-13 09:05:22 +08:00
kernel ARM: 7535/1: Reprogram smp_twd based on new common clk framework notifiers 2012-09-19 22:04:43 +01:00
lib ARM: 7529/1: delay: set loops_per_jiffy when moving to timer-based loop 2012-09-09 17:28:48 +01:00
mach-at91 ARM: at91/clock: fix PLLA overclock warning 2012-08-23 15:00:09 +02:00
mach-bcmring
mach-clps711x ARM: clps711x: Remove the setting of the time 2012-07-17 22:24:30 +02:00
mach-cns3xxx
mach-davinci ARM: davinci: remove broken ntosd2_init_i2c 2012-08-10 13:14:36 +02:00
mach-dove ARM: Orion: Set eth packet size csum offload limit 2012-08-15 13:58:09 +00:00
mach-ebsa110
mach-ep93xx arm-soc: soc-specific updates 2012-07-23 16:08:40 -07:00
mach-exynos Merge branch 'v3.6-samsung-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes 2012-08-23 17:03:49 +02:00
mach-footbridge
mach-gemini ARM: gemini: fix the gemini build 2012-09-04 22:17:34 -07:00
mach-h720x
mach-highbank clk: add highbank clock support 2012-07-11 17:58:47 -07:00
mach-imx ARM: clk-imx35: Fix SSI clock registration 2012-09-11 11:52:28 +02:00
mach-integrator ARM: integrator: include <linux/export.h> 2012-08-09 15:16:44 +02:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx - More robust parsing especially of xattr data in JFFS2 2012-06-01 16:55:42 -07:00
mach-kirkwood Merge branch 'fixes-for-3.6' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-09-08 16:22:43 -07:00
mach-ks8695
mach-l7200/include/mach
mach-lpc32xx ARM: LPC32xx: Add PWM clock 2012-07-20 14:01:51 +02:00
mach-mmp ARM: mmp: fix potential NULL dereference 2012-08-10 22:32:24 +08:00
mach-msm ARM: MSM: use SGI0 to wake secondary CPUs 2012-07-09 17:39:36 +01:00
mach-mv78xx0 Merge branch 'fixes-for-v3.6' of git://git.infradead.org/users/jcooper/linux into fixes 2012-08-15 18:18:29 +02:00
mach-mvebu arm: mvebu: generate DTBs for supported SoCs 2012-07-17 22:38:06 +02:00
mach-mxs ARM: mxs: always build ocotp 2012-08-04 22:52:23 +08:00
mach-netx arch/arm/mach-netx/fb.c: reuse dummy clk routines for CONFIG_HAVE_CLK=n 2012-07-30 17:25:13 -07:00
mach-nomadik ARM: nomadik: bump all IRQ numbers by one 2012-06-11 12:40:14 +02:00
mach-omap1 Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm 2012-08-01 16:41:07 -07:00
mach-omap2 Some hwmod, clockdomain, am335x fixes against v3.6-rc4. 2012-09-05 10:09:31 -07:00
mach-orion5x ARM: Orion: Set eth packet size csum offload limit 2012-08-15 13:58:09 +00:00
mach-picoxcell clocksource: dw_apb_timer: Add common DTS glue for dw_apb_timer 2012-07-12 17:26:09 +02:00
mach-pnx4008
mach-prima2 ARM: PRIMA2: delete redundant codes to restore LATCHED when timer resumes 2012-08-02 10:05:27 -07:00
mach-pxa Input: eeti_ts: pass gpio value instead of IRQ 2012-08-09 15:16:41 +02:00
mach-realview
mach-rpc ARM: fiq: change FIQ_START to a variable 2012-07-01 21:59:19 +08:00
mach-s3c24xx Merge branch 'v3.6-samsung-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes 2012-08-23 17:03:49 +02:00
mach-s3c64xx ARM: arm-soc soc updates, take 2 2012-07-30 09:45:53 -07:00
mach-s3c2410
mach-s3c2412
mach-s3c2440
mach-s5p64x0 arm-soc: device tree description updates 2012-07-23 16:17:43 -07:00
mach-s5pc100 arm-soc: device tree description updates 2012-07-23 16:17:43 -07:00
mach-s5pv210 arm-soc: board specific updates 2012-07-23 17:34:48 -07:00
mach-sa1100 ARM: sa1100: include linux/io.h in hackkit leds code 2012-08-09 15:16:42 +02:00
mach-shark
mach-shmobile Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes 2012-09-04 21:41:35 -07:00
mach-socfpga ARM: socfpga: initial support for Altera's SOCFPGA platform 2012-07-19 10:39:00 +02:00
mach-spear3xx Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm 2012-08-01 16:41:07 -07:00
mach-spear6xx Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm 2012-08-01 16:41:07 -07:00
mach-spear13xx Viresh has moved 2012-06-20 14:39:36 -07:00
mach-tegra ARM: tegra: more regulator fixes for Harmony 2012-08-09 15:16:40 +02:00
mach-u300 ARM: u300: convert to common clock 2012-07-11 15:36:45 -07:00
mach-ux500 Merge branch 'randconfig/mach' into fixes 2012-08-23 17:30:54 +02:00
mach-versatile ARM: fix mach-versatile/pci.c warning 2012-07-04 17:04:57 +01:00
mach-vexpress ARM: vexpress: Config option for early printk console 2012-07-13 11:48:29 +01:00
mach-vt8500 Merge branch 'for-3.6' of git://gitorious.org/linux-pwm/linux-pwm 2012-07-30 09:22:37 -07:00
mach-w90x900
mach-zynq
mm Merge branch 'fixes-for-3.6' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-09-14 17:53:11 -07:00
net ARM: 7421/1: bpf_jit: BPF_S_ANC_ALU_XOR_X support 2012-06-14 15:12:13 +01:00
nwfpe
oprofile ARM: 7448/1: perf: remove arm_perf_pmu_ids global enumeration 2012-07-09 17:41:10 +01:00
plat-iop
plat-mxc ARM: SoC fixes 2012-08-02 11:48:20 -07:00
plat-nomadik i2c-nomadik: move header to <linux/platform_data/i2c-nomadik.h> 2012-07-09 11:40:40 +02:00
plat-omap Merge branch 'fixes-wakeupgen' into fixes 2012-09-05 10:06:08 -07:00
plat-orion ARM: Orion: Set eth packet size csum offload limit 2012-08-15 13:58:09 +00:00
plat-pxa Merge branch 'for-3.6' of git://gitorious.org/linux-pwm/linux-pwm 2012-07-30 09:22:37 -07:00
plat-s3c24xx ARM: S3C24XX: Fix s3c2410_dma_enqueue parameters 2012-08-08 09:04:51 +09:00
plat-samsung Merge branch 'v3.6-samsung-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes 2012-08-23 17:03:49 +02:00
plat-spear Merge branch 'dmaengine' of git://git.linaro.org/people/rmk/linux-arm 2012-08-01 16:41:07 -07:00
plat-versatile Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-07-27 15:14:26 -07:00
tools
vfp ARM: 7483/1: vfp: only advertise VFPv4 in hwcaps if CONFIG_VFPv3 is enabled 2012-08-11 09:15:57 +01:00
Kconfig Merge branch 'fixes-for-3.6' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-09-08 16:22:43 -07:00
Kconfig-nommu
Kconfig.debug ARM: 7521/1: Fix semihosting Kconfig text 2012-09-07 20:40:44 +01:00
Makefile ARM: 7513/1: Make sure dtc is built before running it 2012-09-07 20:36:44 +01:00