gpio: max732x: Fix irq-events handler
authorSemen Protsenko <semen.protsenko@globallogic.com>
Wed, 22 Apr 2015 13:20:41 +0000 (16:20 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 6 May 2015 13:08:54 +0000 (15:08 +0200)
MAX732X clears all pending interrupts on I2C read (when interrupts
register is being read). Driver doesn't need to send any ACKs when
interrupt was handled. So replace handle_edge_irq() with
handle_simple_irq().

Using handle_edge_irq() (w/o .irq_ack callback set) may lead to NULL
pointer dereference in some cases. E.g. this was observed on
hibernation process:

  Unable to handle kernel NULL pointer dereference at virtual address 0
  Backtrace:
  (handle_edge_irq) from (resend_irqs)
  (resend_irqs) from (tasklet_action)
  (tasklet_action) from (__do_softirq)
  (__do_softirq) from (run_ksoftirqd)
  (run_ksoftirqd) from (smpboot_thread_fn)
  (smpboot_thread_fn) from (kthread)
  (kthread) from (ret_from_fork)

Signed-off-by: Semen Protsenko <semen.protsenko@globallogic.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-max732x.c

index 857907aecec35f48245f5972bb814645b8f7c9a2..aed4ca9338bca1e15d8a3052438d68635661e01e 100644 (file)
@@ -528,7 +528,7 @@ static int max732x_irq_setup(struct max732x_chip *chip,
                ret =  gpiochip_irqchip_add(&chip->gpio_chip,
                                            &max732x_irq_chip,
                                            irq_base,
-                                           handle_edge_irq,
+                                           handle_simple_irq,
                                            IRQ_TYPE_NONE);
                if (ret) {
                        dev_err(&client->dev,