MAX732X doesn't support edge type interrupt. So replace
handle_edge_irq() with handle_level_irq(), which uses
irq_mask/irq_unmask callbacks instead of irq_ack().
This wrong handler 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 <[email protected]>
---
drivers/gpio/gpio-max732x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 1885e5c..edade14 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -530,7 +530,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_level_irq,
IRQ_TYPE_NONE);
if (ret) {
dev_err(&client->dev,
--
1.7.9.5
On 04/21/2015 08:28 PM, Semen Protsenko wrote:
> MAX732X doesn't support edge type interrupt. So replace
> handle_edge_irq() with handle_level_irq(), which uses
> irq_mask/irq_unmask callbacks instead of irq_ack().
>
> This wrong handler 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 <[email protected]>
> ---
> drivers/gpio/gpio-max732x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
> index 1885e5c..edade14 100644
> --- a/drivers/gpio/gpio-max732x.c
> +++ b/drivers/gpio/gpio-max732x.c
> @@ -530,7 +530,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_level_irq,
Wouldn't handle_simple_irq() be a better choice here?
> IRQ_TYPE_NONE);
> if (ret) {
> dev_err(&client->dev,
>
--
regards,
-grygorii
On Wed, Apr 22, 2015 at 10:42 AM, [email protected]
<[email protected]> wrote:
> Wouldn't handle_simple_irq() be a better choice here?
You are right, thanks! I sent the new version of patch.