Browse Source

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>
Alexander Gordeev 11 years ago
parent
commit
fc40363b21
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/ata/ahci.c

+ 3 - 1
drivers/ata/ahci.c

@@ -1170,8 +1170,10 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
 
 
 	nvec = rc;
 	nvec = rc;
 	rc = pci_enable_msi_block(pdev, nvec);
 	rc = pci_enable_msi_block(pdev, nvec);
-	if (rc)
+	if (rc < 0)
 		goto intx;
 		goto intx;
+	else if (rc > 0)
+		goto single_msi;
 
 
 	return nvec;
 	return nvec;