From: Yinghai Lu <yhlu.kernel.send@gmail.com>
To: akpm@linux-foundation.org, mingo@elte.hu, linux-kernel@vger.kernel.org
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
tglx@linutronix.de, aabdulla@nvidia.com, jeff@garzik.org
Subject: Re: [patch 3/4] x86_64: restore mask_bits in msi shutdown
Date: Mon, 21 Apr 2008 12:21:21 -0700 [thread overview]
Message-ID: <200804211221.22207.yhlu.kernel@gmail.com> (raw)
In-Reply-To: <m163udu5by.fsf@frodo.ebiederm.org>
Andrew,
We should use this one.
YH
---
[PATCH] irq: restore mask_bits in msi shutdown -v2
From: "Eric W. Biederman" <ebiederm@xmission.com>
Yinghai found after using 2.6.25-rc3 later to kexec RHEL 5.1,
NIC can not be used.
bisected to
| 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.
want to try to restore MSI mask bits that is saved before using msi in first
kernel.
Eric said:
This is over complicated and for hardware that erroneously triggers
a msi irq after free_irq may have potential problems.
So lets do the much simpler, much safer, and more general method of
restoring the mask bit to it's pci reset defined value (enabled) when
we disable the kernels use of msi.
it will work, because pci_diable_msi is called after free_irq is called.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Yinghai Lu <yhlu.kernel@gmail.com>
Tested-by: Yinghai Lu <yhlu.kernel@gmail.com>
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 26938da..b9ff895 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -583,6 +583,9 @@ void pci_disable_msi(struct pci_dev* dev)
BUG_ON(list_empty(&dev->msi_list));
entry = list_entry(dev->msi_list.next, struct msi_desc, list);
+ /* Return the the pci reset with msi irqs unmasked */
+ if (entry->msi_attrib.maskbit)
+ msi_set_mask_bit(dev->irq, 0);
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI) {
return;
}
next parent reply other threads:[~2008-04-21 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200804182028.m3IKSKHY013602@imap1.linux-foundation.org>
[not found] ` <86802c440804182315y5f7e4d80j678e7f510a8f0763@mail.gmail.com>
[not found] ` <m163udu5by.fsf@frodo.ebiederm.org>
2008-04-21 19:21 ` Yinghai Lu [this message]
2008-04-21 19:32 ` [patch 3/4] x86_64: restore mask_bits in msi shutdown Ingo Molnar
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=200804211221.22207.yhlu.kernel@gmail.com \
--to=yhlu.kernel.send@gmail.com \
--cc=aabdulla@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.