diff usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c @ 11556:99144956c627

6913819 SCSAv3: pmcs_scsa_tran_tgt_free: alignment error panic 6885919 scsav3:LCC Hot Plug causes assertion panic in file: ../../common/io/scsi/impl/scsi_hba.c, line: 4776 6917786 NULL softstate will be used in pmcs_scsa_tran_tgt_init in some cases
author Reed <Reed.Liu@Sun.COM>
date Tue, 19 Jan 2010 15:51:33 -0700
parents 77c085f864d5
children 1ff4cad6d0b8
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	Tue Jan 19 14:59:18 2010 -0800
+++ b/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c	Tue Jan 19 15:51:33 2010 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -4053,6 +4053,7 @@
 	 * call hba's target init entry point if it exists
 	 */
 	if (hba->tran_tgt_init != NULL) {
+		psd->sd_tran_tgt_free_done = 0;
 		if ((rval = (*hba->tran_tgt_init)(pdip, tgt_dip,
 		    hba, psd)) != DDI_SUCCESS) {
 			VHCI_DEBUG(1, (CE_WARN, pdip,
@@ -4131,8 +4132,9 @@
 		ASSERT(hba->tran_sd == psd);
 	}
 
-	if (hba->tran_tgt_free != NULL) {
+	if ((hba->tran_tgt_free != NULL) && !psd->sd_tran_tgt_free_done) {
 		(*hba->tran_tgt_free) (pdip, cdip, hba, psd);
+		psd->sd_tran_tgt_free_done = 1;
 	}
 	mutex_destroy(&psd->sd_mutex);
 	if (hba->tran_hba_flags & SCSI_HBA_TRAN_CLONE) {