public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Tony Lindgren <tony@atomide.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>, Keerthy <j-keerthy@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	linux-gpio@vger.kernel.org,
	Russell King <rmk+kernel@armlinux.org.uk>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] gpio: gpio-omap: fix level interrupt idling
Date: Wed, 6 Mar 2019 17:26:01 +0200	[thread overview]
Message-ID: <67b445e2-bfbe-f3be-15e2-b47bbb6cf4e7@ti.com> (raw)
In-Reply-To: <20190301190252.20615-1-tony@atomide.com>



On 01.03.19 21:02, Tony Lindgren wrote:
> From: Russell King <rmk+kernel@armlinux.org.uk>
> 
> Tony notes that the GPIO module does not idle when level interrupts are
> in use, as the wakeup appears to get stuck.
> 
> After extensive investigation, it appears that the wakeup will only be
> cleared if the interrupt status register is cleared while the interrupt
> is enabled. However, we are currently clearing it with the interrupt
> disabled for level-based interrupts.
> 
> It is acknowledged that this observed behaviour conflicts with a
> statement in the TRM:
> 
> CAUTION
>   After servicing the interrupt, the status bit in the interrupt status
>   register (GPIOi.GPIO_IRQSTATUS_0 or GPIOi.GPIO_IRQSTATUS_1) must be
>   reset and the interrupt line released (by setting the corresponding
>   bit of the interrupt status register to 1) before enabling an
>   interrupt for the GPIO channel in the interrupt-enable register
>   (GPIOi.GPIO_IRQSTATUS_SET_0 or GPIOi.GPIO_IRQSTATUS_SET_1) to prevent
>   the occurrence of unexpected interrupts when enabling an interrupt
>   for the GPIO channel.
> 
> However, this does not appear to be a practical problem.
> 
> Further, as reported by Grygorii Strashko <grygorii.strashko@ti.com>,
> the TI Android kernel tree has an earlier similar patch as "GPIO: OMAP:
> Fix the sequence to clear the IRQ status" saying:
> 
>  if the status is cleared after disabling the IRQ then sWAKEUP will not
>  be cleared and gates the module transition
> 
> When we unmask the level interrupt after the interrupt has been handled,
> enable the interrupt and only then clear the interrupt. If the interrupt
> is still pending, the hardware will re-assert the interrupt status.
> 
> Should the caution note in the TRM prove to be a problem, we could
> use a clear-enable-clear sequence instead.
> 
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> [tony@atomide.com: updated comments based on an earlier TI patch]
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> 
> Obviously no rush to get this into v5.0-rc cycle, but this should be
> tagged with Cc stable after people have reviewed and tested this.
> 
> ---
>  drivers/gpio/gpio-omap.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 

Thank you.
Acked-by: Grygorii Strashko <grygorii.strashko@ti.com>

-- 
Best regards,
grygorii

  reply	other threads:[~2019-03-06 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 19:02 [PATCH] gpio: gpio-omap: fix level interrupt idling Tony Lindgren
2019-03-06 15:26 ` Grygorii Strashko [this message]
2019-03-08 12:20 ` 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=67b445e2-bfbe-f3be-15e2-b47bbb6cf4e7@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=bgolaszewski@baylibre.com \
    --cc=j-keerthy@ti.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox