All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Semen Protsenko <semen.protsenko@globallogic.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Grygorii Strashko <grygorii.strashko@globallogic.com>
Subject: Re: [PATCH v2] gpio: max732x: Fix irq-events handler
Date: Fri, 24 Apr 2015 13:29:34 +0300	[thread overview]
Message-ID: <553A1B0E.9040003@ti.com> (raw)
In-Reply-To: <1429708841-31189-1-git-send-email-semen.protsenko@globallogic.com>

On 04/22/2015 04:20 PM, Semen Protsenko wrote:
> 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>

> ---
>   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..86dc6b3 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_simple_irq,
>   					    IRQ_TYPE_NONE);
>   		if (ret) {
>   			dev_err(&client->dev,
>


WARNING: multiple messages have this Message-ID (diff)
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Semen Protsenko <semen.protsenko@globallogic.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
Cc: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Grygorii Strashko <grygorii.strashko@globallogic.com>
Subject: Re: [PATCH v2] gpio: max732x: Fix irq-events handler
Date: Fri, 24 Apr 2015 13:29:34 +0300	[thread overview]
Message-ID: <553A1B0E.9040003@ti.com> (raw)
In-Reply-To: <1429708841-31189-1-git-send-email-semen.protsenko@globallogic.com>

On 04/22/2015 04:20 PM, Semen Protsenko wrote:
> 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>

> ---
>   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..86dc6b3 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_simple_irq,
>   					    IRQ_TYPE_NONE);
>   		if (ret) {
>   			dev_err(&client->dev,
>


  reply	other threads:[~2015-04-24 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 13:20 [PATCH v2] gpio: max732x: Fix irq-events handler Semen Protsenko
2015-04-24 10:29 ` Grygorii Strashko [this message]
2015-04-24 10:29   ` Grygorii Strashko
2015-05-06 13:09 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553A1B0E.9040003@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=gnurou@gmail.com \
    --cc=grygorii.strashko@globallogic.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=semen.protsenko@globallogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.