From: "tip-bot for Rafael J. Wysocki" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
rafael.j.wysocki@intel.com, aubrey.li@linux.intel.com,
gnomes@lxorguk.ukuu.org.uk, dmitry.torokhov@gmail.com,
tglx@linutronix.de
Subject: [tip:irq/core] PM / sleep / irq: Do not suspend wakeup interrupts
Date: Tue, 15 Jul 2014 04:01:10 -0700 [thread overview]
Message-ID: <tip-d709f7bcbb3ab01704fa7b37a2e4b981cf3783c1@git.kernel.org> (raw)
In-Reply-To: <4679574.kGUnqAuNl9@vostro.rjw.lan>
Commit-ID: d709f7bcbb3ab01704fa7b37a2e4b981cf3783c1
Gitweb: http://git.kernel.org/tip/d709f7bcbb3ab01704fa7b37a2e4b981cf3783c1
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
AuthorDate: Thu, 10 Jul 2014 23:37:54 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 15 Jul 2014 12:57:26 +0200
PM / sleep / irq: Do not suspend wakeup interrupts
If an IRQ has been configured for wakeup via enable_irq_wake(), the
driver who has done that must be prepared for receiving interrupts
after suspend_device_irqs() has returned, so there is no need to
"suspend" such IRQs. Moreover, if drivers using enable_irq_wake()
actually want to receive interrupts after suspend_device_irqs() has
returned, they need to add IRQF_NO_SUSPEND to the IRQ flags while
requesting the IRQs, which shouldn't be necessary (it also goes a bit
too far, as IRQF_NO_SUSPEND causes the IRQ to be ignored by
suspend_device_irqs() all the time regardless of whether or not it
has been configured for signaling wakeup).
For the above reasons, make __disable_irq() ignore IRQ descriptors
with IRQD_WAKEUP_STATE set when its suspend argument is true which
effectively causes them to behave like IRQs with IRQF_NO_SUSPEND
set.
This also allows IRQs configured for wakeup via enable_irq_wake()
to work as wakeup interrupts for the "freeze" (suspend-to-idle)
sleep mode automatically just like for any other sleep states.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Li Aubrey <aubrey.li@linux.intel.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Link: http://lkml.kernel.org/r/4679574.kGUnqAuNl9@vostro.rjw.lan
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/manage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 3dc6a61..88657d7 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -385,7 +385,8 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
{
if (suspend) {
- if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
+ if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND) ||
+ irqd_has_set(&desc->irq_data, IRQD_WAKEUP_STATE))
return;
desc->istate |= IRQS_SUSPENDED;
}
next prev parent reply other threads:[~2014-07-15 11:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 0:51 [PATCH] GPIO button wth wakeup attribute is supposed to wake the system up Li, Aubrey
2014-06-19 10:40 ` One Thousand Gnomes
2014-06-23 23:35 ` Li, Aubrey
2014-07-08 20:52 ` Rafael J. Wysocki
2014-07-08 20:45 ` Dmitry Torokhov
2014-07-08 21:06 ` Rafael J. Wysocki
2014-07-08 21:12 ` Dmitry Torokhov
2014-07-08 21:47 ` Rafael J. Wysocki
2014-07-08 22:11 ` Dmitry Torokhov
2014-07-08 23:06 ` Rafael J. Wysocki
2014-07-09 0:15 ` Dmitry Torokhov
2014-07-09 0:59 ` Rafael J. Wysocki
2014-07-09 0:54 ` Dmitry Torokhov
2014-07-09 12:45 ` Rafael J. Wysocki
2014-07-10 2:27 ` Li, Aubrey
2014-07-10 11:27 ` Rafael J. Wysocki
2014-07-10 21:37 ` [PATCH] PM / sleep / irq: Do not suspend wakeup interrupts Rafael J. Wysocki
2014-07-15 11:01 ` tip-bot for Rafael J. Wysocki [this message]
2014-07-31 2:24 ` [tip:irq/core] " Rafael J. Wysocki
2014-07-15 12:22 ` [PATCH] " Alexander Stein
2014-07-15 12:50 ` Rafael J. Wysocki
2014-07-15 12:36 ` Alexander Stein
2014-07-16 0:45 ` Rafael J. Wysocki
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=tip-d709f7bcbb3ab01704fa7b37a2e4b981cf3783c1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=aubrey.li@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tglx@linutronix.de \
/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