From e9f3f9a985914d2d15c794a5fbaf3b13ea9dc3db Mon Sep 17 00:00:00 2001 From: Miguel Vadillo Date: Wed, 19 Oct 2011 14:29:45 -0500 Subject: omap: gpio: put_sync_suspend instead of put_sync in free put_sync might sleep and omap_gpio_free is calling it between spinlocks thus changing it to put_sync_suspend to avoid the following warning: [ 104.568847] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:735 [ 104.578460] in_atomic(): 1, irqs_disabled(): 128, pid: 297, name: kworker/0:3 [ 104.586090] Backtrace: [ 104.588775] [] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c) [ 104.597747] r6:60000013 r5:ffff9e48 r4:00000000 r3:60000093 [ 104.603759] [] (dump_stack+0x0/0x1c) from [] (__might_sleep+0x130/0x134) [ 104.612701] [] (__might_sleep+0x0/0x134) from [] (__pm_runtime_idle+0x94/0x98) [ 104.622192] r5:00000004 r4:c787ac08 [ 104.626007] [] (__pm_runtime_idle+0x0/0x98) from [] (omap_gpio_free+0xa0/0xb0) [ 104.635467] r7:00000013 r6:60000013 r5:c7877268 r4:c7877200 [ 104.641510] [] (omap_gpio_free+0x0/0xb0) from [] (gpio_free+0xa4/0x108) [ 104.650329] r7:000000f9 r6:c787727c r5:c07acfe0 r4:00000053 [ 104.656372] [] (gpio_free+0x0/0x108) from [] (_resource_free+0x170/0x274) [ 104.665405] [] (_resource_free+0x0/0x274) from [] (rprm_cb+0x56c/0x604) [ 104.674255] r7:00000066 r6:c7a1ac08 r5:c7a14cd0 r4:00200200 [ 104.680267] [] (rprm_cb+0x0/0x604) from [] (rpmsg_recv_done+0xbc/0x17c) [ 104.689117] [] (rpmsg_recv_done+0x0/0x17c) from [] (vring_interrupt+0x44/0x54) [ 104.698608] r8:00000004 r7:00000000 r6:00000002 r5:00000002 r4:c074f918 [ 104.705718] [] (vring_interrupt+0x0/0x54) from [] (omap_rpmsg_mbox_callback+0x6c/0) [ 104.715972] [] (omap_rpmsg_mbox_callback+0x0/0xb8) from [] (notifier_call_chain+0x) [ 104.726562] r5:00000000 r4:fffffffe [ 104.730346] [] (notifier_call_chain+0x0/0x8c) from [] (__blocking_notifier_call_ch) [ 104.741485] r8:c0749a88 r7:00000004 r6:00000002 r5:00000000 r4:c0749a68 [ 104.748413] r3:ffffffff [ 104.751220] [] (__blocking_notifier_call_chain+0x0/0x6c) from [] (blocking_notifie) [ 104.763183] r8:00000004 r7:00000000 r6:c63ab434 r5:c6fcbefc r4:c63ab420 [ 104.770294] [] (blocking_notifier_call_chain+0x0/0x28) from [] (mbox_rx_work+0x84/) [ 104.780639] [] (mbox_rx_work+0x0/0xe8) from [] (process_one_work+0x114/0x410) [ 104.790008] r8:c007fdd0 r7:00000000 r6:c1837500 r5:c18335c0 r4:c6f3b580 [ 104.797149] [] (process_one_work+0x0/0x410) from [] (worker_thread+0x1a8/0x490) [ 104.806732] [] (worker_thread+0x0/0x490) from [] (kthread+0x94/0x98) [ 104.815307] [] (kthread+0x0/0x98) from [] (do_exit+0x0/0x720) [ 104.823211] r7:00000013 r6:c009860c r5:c00b2174 r4:c7909e94 Change-Id: I051f13d82d6b776641ebd65ff16f9ce0f02fdf57 Signed-off-by: Miguel Vadillo --- drivers/gpio/gpio-omap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 03ee9c6..d91a5aa 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -593,9 +593,9 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) * disable the bank module. */ if (!bank->mod_usage) { - if (pm_runtime_put_sync(bank->dev) < 0) { + if (pm_runtime_put_sync_suspend(bank->dev)) { dev_err(bank->dev, "%s: GPIO bank %d " - "pm_runtime_put_sync failed\n", + "pm_runtime_put_sync_suspend failed\n", __func__, bank->id); } } -- cgit v1.1