mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Zhang, Tianfei" <tianfei.zhang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@kernel.org" <mingo@kernel.org>
Subject: Re: poweroff block on i8259A_shutdown
Date: Wed, 30 Sep 2015 20:52:44 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1509302043070.4500@nanos> (raw)
In-Reply-To: <BA6F50564D52C24884F9840E07E32DEC2A90C0C9@CDSMSX102.ccr.corp.intel.com>

On Fri, 25 Sep 2015, Zhang, Tianfei wrote:
> I have a board it block on i8259A_shutdown when I want to
> poweroff. It is not always re-produce.

> [   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(), should it add
> lock and disable IRQ on i8259A_shutdown?

Indeed, but that won't cure the problem completely. We shut down i8259
before we made sure, that all interrupts which end up there are
shutdown. So even with the patch applied you can run into the
following problem:

CPU0			CPU1
			interrupt
			   i8259_mask();
i8259A_shutdown();
			   i8259_unmask();

That needs some more thought. Can you provide a bit more information
about your system please? Output of /proc/interrupts would be a good
starting point.
 
> --- a/arch/x86/kernel/i8259.c
> +++ b/arch/x86/kernel/i8259.c
> @@ -262,8 +262,11 @@ static void i8259A_shutdown(void)
>       * the kernel initialization code can get it
>       * out of.
>       */
> +     unsigned long flags;
> +     raw_spin_lock_irqsave(&i8259A_lock, flags);
>      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);
> }

FYI, that patch is white space damaged. Please configure your mail
client correctly or use one which does not mangle stuff.

Aside of that, a patch wants a proper changelog. You also did not tell
us whether that patch solves your problem. See Documentation for
instructions on how to submit patches please.

Thanks,

	tglx



           reply	other threads:[~2015-09-30 18:53 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <BA6F50564D52C24884F9840E07E32DEC2A90C0C9@CDSMSX102.ccr.corp.intel.com>]

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=alpine.DEB.2.11.1509302043070.4500@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tianfei.zhang@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

all inboxes | Powered by JetHome®