All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Valentine Barshak <valentine.barshak@cogentembedded.com>
Cc: "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH V2] gpio: rcar: Fix level interrupt handling
Date: Thu, 12 Dec 2013 19:54:25 +0000	[thread overview]
Message-ID: <CACRpkdbeT8fp4i-ahpzZN2MnC7uYAcuLH7SOgJnpL54XBaoTqw@mail.gmail.com> (raw)
In-Reply-To: <1385748249-27170-1-git-send-email-valentine.barshak@cogentembedded.com>

On Fri, Nov 29, 2013 at 7:04 PM, Valentine Barshak
<valentine.barshak@cogentembedded.com> wrote:

> According to the manual, if a port is set for level detection using
> the corresponding bit in the edge/level select register and an external
> level interrupt signal is asserted, the corresponding bit in INTDT
> does not use the FF to hold the input.
> Thus, writing 1 to the corresponding bits in INTCLR cannot clear the
> corresponding bits in the INTDT register. Instead, when an external
> input signal is stopped, the corresponding bit in INTDT is cleared
> automatically.
>
> Since the INTDT bit cannot be cleared for the level interrupts until
> the interrupt signal is stopped, we end up with the infinite loop
> when using deferred (threaded) IRQ handling.
>
> Since a deferred interrupt is disabled by the low-level handler and
> re-enabled only when the deferred handler is completed, Fix the issue
> by dropping disabled interrupts from the pending mask as suggested by
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Changes in V2:
> * Drop disabled interrupts from pending mask altogether instead of
>   dropping level interrupts one by one once they get handled.
>
> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>

This v2 version applied to fixes with Laurent's and Magnus' ACKs,
tell me if it also need to go into -stable.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Valentine Barshak <valentine.barshak@cogentembedded.com>
Cc: "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH V2] gpio: rcar: Fix level interrupt handling
Date: Thu, 12 Dec 2013 20:54:25 +0100	[thread overview]
Message-ID: <CACRpkdbeT8fp4i-ahpzZN2MnC7uYAcuLH7SOgJnpL54XBaoTqw@mail.gmail.com> (raw)
In-Reply-To: <1385748249-27170-1-git-send-email-valentine.barshak@cogentembedded.com>

On Fri, Nov 29, 2013 at 7:04 PM, Valentine Barshak
<valentine.barshak@cogentembedded.com> wrote:

> According to the manual, if a port is set for level detection using
> the corresponding bit in the edge/level select register and an external
> level interrupt signal is asserted, the corresponding bit in INTDT
> does not use the FF to hold the input.
> Thus, writing 1 to the corresponding bits in INTCLR cannot clear the
> corresponding bits in the INTDT register. Instead, when an external
> input signal is stopped, the corresponding bit in INTDT is cleared
> automatically.
>
> Since the INTDT bit cannot be cleared for the level interrupts until
> the interrupt signal is stopped, we end up with the infinite loop
> when using deferred (threaded) IRQ handling.
>
> Since a deferred interrupt is disabled by the low-level handler and
> re-enabled only when the deferred handler is completed, Fix the issue
> by dropping disabled interrupts from the pending mask as suggested by
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Changes in V2:
> * Drop disabled interrupts from pending mask altogether instead of
>   dropping level interrupts one by one once they get handled.
>
> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>

This v2 version applied to fixes with Laurent's and Magnus' ACKs,
tell me if it also need to go into -stable.

Yours,
Linus Walleij

  parent reply	other threads:[~2013-12-12 19:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 18:04 [PATCH V2] gpio: rcar: Fix level interrupt handling Valentine Barshak
2013-11-29 18:04 ` Valentine Barshak
2013-12-09 19:25 ` Valentine
2013-12-09 19:25   ` Valentine
2013-12-10  1:39   ` Laurent Pinchart
2013-12-10  1:39     ` Laurent Pinchart
2013-12-11  9:44   ` Magnus Damm
2013-12-11  9:44     ` Magnus Damm
2013-12-12 19:54 ` Linus Walleij [this message]
2013-12-12 19:54   ` Linus Walleij
2013-12-13 12:31   ` Magnus Damm
2013-12-13 12:31     ` Magnus Damm

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=CACRpkdbeT8fp4i-ahpzZN2MnC7uYAcuLH7SOgJnpL54XBaoTqw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=valentine.barshak@cogentembedded.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.