From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 19 Mar 2015 19:57:52 +0100 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Fam Zheng , Yinghai Lu , Ulrich Obergfell , Rusty Russell Subject: [PATCH v2 1/4] pci: disable msi/msix at probe time Message-ID: <1426786724-22241-2-git-send-email-mst@redhat.com> References: <1426786724-22241-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426786724-22241-1-git-send-email-mst@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: commit d52877c7b1afb8c37ebe17e2005040b79cb618b0 pci/irq: let pci_device_shutdown to call pci_msi_shutdown v2 attempted to address the problem of kexec getting started after linux enabled msi/msix for a device, and drivers being confused by msi being enabled, by disabling msi at shutdown. But arguably, it's better to disable msi/msix when kexec starts - for example, kexec might run after a crash (kdump) and shutdown callbacks are not always invoked in that case. Cc: Yinghai Lu Cc: Ulrich Obergfell Cc: Fam Zheng Cc: Rusty Russell Signed-off-by: Michael S. Tsirkin --- drivers/pci/pci-driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 3cb2210..2ebd2a8 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -305,6 +305,12 @@ static long local_pci_probe(void *_ddi) */ pm_runtime_get_sync(dev); pci_dev->driver = pci_drv; + /* + * When using kexec, msi might be left enabled by the previous kernel, + * this breaks things as some drivers assume msi/msi-x is off at boot. + * Fix this by forcing msi off at startup. + */ + pci_msi_off(pci_dev); rc = pci_drv->probe(pci_dev, ddi->id); if (!rc) return rc; -- MST