From d7be800f7ae9398055509b3a83d0ea3118e9277f Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Mon, 23 May 2016 15:01:08 +0100 Subject: [PATCH] greybus: Fix unbalanced irq_enable() backtrace Tip-of-tree is exhibiting a backtrace when loading-up the set of greybus kernel modules due to calling arche_platform_wd_irq_en() directly after a call to devm_request_threaded_irq(). At the point we call arch_platform_wd_irq_en() the relevant IRQ will already be enabled. What we want to do in this situation is configure the GPIO line as an input. This patch fixes the backtrace by supplanting arche_platform_wd_irq_en() with gpio_direction_input(arche_pdata->wake_detect_gpio) in arche_platform_probe(). WARNING: at msm-ara-3.10/kernel/irq/manage.c:457 __enable_irq+0x74/0xc0() Unbalanced enable for IRQ 687 Modules linked in: gb_arche(O+) gb_camera(O) gb_es2(O) gb_vibrator(O) gb_raw(O) gb_power_supply(O) gb_loopback(O) gb_light(O) gb_hid(O) greybus(O) CPU: 0 PID: 415 Comm: insmod Tainted: G W O 3.10.78-g2a4dec8 #65 Call trace: [] dump_backtrace+0x0/0x248 [] show_stack+0x10/0x1c [] dump_stack+0x1c/0x28 [] warn_slowpath_common+0x74/0x9c [] warn_slowpath_fmt+0x4c/0x58 [] __enable_irq+0x70/0xc0 [] enable_irq+0x68/0x7c [] arche_platform_probe+0x3b4/0x4f4 [gb_arche] [] platform_drv_probe+0x14/0x20 [] driver_probe_device+0x160/0x374 [] __driver_attach+0x60/0x90 [] bus_for_each_dev+0x74/0x94 [] driver_attach+0x1c/0x28 [] bus_add_driver+0x124/0x248 [] driver_register+0x94/0x110 [] platform_driver_register+0x58/0x64 [] $x+0x20/0x58 [gb_arche] [] do_one_initcall+0xb0/0x14c [] load_module+0x19d0/0x1b18 [] SyS_init_module+0x118/0x130 Signed-off-by: Bryan O'Donoghue Reviewed-by: Vaibhav Hiremath Tested-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/arche-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index bc450770..4af3498 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -603,7 +603,7 @@ static int arche_platform_probe(struct platform_device *pdev) return ret; } - arche_platform_wd_irq_en(arche_pdata); + gpio_direction_input(arche_pdata->wake_detect_gpio); ret = device_create_file(dev, &dev_attr_state); if (ret) { -- 2.7.4