Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934219AbbDVHmo (ORCPT ); Wed, 22 Apr 2015 03:42:44 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:33524 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932124AbbDVHmm (ORCPT ); Wed, 22 Apr 2015 03:42:42 -0400 From: "Grygorii.Strashko@linaro.org" X-Google-Original-From: "Grygorii.Strashko@linaro.org" Message-ID: <553750ED.70209@linaro.org> Date: Wed, 22 Apr 2015 10:42:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Semen Protsenko , Linus Walleij , Alexandre Courbot CC: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] gpio: max732x: Fix irq-events handler References: <1429637318-11089-1-git-send-email-semen.protsenko@globallogic.com> In-Reply-To: <1429637318-11089-1-git-send-email-semen.protsenko@globallogic.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 49 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/