Commit c12de882 authored by Jiang Liu's avatar Jiang Liu Committed by Christoph Hellwig

megaraid_sas: fix bug in handling return value of pci_enable_msix_range()

Function pci_enable_msix_range() may return negative values for error
conditions. So it's a bug by checking (pci_enable_msix_range() != 0)
for success and causes failure to megaraid driver when MSI is disabled.
[   16.487267] megaraid_sas 0000:02:00.0: Controller type: iMR
[   16.487275] genirq: Flags mismatch irq 0. 00000000 (megasas) vs. 00015a00 (tii
mer)
[   16.487347] megasas: Failed to register IRQ for vector 0.

Fixes: 8ae80ed1 "megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()"
Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
Acked-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org> # 3.17
parent 7b07bf24
...@@ -4453,7 +4453,7 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -4453,7 +4453,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
instance->msixentry[i].entry = i; instance->msixentry[i].entry = i;
i = pci_enable_msix_range(instance->pdev, instance->msixentry, i = pci_enable_msix_range(instance->pdev, instance->msixentry,
1, instance->msix_vectors); 1, instance->msix_vectors);
if (i) if (i > 0)
instance->msix_vectors = i; instance->msix_vectors = i;
else else
instance->msix_vectors = 0; instance->msix_vectors = 0;
......
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