diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-05-21 07:21:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:01 -0400 |
commit | 9b553d64d949da26b63759e4ae9af863676bad37 (patch) | |
tree | d97a55687f322742f6d8cdffed22e5bec7467d7c | |
parent | 03c29ef2e86669e356493153d80b5c4ed0fc2f84 (diff) |
gpio: rcar: Check for irq_set_irq_wake() failures
commit 501ef0f95a57e7c32138733c468394a52244c85b upstream.
If an interrupt controller doesn't support wake-up configuration,
irq_set_irq_wake() returns an error code. Then any subsequent call
trying to deconfigure wake-up will cause an imbalance, and a warning
will be printed:
WARNING: CPU: 1 PID: 1341 at kernel/irq/manage.c:540 irq_set_irq_wake+0x9c/0xf8()
Unbalanced IRQ 26 wake disable
To fix this, refrain from any further parent interrupt controller
(de)configuration if irq_set_irq_wake() failed.
Alternative fixes would be:
- calling "gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE)" from the
platform code,
- setting "gic_chip.flags = IRQCHIP_SKIP_SET_WAKE" in the GIC driver
code,
but these were withheld as the GIC hardware doesn't really support
wake-up interrupts.
Fixes: ab82fa7da4dce5c7 ("gpio: rcar: Prevent module clock disable when wake-up is enabled")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index fd3977465948..1e14a6c74ed1 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -177,8 +177,17 @@ static int gpio_rcar_irq_set_wake(struct irq_data *d, unsigned int on) | |||
177 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 177 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
178 | struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv, | 178 | struct gpio_rcar_priv *p = container_of(gc, struct gpio_rcar_priv, |
179 | gpio_chip); | 179 | gpio_chip); |
180 | 180 | int error; | |
181 | irq_set_irq_wake(p->irq_parent, on); | 181 | |
182 | if (p->irq_parent) { | ||
183 | error = irq_set_irq_wake(p->irq_parent, on); | ||
184 | if (error) { | ||
185 | dev_dbg(&p->pdev->dev, | ||
186 | "irq %u doesn't support irq_set_wake\n", | ||
187 | p->irq_parent); | ||
188 | p->irq_parent = 0; | ||
189 | } | ||
190 | } | ||
182 | 191 | ||
183 | if (!p->clk) | 192 | if (!p->clk) |
184 | return 0; | 193 | return 0; |