From: "tip-bot for Liu, Chuansheng" <chuansheng.liu@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
yanmin_zhang@linux.intel.com, tglx@linutronix.de,
chuansheng.liu@intel.com
Subject: [tip:x86/urgent] x86: Preserve lazy irq disable semantics in fixup_irqs()
Date: Thu, 29 Mar 2012 06:48:53 -0700 [thread overview]
Message-ID: <tip-99dd5497e5be4fe4194cad181d45fd6569a930db@git.kernel.org> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A05DFB3@SHSMSX101.ccr.corp.intel.com>
Commit-ID: 99dd5497e5be4fe4194cad181d45fd6569a930db
Gitweb: http://git.kernel.org/tip/99dd5497e5be4fe4194cad181d45fd6569a930db
Author: Liu, Chuansheng <chuansheng.liu@intel.com>
AuthorDate: Mon, 26 Mar 2012 07:11:50 +0000
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 29 Mar 2012 15:28:47 +0200
x86: Preserve lazy irq disable semantics in fixup_irqs()
The default irq_disable() sematics are to mark the interrupt disabled,
but keep it unmasked. If the interrupt is delivered while marked
disabled, the low level interrupt handler masks it and marks it
pending. This is important for detecting wakeup interrupts during
suspend and for edge type interrupts to avoid losing interrupts.
fixup_irqs() moves the interrupts away from an offlined cpu. For
certain interrupt types it needs to mask the interrupt line before
changing the affinity. After affinity has changed the interrupt line
is unmasked again, but only if it is not marked disabled.
This breaks the lazy irq disable semantics and causes problems in
suspend as the interrupt can be lost or wakeup functionality is
broken.
Check irqd_irq_masked() instead of irqd_irq_disabled() because
irqd_irq_masked() is only set, when the core code actually masked the
interrupt line. If it's not set, we unmask the interrupt and let the
lazy irq disable logic deal with an eventually incoming interrupt.
[ tglx: Massaged changelog and added a comment ]
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>
Link: http://lkml.kernel.org/r/27240C0AC20F114CBF8149A2696CBE4A05DFB3@SHSMSX101.ccr.corp.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/irq.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 7943e0c..3dafc60 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -282,8 +282,13 @@ void fixup_irqs(void)
else if (!(warned++))
set_affinity = 0;
+ /*
+ * We unmask if the irq was not marked masked by the
+ * core code. That respects the lazy irq disable
+ * behaviour.
+ */
if (!irqd_can_move_in_process_context(data) &&
- !irqd_irq_disabled(data) && chip->irq_unmask)
+ !irqd_irq_masked(data) && chip->irq_unmask)
chip->irq_unmask(data);
raw_spin_unlock(&desc->lock);
prev parent reply other threads:[~2012-03-29 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 7:11 [PATCH] x86_fixup_irqs: Fix possible missing interrupt handle when disabling CPU Liu, Chuansheng
2012-03-28 5:38 ` Yanmin Zhang
2012-03-28 13:16 ` Srivatsa S. Bhat
2012-03-29 10:19 ` Thomas Gleixner
2012-03-29 10:29 ` [tip:x86/urgent] x86: Preserve lazy irq disable semantics in fixup_irqs() tip-bot for Liu, Chuansheng
2012-03-29 13:48 ` tip-bot for Liu, Chuansheng [this message]
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-99dd5497e5be4fe4194cad181d45fd6569a930db@git.kernel.org \
--to=chuansheng.liu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=yanmin_zhang@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox