Author: jimharris
Date: Tue Sep  8 16:05:18 2015
New Revision: 287564
URL: https://svnweb.freebsd.org/changeset/base/287564

Log:
  isci: check return value of pci_alloc_msix()
  
  Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix()
  always fails.  isci(4) was not properly detecting the allocation failure,
  and would try to proceed with MSIx resource initialization rather than
  reverting to INTx.
  
  Reported and tested by: Bradley W. Dutton ([email protected])
  MFC after:    3 days
  Sponsored by: Intel

Modified:
  head/sys/dev/isci/isci_interrupt.c

Modified: head/sys/dev/isci/isci_interrupt.c
==============================================================================
--- head/sys/dev/isci/isci_interrupt.c  Tue Sep  8 15:59:55 2015        
(r287563)
+++ head/sys/dev/isci/isci_interrupt.c  Tue Sep  8 16:05:18 2015        
(r287564)
@@ -136,8 +136,8 @@ isci_interrupt_setup(struct isci_softc *
            pci_msix_count(isci->device) >= max_msix_messages) {
 
                isci->num_interrupts = max_msix_messages;
-               pci_alloc_msix(isci->device, &isci->num_interrupts);
-               if (isci->num_interrupts == max_msix_messages)
+               if (pci_alloc_msix(isci->device, &isci->num_interrupts) == 0 &&
+                   isci->num_interrupts == max_msix_messages)
                        use_msix = TRUE;
        }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to