changeset 10647:d0c1a4172256

6870981 BAD trap panic in nxge when installing s10u8_05
author lipeng sang - Sun Microsystems - Beijing China <Lipeng.Sang@Sun.COM>
date Fri, 25 Sep 2009 13:18:26 +0800
parents 9d107b7bd2f0
children fd73c9d70fde
files usr/src/uts/i86pc/io/pci/pci_common.c usr/src/uts/i86pc/io/pcplusmp/apic_introp.c
diffstat 2 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/io/pci/pci_common.c	Fri Sep 25 12:47:06 2009 +0800
+++ b/usr/src/uts/i86pc/io/pci/pci_common.c	Fri Sep 25 13:18:26 2009 +0800
@@ -381,9 +381,24 @@
 			if (hdlp->ih_type == DDI_INTR_TYPE_MSIX) {
 				if (!(msix_p = i_ddi_get_msix(hdlp->ih_dip))) {
 					msix_p = pci_msix_init(hdlp->ih_dip);
-					if (msix_p)
+					if (msix_p) {
 						i_ddi_set_msix(hdlp->ih_dip,
 						    msix_p);
+					} else {
+						DDI_INTR_NEXDBG((CE_CONT,
+						    "pci_common_intr_ops: MSI-X"
+						    "table initilization failed"
+						    ", rdip 0x%p inum 0x%x\n",
+						    (void *)rdip,
+						    hdlp->ih_inum));
+
+						(void) (*psm_intr_ops)(rdip,
+						    hdlp,
+						    PSM_INTR_OP_FREE_VECTORS,
+						    NULL);
+
+						return (DDI_FAILURE);
+					}
 				}
 			}
 
--- a/usr/src/uts/i86pc/io/pcplusmp/apic_introp.c	Fri Sep 25 12:47:06 2009 +0800
+++ b/usr/src/uts/i86pc/io/pcplusmp/apic_introp.c	Fri Sep 25 13:18:26 2009 +0800
@@ -152,6 +152,8 @@
 		uintptr_t	off;
 		ddi_intr_msix_t	*msix_p = i_ddi_get_msix(dip);
 
+		ASSERT(msix_p != NULL);
+
 		/* Offset into the "inum"th entry in the MSI-X table */
 		off = (uintptr_t)msix_p->msix_tbl_addr +
 		    (inum  * PCI_MSIX_VECTOR_SIZE);
@@ -516,6 +518,8 @@
 		uint32_t	mask;
 		ddi_intr_msix_t	*msix_p = i_ddi_get_msix(rdip);
 
+		ASSERT(msix_p != NULL);
+
 		/* Offset into "inum"th entry in the MSI-X table & mask it */
 		off = (uintptr_t)msix_p->msix_tbl_addr + (inum *
 		    PCI_MSIX_VECTOR_SIZE) + PCI_MSIX_VECTOR_CTRL_OFFSET;
@@ -564,6 +568,8 @@
 
 		msix_p = i_ddi_get_msix(rdip);
 
+		ASSERT(msix_p != NULL);
+
 		/* Offset into "inum"th entry in the MSI-X table & clear mask */
 		off = (uintptr_t)msix_p->msix_tbl_addr + (inum *
 		    PCI_MSIX_VECTOR_SIZE) + PCI_MSIX_VECTOR_CTRL_OFFSET;