[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYT4hBrQdkRcqzG4=435MTTWkA2YOsq4y-6gEkLNmQD5g@mail.gmail.com>
Date: Fri, 28 Nov 2014 09:05:52 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Heiko Stuebner <heiko@...ech.de>,
Sonny Rao <sonnyrao@...omium.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Chris Zhong <zyw@...k-chips.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] pinctrl: rockchip: Handle wakeup pins
On Wed, Nov 19, 2014 at 11:51 PM, Doug Anderson <dianders@...omium.org> wrote:
> The rockchip pinctrl driver was using irq_gc_set_wake() as its
> implementation of irq_set_wake() but was totally ignoring everything
> that irq_gc_set_wake() did (which is to upkeep gc->wake_active).
>
> Let's fix that by setting gc->wake_active as GPIO_INTEN at suspend
> time and restoring GPIO_INTEN at resume time.
>
> NOTE a few quirks when thinking about this patch:
> - Rockchip pinctrl hardware supports both "disable/enable" and
> "mask/unmask". Right now we only use "disable/enable" and present
> those to Linux as "mask/unmask". This should be OK because
> enable/disable is optional and Linux will implement it in terms of
> mask/unmask. At the moment we always tell hardware all interrupts
> are unmasked (the boot default).
> - At suspend time Linux tries to call "disable" on all interrupts and
> also enables wakeup on all wakeup interrupts. One would think that
> since "disable" is implemented as "mask" when "disable" isn't
> provided and that since we were ignoring gc->wake_active that
> nothing would have woken us up. That's not the case since Linux
> "optimizes" things and just leaves interrutps unmasked, assuming it
> could mask them later when they go off. That meant that at suspend
> time all interrupts were actually being left enabled.
>
> With this patch random non-wakeup interrupts no longer wake the system
> up. Wakeup interrupts still wake the system up.
>
> Signed-off-by: Doug Anderson <dianders@...omium.org>
> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> Reviewed-by: Heiko Stuebner <heiko@...ech.de>
> ---
> Changes in v2: None
Patch applied.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists