All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Sudeep Holla" <sudeep.holla@arm.com>,
	"maoguang meng" <maoguang.meng@mediatek.com>,
	"Hongzhou Yang" <hongzhou.yang@mediatek.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Daniel Kurtz" <djkurtz@chromium.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Yingjoe Chen (陳英洲)" <Yingjoe.Chen@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4] pinctrl: mediatek: Implement wake handler and suspend resume
Date: Tue, 15 Sep 2015 18:48:07 +0100	[thread overview]
Message-ID: <55F859D7.1000803@arm.com> (raw)
In-Reply-To: <CAKdAkRSFE2KJOzbUarxAQMNwHOkkyGHXmRLGhn55VTvG-SJ4Kg@mail.gmail.com>



On 15/09/15 03:52, Dmitry Torokhov wrote:
> On Mon, Sep 14, 2015 at 4:16 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:

[...]

>>
>> This is wrong assumption in the driver. enable_irq_wake doesn't
>> implicitly enable the IRQ. So the disable_irq should be moved to else.
>> And the resume patch also needs to be fixed accordingly, otherwise you
>> may get unbalanced irq. But this should not be the reason for fixing the
>> pinctrl suspend/resume.
>>
>
> Elan driver does not want to enable servicing IRQs, it just wants to
> configure them as wakeup sources. Hence the current elan_suspend() is
> fine. When system wakes up and the device is resumed and the driver is
> ready to service interrupts it will enable IRQ again.
>

Fair enough. But I am struggling to understand how this fits into
existing IRQ infrastructure. Few controllers that don't have wakeup
source configuration facility can set IRQCHIP_SKIP_SET_WAKE and just
leave the interrupts enabled in suspend path to wake it up. So IMO,
the above strategy might not work on such controllers.

> IOW enable_irq_wake() and enable_irq() are 2 completely different
> calls and it is perfectly fine to disable IRQ and then ebale it as a
> wakeup source.

I agree that they are entirely different APIs, I am not sure if we can
support different interrupt controller with such strategy.

Since the irq/pm core handle disabling device IRQs and section "System
Wakeup Interrupts, enable_irq_wake() and disable_irq_wake()" in
Documentation/power/suspend-and-interrupts.txt gives me different
understanding, we can check with tglx on how to handle this.

Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] pinctrl: mediatek: Implement wake handler and suspend resume
Date: Tue, 15 Sep 2015 18:48:07 +0100	[thread overview]
Message-ID: <55F859D7.1000803@arm.com> (raw)
In-Reply-To: <CAKdAkRSFE2KJOzbUarxAQMNwHOkkyGHXmRLGhn55VTvG-SJ4Kg@mail.gmail.com>



On 15/09/15 03:52, Dmitry Torokhov wrote:
> On Mon, Sep 14, 2015 at 4:16 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:

[...]

>>
>> This is wrong assumption in the driver. enable_irq_wake doesn't
>> implicitly enable the IRQ. So the disable_irq should be moved to else.
>> And the resume patch also needs to be fixed accordingly, otherwise you
>> may get unbalanced irq. But this should not be the reason for fixing the
>> pinctrl suspend/resume.
>>
>
> Elan driver does not want to enable servicing IRQs, it just wants to
> configure them as wakeup sources. Hence the current elan_suspend() is
> fine. When system wakes up and the device is resumed and the driver is
> ready to service interrupts it will enable IRQ again.
>

Fair enough. But I am struggling to understand how this fits into
existing IRQ infrastructure. Few controllers that don't have wakeup
source configuration facility can set IRQCHIP_SKIP_SET_WAKE and just
leave the interrupts enabled in suspend path to wake it up. So IMO,
the above strategy might not work on such controllers.

> IOW enable_irq_wake() and enable_irq() are 2 completely different
> calls and it is perfectly fine to disable IRQ and then ebale it as a
> wakeup source.

I agree that they are entirely different APIs, I am not sure if we can
support different interrupt controller with such strategy.

Since the irq/pm core handle disabling device IRQs and section "System
Wakeup Interrupts, enable_irq_wake() and disable_irq_wake()" in
Documentation/power/suspend-and-interrupts.txt gives me different
understanding, we can check with tglx on how to handle this.

Regards,
Sudeep

  reply	other threads:[~2015-09-15 17:48 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14  8:38 [PATCH v4] pinctrl: mediatek: Implement wake handler and suspend resume maoguang.meng
2015-08-14  8:38 ` maoguang.meng
2015-08-14  8:38 ` maoguang.meng at mediatek.com
2015-08-14  9:57 ` Daniel Kurtz
2015-08-14  9:57   ` Daniel Kurtz
2015-08-17  7:52 ` Yingjoe Chen
2015-08-17  7:52   ` Yingjoe Chen
2015-08-17  7:52   ` Yingjoe Chen
2015-08-17  9:09   ` Daniel Kurtz
2015-08-17  9:09     ` Daniel Kurtz
2015-08-17  9:09     ` Daniel Kurtz
2015-08-17 13:25     ` Yingjoe Chen
2015-08-17 13:25       ` Yingjoe Chen
2015-08-17 13:25       ` Yingjoe Chen
2015-08-17 21:45       ` Hongzhou Yang
2015-08-17 21:45         ` Hongzhou Yang
2015-08-17 21:45         ` Hongzhou Yang
2015-08-24 16:27 ` Sudeep Holla
2015-08-24 16:27   ` Sudeep Holla
2015-09-02  6:02   ` Daniel Kurtz
2015-09-02  6:02     ` Daniel Kurtz
     [not found]     ` <CAGS+omBnoitju07KQ1Y7JHTbce6+DO4WqWHTaKz5D+T157zEJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-06 10:39       ` maoguang meng
2015-09-06 10:39         ` maoguang meng
2015-09-06 10:39         ` maoguang meng
2015-09-08  9:28         ` Sudeep Holla
2015-09-08  9:28           ` Sudeep Holla
2015-09-08 16:50           ` Sudeep Holla
2015-09-08 16:50             ` Sudeep Holla
2015-09-11 11:22             ` Chung-Yih Wang (王崇懿)
2015-09-11 11:22               ` Chung-Yih Wang (王崇懿)
2015-09-11 12:43               ` Sudeep Holla
2015-09-11 12:43                 ` Sudeep Holla
2015-09-11 12:43                 ` Sudeep Holla
2015-09-12  9:50             ` maoguang meng
2015-09-12  9:50               ` maoguang meng
2015-09-14 11:16               ` Sudeep Holla
2015-09-14 11:16                 ` Sudeep Holla
2015-09-15  2:43                 ` Daniel Kurtz
2015-09-15  2:43                   ` Daniel Kurtz
2015-09-15  2:52                 ` Dmitry Torokhov
2015-09-15  2:52                   ` Dmitry Torokhov
2015-09-15 17:48                   ` Sudeep Holla [this message]
2015-09-15 17:48                     ` Sudeep Holla
2015-08-26 12:41 ` Linus Walleij
2015-08-26 12:41   ` 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=55F859D7.1000803@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Yingjoe.Chen@mediatek.com \
    --cc=djkurtz@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hongzhou.yang@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=maoguang.meng@mediatek.com \
    --cc=matthias.bgg@gmail.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.