From a7da251a404d8528732fd9447ba3af69d89dafd7 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 25 Jul 2011 17:54:55 -0500 Subject: GPIO: OMAP: use put_sync_suspend instead of put_sync in irq handler. GPIO uses put_sync in irq handler at the moment, this causes the following warning with a check patch such as https://patchwork.kernel.org/patch/1001572/: [ 4.036560] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:735 [ 4.046508] in_atomic(): 1, irqs_disabled(): 128, pid: 1, name: swapper [ 4.053863] Backtrace: [ 4.056762] [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) [ 4.066131] r7:00000000 r6:ffff6c05 r5:c06ce080 r4:de43a000 [ 4.072784] [] (dump_stack+0x0/0x1c) from [] (__might_sleep+0x108/0x128) [ 4.082183] [] (__might_sleep+0x0/0x128) from [] (__pm_runtime_idle+0x90/0x98) [ 4.092132] r6:c06d0720 r5:00000004 r4:de486808 [ 4.097534] [] (__pm_runtime_idle+0x0/0x98) from [] (gpio_irq_handler+0x1e8/0x270) [ 4.107849] r7:00000000 r6:c06d0720 r5:c06e7220 r4:de474000 [ 4.114501] [] (gpio_irq_handler+0x0/0x270) from [] (generic_handle_irq+0x3c/0x48) [ 4.124847] [] (generic_handle_irq+0x0/0x48) from [] (asm_do_IRQ+0x54/0xb4) [ 4.134521] [] (asm_do_IRQ+0x0/0xb4) from [] (__irq_svc+0x48/0xe0) Instead, use put_sync_suspend and since the gpio devices are already marked as used in irq enabled case, the change removes a potential invalid condition. Acked-by: Nishanth Menon Signed-off-by: Colin Cross --- drivers/gpio/gpio-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 82abef0..5aa0e19 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -677,7 +677,7 @@ exit: if (!unmasked) chained_irq_exit(chip, desc); - pm_runtime_put_sync(bank->dev); + pm_runtime_put_sync_suspend(bank->dev); } static void gpio_irq_shutdown(struct irq_data *d) -- cgit v1.1