public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: yhlu.kernel@gmail.com
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Jeff Garzik <jeff@garzik.org>,
	Ayaz Abdulla <aabdulla@nvidia.com>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86_64: restore mask_bits in msi shutdown
Date: Thu, 17 Apr 2008 03:15:44 -0700	[thread overview]
Message-ID: <m1y77cu6r3.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <200804111626.11232.yhlu.kernel@gmail.com> (Yinghai Lu's message of "Fri, 11 Apr 2008 16:26:11 -0700")

Hmm.  Trying this again with what should be yh's proper address.


Yinghai Lu <yhlu.kernel.send@gmail.com> writes:

> I can not kexec RHEL 5.1 from 2.6.25-rc3 later
>
> caused by:
> commit 89d694b9dbe769ca1004e01db0ca43964806a611
> Author: Thomas Gleixner <tglx@linutronix.de>
> Date:   Mon Feb 18 18:25:17 2008 +0100
>
>     genirq: do not leave interupts enabled on free_irq
>
>     The default_disable() function was changed in commit:
>
>      76d2160147f43f982dfe881404cfde9fd0a9da21
>      genirq: do not mask interrupts by default
>
>     It removed the mask function in favour of the default delayed
>     interrupt disabling. Unfortunately this also broke the shutdown in
>     free_irq() when the last handler is removed from the interrupt for
>     those architectures which rely on the default implementations. Now we
>     can end up with a enabled interrupt line after the last handler was
>     removed, which can result in spurious interrupts.
>
>     Fix this by adding a default_shutdown function, which is only
>     installed, when the irqchip implementation does provide neither a
>     shutdown nor a disable function.
>
>     [@stable: affected versions: .21 - .24 ]
>
>
>
> for MSI, default_shutdown will call mask_bit for msi device. so all mask bits
> will
> left disabled after free_irq.
> then if kexec next kernel that only can use msi_enable bit.
> all device's MSI can not be used.
>
> So try to restore MSI mask bits that is saved before using msi in first kernel.
>
> Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Ouch!  In the case of MSI-X this is horrible.  Reenabling an interrupt
line when we are not using it.  That is likely to cause even stranger
things than kexec to fail.

What happens when someone next comes to use that msi interrupt is
a reasonable question.

The PCI standard describes the state the bits in the msi capability
are supposed to be in after reset, and if a driver is going to
assume some state that is the only reasonable state for a driver to
expect the hardware to be in.  So we don't need to perform a
save/restore cycle.

Could you look at having pci_disable_msi reset the mask bit
to it's default state after we have called msi_set_enable(dev, 0)?
Once the msi capability is disabled the mask bit has no affect.

You should be able to ignoring pci_disable_msix for now.

Thanks, 
Eric


  parent reply	other threads:[~2008-04-17 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11 23:26 [PATCH] x86_64: restore mask_bits in msi shutdown Yinghai Lu
2008-04-15  8:12 ` Andrew Morton
2008-04-15  8:17   ` Yinghai Lu
2008-04-17  9:19 ` Eric W. Biederman
2008-04-17  9:44   ` Yinghai Lu
2008-04-17  9:51   ` Yinghai Lu
2008-04-17 10:15 ` Eric W. Biederman [this message]
2008-04-17 19:38   ` Yinghai Lu

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=m1y77cu6r3.fsf@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=aabdulla@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.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