Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1243796 > unrolled thread

[PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.

Started byFigo <tianfei.zhang@intel.com>
First post2015-10-10 04:50 +0200
Last post2015-10-11 19:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce. Figo <tianfei.zhang@intel.com> - 2015-10-10 04:50 +0200
    Re: [PATCH 1/1] I have a board it block on i8259A_shutdown when I  want to poweroff. It is not always re-produce. Thomas Gleixner <tglx@linutronix.de> - 2015-10-11 19:40 +0200

#1243796 — [PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.

FromFigo <tianfei.zhang@intel.com>
Date2015-10-10 04:50 +0200
Subject[PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.
Message-ID<qhSop-4sE-13@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1244173 — Re: [PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.

FromThomas Gleixner <tglx@linutronix.de>
Date2015-10-11 19:40 +0200
SubjectRe: [PATCH 1/1] I have a board it block on i8259A_shutdown when I want to poweroff. It is not always re-produce.
Message-ID<qisLg-6PR-11@gated-at.bofh.it>
In reply to#1243796
Figo,

On Sat, 10 Oct 2015, Figo wrote:

Thanks for resending, but let me clarify a few things.

Subject line:

[PATCH 1/1] I have a board it block on i8259A_shutdown when I want to 
          poweroff. It is not always re-produce.

That's not a proper patch subject line. It should start with the
subsystem and the particular unit in the subsystem you are modifying.

[PATCH] x86/i8259:

The subject itself should contain a short and understandable
description of the modification. Something like this:

[PATCH] x86/i8259: Take i8259_lock in i8259A_shutdown()

or 

[PATCH] x86/i8259: Prevent race in i8259A_shutdown()

Ok?

That must be followed by an explanation of the problem and how the
modification of the code solves it.

Ok?

Aside of that I provided you another example of a problem which is not
cured by your patch, but I can't find an answer to that either. I
explicitely asked you for more information.

Please always address the questions a reviewer asks you. If the
questions are not clear to you, feel free to ask for clarification.

Thanks,

	tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web