Commit fc40363b authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Bjorn Helgaas

ahci: Fix broken fallback to single MSI mode

Commit 7b92b4f6 ("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: 7b92b4f6 ("PCI/MSI: Remove pci_enable_msi_block_auto()")
Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
parent 1f42db78
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment