mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Figo <tianfei.zhang@intel.com>
To: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, Figo <tianfei.zhang@intel.com>
Subject: [PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.
Date: Sat, 10 Oct 2015 18:36:44 +0800	[thread overview]
Message-ID: <1444473404-24058-1-git-send-email-tianfei.zhang@intel.com> (raw)

There is the log:
[   27.758391] xhci_hcd 0000:00:14.0: shutdown start
[   27.768329] xhci_hcd 0000:00:14.0: shutdown stop
[   27.773532] pci 0000:00:0b.0: shutdown start
[   27.778335] pci 0000:00:0b.0: shutdown stop
[   27.783041] pci 0000:00:0a.0: shutdown start
[   27.787847] pci 0000:00:0a.0: shutdown stop
[   27.792550] pci 0000:00:03.0: shutdown start
[   27.797362] pci 0000:00:03.0: shutdown stop
[   27.802087] i915 0000:00:02.0: shutdown start
[   27.816006] i915 0000:00:02.0: shutdown stop
[   27.832384] PM: Calling mce_syscore_shutdown+0x0/0x50 start
[   27.838651] PM: Calling mce_syscore_shutdown+0x0/0x50 stop
[   27.844813] PM: Calling i8259A_shutdown+0x0/0x20 start

It seems has a potential race on i8259A_shutdown().

Signed-off-by: Figo <tianfei.zhang@intel.com>
---
 arch/x86/kernel/i8259.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 16cb827..06906d4 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -257,12 +257,16 @@ static int i8259A_suspend(void)
 
 static void i8259A_shutdown(void)
 {
+	unsigned long flags;
+
+	raw_spin_lock_irqsave(&i8259A_lock, flags);
 	/* Put the i8259A into a quiescent state that
 	 * the kernel initialization code can get it
 	 * out of.
 	 */
 	outb(0xff, PIC_MASTER_IMR);	/* mask all of 8259A-1 */
 	outb(0xff, PIC_SLAVE_IMR);	/* mask all of 8259A-2 */
+	raw_spin_unlock_irqrestore(&i8259A_lock, flags);
 }
 
 static struct syscore_ops i8259_syscore_ops = {
-- 
1.7.9.5


             reply	other threads:[~2015-10-10  2:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 10:36 Figo [this message]
2015-10-11 17:34 ` Thomas Gleixner

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=1444473404-24058-1-git-send-email-tianfei.zhang@intel.com \
    --to=tianfei.zhang@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®