From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources
Date: Wed, 26 Aug 2015 09:52:16 +0100 [thread overview]
Message-ID: <55DD7E40.1040009@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1508252123310.15006@nanos>
Hi Thomas,
On 25/08/15 20:26, Thomas Gleixner wrote:
> On Tue, 25 Aug 2015, Sudeep Holla wrote:
>> On 25/08/15 15:54, Shenwei Wang wrote:
>>> You don't really understand what happens after a driver calls
>>> enable_irq_wake. In suspend state, even the interrupt
>>> controller itself is powered off. How can you get the system up
>>> again by just using a SKIP_SET_WAKE.
>>
>> Sorry for that, let me try to understand aloud. So you have
>> irq_{un,}mask function that are called when interrupts are enabled and
>> disabled. So suppose you have 3 irqs that are enabled and only one of
>> then is set as wakeup source.
>>
>> Now you call enable_irq_wake, you save that in wakeup_sources, fine.
>> Later when you enter suspend, you save all the 3 active irqs in
>> saved_irq_mask and over-write cpu2wakeup with wakeup_sources, right?
>>
>> All fine, what I am saying is let irq-core know that you want to mask
>> the 2 non-wakeup irqs you have using MASK_ON_SUSPEND. So when
>> suspend_device_irqs is called in suspend path, that's done for you
>> automatically and the cpu2wakeup will have just 1 wakeup enabled which
>> is what you are doing in suspend callback, right ?
>
> I missed that when I reviewed the patch. You are right, it can be
> simplified.
>
>> Now that it's already done for you, you need not do anything extra and
>> hence just set SKIP_SET_WAKE to do nothing.
Thanks for confirming this.
>
> He still needs the set_wake function to capture the wake enabled
> interrupts as they are handed over to the low level asm code via
> imx_gpcv2_get_wakeup_source(). Though they could be read back from the
> hw registers as well.
>
Correct, I have no objection on how it's saved/restored but was against
having 2 different masks and with the approach taken in this patch the
non-wakeup interrupts are enabled until syscore_suspend which is wrong.
There's whole lot of drivers blindly copy pasting this as theme which I
am going through and trying to clean up. I wanted to ensure no more such
additions happen meanwhile, so I am watching such patches closely.
Regards,
Sudeep
WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Shenwei Wang <Shenwei.Wang@freescale.com>,
"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
"jason@lakedaemon.net" <jason@lakedaemon.net>,
Huang Anson <Anson.Huang@freescale.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources
Date: Wed, 26 Aug 2015 09:52:16 +0100 [thread overview]
Message-ID: <55DD7E40.1040009@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1508252123310.15006@nanos>
Hi Thomas,
On 25/08/15 20:26, Thomas Gleixner wrote:
> On Tue, 25 Aug 2015, Sudeep Holla wrote:
>> On 25/08/15 15:54, Shenwei Wang wrote:
>>> You don't really understand what happens after a driver calls
>>> enable_irq_wake. In suspend state, even the interrupt
>>> controller itself is powered off. How can you get the system up
>>> again by just using a SKIP_SET_WAKE.
>>
>> Sorry for that, let me try to understand aloud. So you have
>> irq_{un,}mask function that are called when interrupts are enabled and
>> disabled. So suppose you have 3 irqs that are enabled and only one of
>> then is set as wakeup source.
>>
>> Now you call enable_irq_wake, you save that in wakeup_sources, fine.
>> Later when you enter suspend, you save all the 3 active irqs in
>> saved_irq_mask and over-write cpu2wakeup with wakeup_sources, right?
>>
>> All fine, what I am saying is let irq-core know that you want to mask
>> the 2 non-wakeup irqs you have using MASK_ON_SUSPEND. So when
>> suspend_device_irqs is called in suspend path, that's done for you
>> automatically and the cpu2wakeup will have just 1 wakeup enabled which
>> is what you are doing in suspend callback, right ?
>
> I missed that when I reviewed the patch. You are right, it can be
> simplified.
>
>> Now that it's already done for you, you need not do anything extra and
>> hence just set SKIP_SET_WAKE to do nothing.
Thanks for confirming this.
>
> He still needs the set_wake function to capture the wake enabled
> interrupts as they are handed over to the low level asm code via
> imx_gpcv2_get_wakeup_source(). Though they could be read back from the
> hw registers as well.
>
Correct, I have no objection on how it's saved/restored but was against
having 2 different masks and with the approach taken in this patch the
non-wakeup interrupts are enabled until syscore_suspend which is wrong.
There's whole lot of drivers blindly copy pasting this as theme which I
am going through and trying to clean up. I wanted to ensure no more such
additions happen meanwhile, so I am watching such patches closely.
Regards,
Sudeep
next prev parent reply other threads:[~2015-08-26 8:52 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 19:04 [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources Shenwei Wang
2015-08-24 19:04 ` Shenwei Wang
2015-08-24 19:14 ` Thomas Gleixner
2015-08-24 19:14 ` Thomas Gleixner
2015-08-24 19:20 ` Shenwei Wang
2015-08-24 19:20 ` Shenwei Wang
2015-08-24 19:30 ` Thomas Gleixner
2015-08-24 19:30 ` Thomas Gleixner
2015-08-24 19:32 ` Shenwei Wang
2015-08-24 19:32 ` Shenwei Wang
2015-08-24 19:51 ` [tip:irq/core] irqchip/imx-gpcv2: " tip-bot for Shenwei Wang
2015-08-25 9:24 ` [PATCH v9 1/1] irqchip: imx-gpcv2: " Sudeep Holla
2015-08-25 9:24 ` Sudeep Holla
2015-08-25 13:38 ` Shenwei Wang
2015-08-25 13:38 ` Shenwei Wang
2015-08-25 13:54 ` Sudeep Holla
2015-08-25 13:54 ` Sudeep Holla
2015-08-25 14:14 ` Shenwei Wang
2015-08-25 14:14 ` Shenwei Wang
2015-08-25 14:45 ` Sudeep Holla
2015-08-25 14:45 ` Sudeep Holla
2015-08-25 14:54 ` Shenwei Wang
2015-08-25 14:54 ` Shenwei Wang
2015-08-25 16:24 ` Sudeep Holla
2015-08-25 16:24 ` Sudeep Holla
2015-08-25 19:24 ` Shenwei Wang
2015-08-25 19:24 ` Shenwei Wang
2015-08-25 19:29 ` Thomas Gleixner
2015-08-25 19:29 ` Thomas Gleixner
2015-08-25 19:58 ` Shenwei Wang
2015-08-25 19:58 ` Shenwei Wang
2015-08-25 20:15 ` Thomas Gleixner
2015-08-25 20:15 ` Thomas Gleixner
2015-08-25 20:43 ` Shenwei Wang
2015-08-25 20:43 ` Shenwei Wang
2015-08-25 20:49 ` Thomas Gleixner
2015-08-25 20:49 ` Thomas Gleixner
2015-08-25 20:53 ` Shenwei Wang
2015-08-25 20:53 ` Shenwei Wang
2015-08-25 19:26 ` Thomas Gleixner
2015-08-25 19:26 ` Thomas Gleixner
2015-08-26 8:52 ` Sudeep Holla [this message]
2015-08-26 8:52 ` Sudeep Holla
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=55DD7E40.1040009@arm.com \
--to=sudeep.holla@arm.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 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.