diff options
author | Axel Haslam <axelhaslam@ti.com> | 2011-07-25 20:22:39 -0500 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-07-29 14:07:35 -0500 |
commit | c51e07cb3bc821d4c01ab13e779d0a8b1451525b (patch) | |
tree | 1c89bfe630575dcd62641c03e3566a179105489e | |
parent | cf33fbef6975a0edeff04ed1d151796807954511 (diff) | |
download | kernel_samsung_tuna-c51e07cb3bc821d4c01ab13e779d0a8b1451525b.zip kernel_samsung_tuna-c51e07cb3bc821d4c01ab13e779d0a8b1451525b.tar.gz kernel_samsung_tuna-c51e07cb3bc821d4c01ab13e779d0a8b1451525b.tar.bz2 |
OMAP: timer: use put_sync_suspend instead of put_sync
As Documented in runtime documentation, drivers can call put_sync
in contexts where sleep is allowed, in contexts where sleep is not
possible, the drivers need to mark these as to be made interrupt
safe and also use put_sync_suspend instead of put_sync as the idle
callbacks will be called with interrupt enabled.
Dmtimers' disable function can be called in irq context depending
on the usage, for example in a PWM vibrator's interrupt handler.
hence, we should be using the put_sync_suspend here instead of
put_sync.
With a verification patch such as https://patchwork.kernel.org/patch/1001572/,
we see the following. This patch fixes it.
[ 26.462860] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:735
[ 26.472534] in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper
[ 26.479705] Backtrace:
[ 26.479766] [<c00520f0>] (dump_backtrace+0x0/0x110) from [<c059c1bc>] (dump_stack+0x18/0x1c)
[ 26.479766] r6:00000000 r5:ffff773c r4:00000000 r3:20000193
[ 26.479797] [<c059c1a4>] (dump_stack+0x0/0x1c) from [<c007e370>] (__might_sleep+0x130/0x134)
[ 26.479827] [<c007e240>] (__might_sleep+0x0/0x134) from [<c02b22f4>] (__pm_runtime_idle+0x94/0x98)
[ 26.479858] r5:00000004 r4:de4ed208
[ 26.479888] [<c02b2260>] (__pm_runtime_idle+0x0/0x98) from [<c00791e4>] (omap_dm_timer_disable+0x20/0x30)
[ 26.479888] r7:00000000 r6:00000000 r5:00000038 r4:de6a3200
[ 26.479919] [<c00791c4>] (omap_dm_timer_disable+0x0/0x30) from [<c007989c>] (omap_dm_timer_stop+0x638/0x8fc)
[ 26.479919] r4:de6a3200 r3:00000001
[ 26.479949] [<c0079264>] (omap_dm_timer_stop+0x0/0x8fc) from [<c006ef84>] (vibrator_off+0x28/0x48)
[ 26.479949] [<c006ef5c>] (vibrator_off+0x0/0x48) from [<c006f070>] (vibrator_timer_func+0x10/0x18)
[ 26.479949] r4:c078c848 r3:00000000
[ 26.479980] [<c006f060>] (vibrator_timer_func+0x0/0x18) from [<c00b0ea0>] (__run_hrtimer+0x4c/0xe8)
[ 26.480010] [<c00b0e54>] (__run_hrtimer+0x0/0xe8) from [<c00b11f0>] (hrtimer_interrupt+0x120/0x2ac)
[ 26.480010] r7:00000000 r6:c0c4f740 r5:c0c4f740 r4:de457ec8
[ 26.480041] [<c00b10d0>] (hrtimer_interrupt+0x0/0x2ac) from [<c0053410>] (ipi_timer+0x40/0x48)
[ 26.480072] [<c00533d0>] (ipi_timer+0x0/0x48) from [<c00473e8>] (do_local_timer+0x68/0x84)
[ 26.480072] r5:c0045e58 r4:c0746590
[ 26.480102] [<c0047380>] (do_local_timer+0x0/0x84) from [<c004d948>] (__irq_svc+0x48/0xe0)
[ 26.480102] Exception stack(0xde457f38 to 0xde457f80)
[ 26.480102] 7f20: de456000 de456000
[ 26.480133] 7f40: de457f80 00000000 00000000 c078c104 c05a393c c074eba4 8000406a 412fc09a
[ 26.480133] 7f60: 00000000 de457f8c de457f90 de457f80 c004f004 c004f008 60000013 ffffffff
[ 26.480163] r7:00000002 r6:0000001d r5:fa240100 r4:ffffffff
[ 26.480163] [<c004efdc>] (default_idle+0x0/0x30) from [<c03b6d74>] (cpuidle_idle_call+0x11c/0x128)
[ 26.480194] [<c03b6c58>] (cpuidle_idle_call+0x0/0x128) from [<c004f760>] (cpu_idle+0xd0/0x104)
[ 26.480194] r9:412fc09a r8:8000406a r6:c05a393c r5:c078c104 r4:de456000
[ 26.480224] r3:00000001
[ 26.480224] [<c004f690>] (cpu_idle+0x0/0x104) from [<c05993e4>] (secondary_start_kernel+0x1ac/0x1b0)
[ 26.480224] r7:c074eba4 r6:600001d3 r5:00000001 r4:00000002
[ 26.480255] [<c0599238>] (secondary_start_kernel+0x0/0x1b0) from [<00000000>] ( (null))
[ 26.480255] r6:c05a393c r5:c078c104 r4:00000001 r3:de457fc0
[ 26.519897] request_suspend_state: wakeup (3->0) at 26526489259 (2000-01-01 00:00:17.151000976 UTC)
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 997e1a0..8fe7d77 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -414,7 +414,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable); void omap_dm_timer_disable(struct omap_dm_timer *timer) { - pm_runtime_put_sync(&timer->pdev->dev); + pm_runtime_put_sync_suspend(&timer->pdev->dev); timer->enabled = 0; } EXPORT_SYMBOL_GPL(omap_dm_timer_disable); |