changeset 10115:8556805fbd6a

6861041 System with IB adapters hung during boot with ONNV 0708 nightly image
author Govinda Tatti <Govinda.Tatti@Sun.COM>
date Fri, 17 Jul 2009 12:27:45 -0700
parents 023993413f11
children 50f8607587c1
files usr/src/uts/sun4/io/px/px_intr.c
diffstat 1 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4/io/px/px_intr.c	Fri Jul 17 13:18:17 2009 -0600
+++ b/usr/src/uts/sun4/io/px/px_intr.c	Fri Jul 17 12:27:45 2009 -0700
@@ -715,27 +715,27 @@
 		break;
 	case DDI_INTROP_ENABLE:
 		/*
-		 * curr_nenables will be greater than 0 if rdip is using
-		 * MSI-X and also, if it is using DUP interface. If this
-		 * curr_enables is > 1, return after clearing the mask bit.
+		 * For MSI, just clear the mask bit and return if curr_nenables
+		 * is > 1. For MSI-X, program MSI address and data for every
+		 * MSI-X vector including dup vectors irrespective of current
+		 * curr_nenables value.
 		 */
-		if ((pci_is_msi_enabled(rdip, hdlp->ih_type) == DDI_SUCCESS) &&
-		    (i_ddi_intr_get_current_nenables(rdip) > 0)) {
-			return (pci_msi_clr_mask(rdip, hdlp->ih_type,
-			    hdlp->ih_inum));
-		}
+		if ((pci_is_msi_enabled(rdip, hdlp->ih_type) != DDI_SUCCESS) ||
+		    (hdlp->ih_type == DDI_INTR_TYPE_MSIX)) {
+			nintrs = i_ddi_intr_get_current_nintrs(hdlp->ih_dip);
 
-		nintrs = i_ddi_intr_get_current_nintrs(hdlp->ih_dip);
+			if ((ret = pci_msi_configure(rdip, hdlp->ih_type,
+			    nintrs, hdlp->ih_inum, msi_addr,
+			    hdlp->ih_type == DDI_INTR_TYPE_MSIX ?
+			    msi_num : msi_num & ~(nintrs - 1))) != DDI_SUCCESS)
+				return (ret);
 
-		if ((ret = pci_msi_configure(rdip, hdlp->ih_type,
-		    nintrs, hdlp->ih_inum, msi_addr,
-		    hdlp->ih_type == DDI_INTR_TYPE_MSIX ? msi_num :
-		    msi_num & ~(nintrs - 1))) != DDI_SUCCESS)
-			return (ret);
-
-		if ((ret = pci_msi_enable_mode(rdip,
-		    hdlp->ih_type)) != DDI_SUCCESS)
-			return (ret);
+			if (i_ddi_intr_get_current_nenables(rdip) < 1) {
+				if ((ret = pci_msi_enable_mode(rdip,
+				    hdlp->ih_type)) != DDI_SUCCESS)
+					return (ret);
+			}
+		}
 
 		if ((ret = pci_msi_clr_mask(rdip, hdlp->ih_type,
 		    hdlp->ih_inum)) != DDI_SUCCESS)