From: Jiang Liu <jiang.liu@linux.intel.com>
To: Alex Williamson <alex.williamson@redhat.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Bjorn Helgaas <bhelgaas@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
Thomas Hellstrom <thellstrom@vmware.com>,
"bp @ alien8 . de" <bp@alien8.de>, Lv Zheng <lv.zheng@intel.com>,
"yinghai @ kernel . org" <yinghai@kernel.org>,
"lenb @ kernel . org" <lenb@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [Bugfix] x86/PCI: Release PCI IRQ resource only if PCI device is disabled when unbinding
Date: Tue, 17 Mar 2015 15:37:12 +0800 [thread overview]
Message-ID: <1426577832-23164-1-git-send-email-jiang.liu@linux.intel.com> (raw)
To support IOAPIC hot-removal, we need to release PCI interrupt resource
when unbinding PCI device driver. But due to historical reason,
/*
* We would love to complain here if pci_dev->is_enabled is set, that
* the driver should have called pci_disable_device(), but the
* unfortunate fact is there are too many odd BIOS and bridge setups
* that don't like drivers doing that all of the time.
* Oh well, we can dream of sane hardware when we sleep, no matter how
* horrible the crap we have to deal with is when we are awake...
*/
some drivers don't call pci_disable_device() when unloading, which
prevents us from reallocating PCI interrupt resource on reloading
PCI driver and causes regressions.
So release PCI interrupt resource only if PCI device is disabled when
unbinding. By this way, we could support IOAPIC hot-removal on latest
platforms and avoid regressions on old platforms.
Please aslo refer to:
https://bugzilla.kernel.org/show_bug.cgi?id=94721
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Reported-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Rafael J. Wysocki <rjw@rjwysocki.net>
---
Hi Rafael,
I have assumed an Reviewed-by from you, is that OK?
Thanks!
Gerry
---
arch/x86/pci/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 3d2612b68694..8d792142cb2a 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -527,7 +527,7 @@ static int pci_irq_notifier(struct notifier_block *nb, unsigned long action,
if (action != BUS_NOTIFY_UNBOUND_DRIVER)
return NOTIFY_DONE;
- if (pcibios_disable_irq)
+ if (!pci_is_enabled(dev) && pcibios_disable_irq)
pcibios_disable_irq(dev);
return NOTIFY_OK;
--
1.7.10.4
next reply other threads:[~2015-03-17 7:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 7:37 Jiang Liu [this message]
2015-03-18 22:11 ` [Bugfix] x86/PCI: Release PCI IRQ resource only if PCI device is disabled when unbinding Bjorn Helgaas
2015-03-19 7:49 ` Jiang Liu
2015-03-19 11:29 ` Rafael J. Wysocki
2015-03-19 14:08 ` Bjorn Helgaas
2015-03-19 15:57 ` Rafael J. Wysocki
2015-03-20 5:40 ` Jiang Liu
2015-03-20 14:39 ` Rafael J. Wysocki
2015-03-20 3:09 ` Jiang Liu
2015-03-20 13:11 ` Bjorn Helgaas
-- strict thread matches above, loose matches on Subject: below --
2015-03-11 16:47 [PATCH] x86/PCI: Fully disable devices before releasing IRQ resource Alex Williamson
2015-03-13 2:06 ` [Bugfix] x86/PCI: Release PCI IRQ resource only if PCI device is disabled when unbinding Jiang Liu
2015-03-13 21:45 ` Rafael J. Wysocki
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=1426577832-23164-1-git-send-email-jiang.liu@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mingo@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=thellstrom@vmware.com \
--cc=x86@kernel.org \
--cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).