From: ccross@android.com (Colin Cross)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: omap4: gpio: fix setting IRQWAKEN bits
Date: Sat, 4 Jun 2011 19:37:54 -0700 [thread overview]
Message-ID: <BANLkTingmUNvZO_szivRkmn7LRO4L5A+5Q@mail.gmail.com> (raw)
In-Reply-To: <1307214239-16316-1-git-send-email-ccross@android.com>
On Sat, Jun 4, 2011 at 12:03 PM, Colin Cross <ccross@android.com> wrote:
> Setting the IRQWAKEN bit was overwriting previous IRQWAKEN bits,
> causing only the last bit set to take effect, resulting in lost
> wakeups when the GPIO controller is in idle.
>
> Replace direct writes to IRQWAKEN with writes to SETWKUENA and
> CLEARWKUEN.
>
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
> ?arch/arm/plat-omap/gpio.c | ? 14 +++++---------
> ?1 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index c985652..23ac7b6 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -539,7 +539,6 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
> ?{
> ? ? ? ?void __iomem *base = bank->base;
> ? ? ? ?u32 gpio_bit = 1 << gpio;
> - ? ? ? u32 val;
>
> ? ? ? ?if (cpu_is_omap44xx()) {
> ? ? ? ? ? ? ? ?MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit,
> @@ -563,14 +562,11 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
> ? ? ? ?if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
> ? ? ? ? ? ? ? ?if (cpu_is_omap44xx()) {
> ? ? ? ? ? ? ? ? ? ? ? ?if (trigger != 0)
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __raw_writel(1 << gpio, bank->base+
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP4_GPIO_IRQWAKEN0);
> - ? ? ? ? ? ? ? ? ? ? ? else {
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = __raw_readl(bank->base +
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OMAP4_GPIO_IRQWAKEN0);
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __raw_writel(val & (~(1 << gpio)), bank->base +
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMAP4_GPIO_IRQWAKEN0);
> - ? ? ? ? ? ? ? ? ? ? ? }
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __raw_writel(gpio_bit,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bank->base + OMAP4_GPIO_SETWKUENA);
> + ? ? ? ? ? ? ? ? ? ? ? else
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __raw_writel(gpio_bit,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bank->base + OMAP4_GPIO_CLEARWKUENA);
Todd pointed out that the OMAP4 TRM says not to use SETWKUENA and
CLEARWKUENA. I'll send another patch that applies to v3.0-rc1 that
uses MOD_REG_BIT on IRQWAKEN_0, and another patch that adds the
necessary locking around the read-modify-writes in
_set_gpio_triggering.
> ? ? ? ? ? ? ? ?} else {
> ? ? ? ? ? ? ? ? ? ? ? ?/*
> ? ? ? ? ? ? ? ? ? ? ? ? * GPIO wakeup request can only be generated on edge
> --
> 1.7.4.1
>
>
next prev parent reply other threads:[~2011-06-05 2:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-04 19:03 [PATCH] ARM: omap4: gpio: fix setting IRQWAKEN bits Colin Cross
2011-06-05 2:37 ` Colin Cross [this message]
2011-06-06 22:32 ` Kevin Hilman
2011-06-06 23:05 ` Todd Poynor
2011-06-06 23:25 ` Kevin Hilman
2011-06-06 7:02 ` Santosh Shilimkar
2011-06-06 7:23 ` DebBarma, Tarun Kanti
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=BANLkTingmUNvZO_szivRkmn7LRO4L5A+5Q@mail.gmail.com \
--to=ccross@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).