summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Butler <jesse.butler@oracle.com>2010-07-28 12:51:51 -0600
committerJesse Butler <jesse.butler@oracle.com>2010-07-28 12:51:51 -0600
commit6c87a171a391b9e1c12d8fb7f74466f7e6e637af (patch)
treea1da8a863dba6f617882ae2635014bf311516f12
parented385ad99ff0b80b8baeaeabe87ccbe036a89339 (diff)
downloadillumos-gate-6c87a171a391b9e1c12d8fb7f74466f7e6e637af.tar.gz
6968895 only one path seen on JBOD after SAS cable pull/reinsert
6971809 target failing to reenumerate after being moved from one PHY to another
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c17
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c8
2 files changed, 12 insertions, 13 deletions
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c
index 75053888d2..a88a378b35 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c
@@ -479,10 +479,8 @@ pmcs_scsa_tran_tgt_free(dev_info_t *hba_dip, dev_info_t *tgt_dip,
target->target_num);
pwp->targets[target->target_num] = NULL;
target->target_num = PMCS_INVALID_TARGET_NUM;
- /*
- * If the target still has a PHY pointer, break the linkage
- */
- if (phyp) {
+ /* If the PHY has a pointer to this target, clear it */
+ if (phyp && (phyp->target == target)) {
phyp->target = NULL;
}
target->phy = NULL;
@@ -1427,7 +1425,8 @@ pmcs_smp_free(dev_info_t *self, dev_info_t *child,
(void *)tgt, tgt->target_num);
pwp->targets[tgt->target_num] = NULL;
tgt->target_num = PMCS_INVALID_TARGET_NUM;
- if (phyp) {
+ /* If the PHY has a pointer to this target, clear it */
+ if (phyp && (phyp->target == tgt)) {
phyp->target = NULL;
}
tgt->phy = NULL;
@@ -3195,6 +3194,14 @@ pmcs_get_target(pmcs_iport_t *iport, char *tgt_port, boolean_t alloc_tgt)
}
}
+ /*
+ * Set this target pointer back up, since it's been
+ * through pmcs_clear_xp().
+ */
+ tgt->dev_gone = 0;
+ tgt->assigned = 1;
+ tgt->dtype = phyp->dtype;
+ tgt->dev_state = PMCS_DEVICE_STATE_OPERATIONAL;
tgt->phy = phyp;
phyp->target = tgt;
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
index c8ff35abe7..c384a0010b 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c
@@ -6820,14 +6820,6 @@ pmcs_clear_xp(pmcs_hw_t *pwp, pmcs_xscsi_t *xp)
pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, xp, "%s: Device 0x%p is gone.",
__func__, (void *)xp);
- /*
- * Clear the dip now. This keeps pmcs_remove_device from attempting
- * to call us on the same device while we're still flushing queues.
- * The only side effect is we can no longer update SM-HBA properties,
- * but this device is going away anyway, so no matter.
- */
- xp->dip = NULL;
- xp->smpd = NULL;
xp->special_running = 0;
xp->recovering = 0;
xp->recover_wait = 0;