summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@redhat.com>2014-01-17 17:02:15 +0100
committerBjorn Helgaas <bhelgaas@google.com>2014-02-14 22:22:40 +0100
commitbc03fd3a8a95a13ecce413790f75f6e1a0f54d27 (patch)
tree0cae63355cf967a728688a0bd96461dd79283a93 /drivers/ata
parentPCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact() (diff)
downloadlinux-bc03fd3a8a95a13ecce413790f75f6e1a0f54d27.tar.xz
linux-bc03fd3a8a95a13ecce413790f75f6e1a0f54d27.zip
ahci: Fix broken fallback to single MSI mode
Commit 7b92b4f61ec4 ("PCI/MSI: Remove pci_enable_msi_block_auto()") introduced a regression: if multiple MSI initialization fails, the code falls back to INTx rather than to single MSI. Fixes: 7b92b4f61ec4 ("PCI/MSI: Remove pci_enable_msi_block_auto()") Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index dc2756fb6f33..3c5f35ef7e55 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1170,8 +1170,10 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
nvec = rc;
rc = pci_enable_msi_block(pdev, nvec);
- if (rc)
+ if (rc < 0)
goto intx;
+ else if (rc > 0)
+ goto single_msi;
return nvec;