summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorDavid Hollister <David.Hollister@Sun.COM>2010-04-01 14:47:44 -0600
committerDavid Hollister <David.Hollister@Sun.COM>2010-04-01 14:47:44 -0600
commit658280b6253b61dbb155f43d0e3cbcffa85ccb90 (patch)
treede8798bb392dc9f55705e6564c5f0db5fbbdcad4 /usr/src
parent9187c2101b23b1f0d2882bf3cc09f20b0b6badaf (diff)
downloadillumos-joyent-658280b6253b61dbb155f43d0e3cbcffa85ccb90.tar.gz
6916341 FW87_ND: panic pmcs:pmcs_validate_vpd+33a
6935831 sorting work structures by serial number would be nice 6936826 pmcs: add "receptacle-label" and "receptacle-pm" properties to HBA node for FMA 6936827 pmcs: add "target-port-depth" property to represent depth of device in fabric 6938625 Intermittent retryable OPEN REJECT timeouts Thebe / RW2 / Muskie 2T
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/mdb/common/modules/pmcs/pmcs.c126
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_attach.c34
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_ds.c30
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_nvram.c21
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_scsa.c20
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_smhba.c13
-rw-r--r--usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_subr.c22
-rw-r--r--usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs.h14
-rw-r--r--usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_def.h18
-rw-r--r--usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_reg.h17
-rw-r--r--usr/src/uts/common/sys/scsi/impl/scsi_sas.h12
-rw-r--r--usr/src/uts/common/sys/scsi/impl/transport.h5
12 files changed, 263 insertions, 69 deletions
diff --git a/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c b/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c
index 268919d26f..53c7636509 100644
--- a/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c
+++ b/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <limits.h>
@@ -47,6 +46,16 @@ typedef struct per_iport_setting {
uint_t pis_dtc_info; /* -d: device tree children: dev_info/path_info */
} per_iport_setting_t;
+/*
+ * This structure is used for sorting work structures by the wserno
+ */
+typedef struct wserno_list {
+ int serno;
+ int idx;
+ struct wserno_list *next;
+ struct wserno_list *prev;
+} wserno_list_t;
+
#define MDB_RD(a, b, c) mdb_vread(a, b, (uintptr_t)c)
#define NOREAD(a, b) mdb_warn("could not read " #a " at 0x%p", b)
@@ -540,6 +549,7 @@ display_hwinfo(struct pmcs_hw m, int verbose)
mdb_printf("Maximum commands: %d\n", m.max_cmd);
mdb_printf("Maximum devices: %d\n", m.max_dev);
mdb_printf("I/O queue depth: %d\n", m.ioq_depth);
+ mdb_printf("Open retry intvl: %d usecs\n", m.open_retry_interval);
if (m.fwlog == 0) {
mdb_printf("Firmware logging: Disabled\n");
} else {
@@ -777,25 +787,112 @@ display_one_work(pmcwork_t *wp, int verbose, int idx)
}
static void
-display_work(struct pmcs_hw m, int verbose)
+display_work(struct pmcs_hw m, int verbose, int wserno)
{
int idx;
boolean_t header_printed = B_FALSE;
- pmcwork_t work, *wp = &work;
+ pmcwork_t *wp;
+ wserno_list_t *sernop, *sp, *newsp, *sphead = NULL;
uintptr_t _wp;
+ int serno;
+
+ wp = mdb_alloc(sizeof (pmcwork_t) * m.max_cmd, UM_SLEEP);
+ _wp = (uintptr_t)m.work;
+ sernop = mdb_alloc(sizeof (wserno_list_t) * m.max_cmd, UM_SLEEP);
+ bzero(sernop, sizeof (wserno_list_t) * m.max_cmd);
mdb_printf("\nActive Work structure information:\n");
mdb_printf("----------------------------------\n");
- _wp = (uintptr_t)m.work;
-
+ /*
+ * Read in all the work structures
+ */
for (idx = 0; idx < m.max_cmd; idx++, _wp += sizeof (pmcwork_t)) {
- if (MDB_RD(&work, sizeof (pmcwork_t), _wp) == -1) {
+ if (MDB_RD(wp + idx, sizeof (pmcwork_t), _wp) == -1) {
NOREAD(pmcwork_t, _wp);
continue;
}
+ }
+
+ /*
+ * Sort by serial number?
+ */
+ if (wserno) {
+ for (idx = 0; idx < m.max_cmd; idx++) {
+ if ((wp + idx)->htag == 0) {
+ serno = PMCS_TAG_SERNO((wp + idx)->last_htag);
+ } else {
+ serno = PMCS_TAG_SERNO((wp + idx)->htag);
+ }
+
+ /* Start at the beginning of the list */
+ sp = sphead;
+ newsp = sernop + idx;
+ /* If this is the first entry, just add it */
+ if (sphead == NULL) {
+ sphead = sernop;
+ sphead->serno = serno;
+ sphead->idx = idx;
+ sphead->next = NULL;
+ sphead->prev = NULL;
+ continue;
+ }
- if (!verbose && (wp->htag == PMCS_TAG_TYPE_FREE)) {
+ newsp->serno = serno;
+ newsp->idx = idx;
+
+ /* Find out where in the list this goes */
+ while (sp) {
+ /* This item goes before sp */
+ if (serno < sp->serno) {
+ newsp->next = sp;
+ newsp->prev = sp->prev;
+ if (newsp->prev == NULL) {
+ sphead = newsp;
+ } else {
+ newsp->prev->next = newsp;
+ }
+ sp->prev = newsp;
+ break;
+ }
+
+ /*
+ * If sp->next is NULL, this entry goes at the
+ * end of the list
+ */
+ if (sp->next == NULL) {
+ sp->next = newsp;
+ newsp->next = NULL;
+ newsp->prev = sp;
+ break;
+ }
+
+ sp = sp->next;
+ }
+ }
+
+ /*
+ * Now print the sorted list
+ */
+ mdb_printf(" Idx %8s %10s %20s %8s %8s O D ",
+ "HTag", "State", "Phy Path", "Target", "Timer");
+ mdb_printf("%8s %10s %18s %18s %18s\n", "LastHTAG",
+ "LastState", "LastPHY", "LastTgt", "LastArg");
+
+ sp = sphead;
+ while (sp) {
+ display_one_work(wp + sp->idx, 1, sp->idx);
+ sp = sp->next;
+ }
+
+ goto out;
+ }
+
+ /*
+ * Now print the list, sorted by index
+ */
+ for (idx = 0; idx < m.max_cmd; idx++) {
+ if (!verbose && ((wp + idx)->htag == PMCS_TAG_TYPE_FREE)) {
continue;
}
@@ -815,8 +912,12 @@ display_work(struct pmcs_hw m, int verbose)
header_printed = B_TRUE;
}
- display_one_work(wp, verbose, idx);
+ display_one_work(wp + idx, verbose, idx);
}
+
+out:
+ mdb_free(wp, sizeof (pmcwork_t) * m.max_cmd);
+ mdb_free(sernop, sizeof (wserno_list_t) * m.max_cmd);
}
static void
@@ -2579,6 +2680,7 @@ pmcs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
uint_t unconfigured = FALSE;
uint_t damap_info = FALSE;
uint_t dtc_info = FALSE;
+ uint_t wserno = FALSE;
int rv = DCMD_OK;
void *pmcs_state;
char *state_str;
@@ -2609,6 +2711,7 @@ pmcs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
'p', MDB_OPT_SETBITS, TRUE, &phy_info,
'q', MDB_OPT_SETBITS, TRUE, &ibq,
'Q', MDB_OPT_SETBITS, TRUE, &obq,
+ 's', MDB_OPT_SETBITS, TRUE, &wserno,
't', MDB_OPT_SETBITS, TRUE, &target_info,
'T', MDB_OPT_SETBITS, TRUE, &tgt_phy_count,
'u', MDB_OPT_SETBITS, TRUE, &unconfigured,
@@ -2691,8 +2794,8 @@ pmcs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
if (target_info || tgt_phy_count)
display_targets(ss, verbose, tgt_phy_count);
- if (work_info)
- display_work(ss, verbose);
+ if (work_info || wserno)
+ display_work(ss, verbose, wserno);
if (ic_info)
display_ic(ss, verbose);
@@ -2730,6 +2833,7 @@ pmcs_help()
" -p: Print information about each attached PHY\n"
" -q: Dump inbound queues\n"
" -Q: Dump outbound queues\n"
+ " -s: Dump all work structures sorted by serial number\n"
" -t: Print information about each configured target\n"
" -T: Print target and PHY count summary\n"
" -u: Show SAS address of all unconfigured targets\n"
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_attach.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_attach.c
index 08d4e892db..da7574ff1d 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_attach.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_attach.c
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/scsi/adapters/pmcs/pmcs.h>
@@ -546,6 +545,13 @@ pmcs_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
pwp->fwlogfile_iop[0] = '\0';
}
+ pwp->open_retry_interval = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
+ DDI_PROP_DONTPASS | DDI_PROP_NOTPROM, "pmcs-open-retry-interval",
+ OPEN_RETRY_INTERVAL_DEF);
+ if (pwp->open_retry_interval > OPEN_RETRY_INTERVAL_MAX) {
+ pwp->open_retry_interval = OPEN_RETRY_INTERVAL_MAX;
+ }
+
mutex_enter(&pmcs_trace_lock);
if (pmcs_tbuf == NULL) {
/* Allocate trace buffer */
@@ -1098,6 +1104,26 @@ pmcs_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
pmcs_smhba_add_hba_prop(pwp, DATA_TYPE_INT32, PMCS_SUPPORTED_PROTOCOL,
&protocol);
+ /* Receptacle properties (FMA) */
+ pwp->recept_labels[0] = PMCS_RECEPT_LABEL_0;
+ pwp->recept_pm[0] = PMCS_RECEPT_PM_0;
+ pwp->recept_labels[1] = PMCS_RECEPT_LABEL_1;
+ pwp->recept_pm[1] = PMCS_RECEPT_PM_1;
+ if (ddi_prop_update_string_array(DDI_DEV_T_NONE, dip,
+ SCSI_HBA_PROP_RECEPTACLE_LABEL, &pwp->recept_labels[0],
+ PMCS_NUM_RECEPTACLES) != DDI_PROP_SUCCESS) {
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
+ "%s: failed to create %s property", __func__,
+ "receptacle-label");
+ }
+ if (ddi_prop_update_int_array(DDI_DEV_T_NONE, dip,
+ SCSI_HBA_PROP_RECEPTACLE_PM, &pwp->recept_pm[0],
+ PMCS_NUM_RECEPTACLES) != DDI_PROP_SUCCESS) {
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
+ "%s: failed to create %s property", __func__,
+ "receptacle-pm");
+ }
+
return (DDI_SUCCESS);
failure:
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_ds.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_ds.c
index 51ac232757..9df8a9f6ad 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_ds.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_ds.c
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -609,6 +608,7 @@ pmcs_start_ssp_event_recovery(pmcs_hw_t *pwp, pmcwork_t *pwrk, uint32_t *iomb,
pmcs_xscsi_t *tgt = pwrk->xp;
uint32_t event = LE_32(iomb[2]);
pmcs_phy_t *pptr = pwrk->phy;
+ pmcs_cb_t callback;
uint32_t tag;
if (tgt != NULL) {
@@ -682,7 +682,7 @@ pmcs_start_ssp_event_recovery(pmcs_hw_t *pwp, pmcwork_t *pwrk, uint32_t *iomb,
mutex_exit(&tgt->statlock);
}
pmcs_unlock_phy(pptr);
- mutex_exit(&pwrk->lock);
+ mutex_exit(&pwrk->lock); /* XXX: Is this right??? */
return;
}
@@ -695,6 +695,25 @@ pmcs_start_ssp_event_recovery(pmcs_hw_t *pwp, pmcwork_t *pwrk, uint32_t *iomb,
}
/*
+ * If the SSP event was an OPEN_RETRY_TIMEOUT, we don't want
+ * to go through the recovery (abort/LU reset) process.
+ * Simply complete the command and return it as STATUS_BUSY.
+ * This will cause the target driver to simply retry.
+ */
+ if (event == PMCOUT_STATUS_IO_XFER_OPEN_RETRY_TIMEOUT) {
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, pptr, tgt,
+ "%s: Got OPEN_RETRY_TIMEOUT event (htag 0x%08x)",
+ __func__, pwrk->htag);
+
+ mutex_exit(&tgt->statlock);
+ pmcs_unlock_phy(pptr);
+ pwrk->ssp_event = event;
+ callback = (pmcs_cb_t)pwrk->ptr;
+ (*callback)(pwp, pwrk, iomb);
+ return;
+ }
+
+ /*
* To recover from primary failures,
* we need to schedule handling events recovery.
*/
@@ -740,6 +759,7 @@ pmcs_tgt_event_recovery(pmcs_hw_t *pwp, pmcwork_t *pwrk)
htag = pwrk->htag;
event = pwrk->ssp_event;
pwrk->ssp_event = 0xffffffff;
+
if (event == PMCOUT_STATUS_XFER_ERR_BREAK ||
event == PMCOUT_STATUS_XFER_ERR_PHY_NOT_READY ||
event == PMCOUT_STATUS_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT) {
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_nvram.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_nvram.c
index 7277a8c5a0..c6b9a40dfb 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_nvram.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_nvram.c
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -453,14 +452,7 @@ pmcs_validate_vpd(pmcs_hw_t *pwp, uint8_t *data)
if (vpd_header->eeprom_version < PMCS_VPD_VERSION) {
pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
- "%s: VPD version(%d) out-of-date; (%d) required."
- " Thebe card needs to be flashed.",
- __func__, vpd_header->eeprom_version, PMCS_VPD_VERSION);
- }
- if ((vpd_header->eeprom_version != PMCS_VPD_VERSION) &&
- (vpd_header->eeprom_version != (PMCS_VPD_VERSION - 1))) {
- pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
- "%s: VPD version mismatch (%d != %d)",
+ "%s: VPD version(%d) unsupported; requires version %d.",
__func__, vpd_header->eeprom_version, PMCS_VPD_VERSION);
return (B_FALSE);
}
@@ -506,8 +498,9 @@ pmcs_validate_vpd(pmcs_hw_t *pwp, uint8_t *data)
}
ASSERT (*chksump == PMCS_VPD_END);
if (chksum) {
- pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL, "%s: VPD checksum(%d)"
- " non-zero. Checksum validation failed.", __func__, chksum);
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
+ "%s: VPD checksum failure", __func__);
+ return (B_FALSE);
}
/*
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 53ca13b670..8f536bd99f 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
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* SCSI (SCSA) midlayer interface for PMC drier.
@@ -64,7 +63,7 @@ static void pmcs_SATA_done(pmcs_hw_t *, pmcwork_t *, uint32_t *);
static uint8_t pmcs_SATA_rwparm(uint8_t *, uint32_t *, uint64_t *, uint64_t);
static void pmcs_ioerror(pmcs_hw_t *, pmcs_dtype_t pmcs_dtype,
- pmcwork_t *, uint32_t *);
+ pmcwork_t *, uint32_t *, uint32_t);
int
@@ -2053,7 +2052,7 @@ pmcs_SAS_done(pmcs_hw_t *pwp, pmcwork_t *pwrk, uint32_t *msg)
}
if (sts != PMCOUT_STATUS_OK) {
- pmcs_ioerror(pwp, SAS, pwrk, msg);
+ pmcs_ioerror(pwp, SAS, pwrk, msg, sts);
} else {
if (msg[3]) {
uint8_t local[PMCS_QENTRY_SIZE << 1], *xd;
@@ -2641,7 +2640,7 @@ pmcs_SATA_done(pmcs_hw_t *pwp, pmcwork_t *pwrk, uint32_t *msg)
pmcs_unlock_phy(pptr);
mutex_enter(&pwrk->lock);
}
- pmcs_ioerror(pwp, SATA, pwrk, msg);
+ pmcs_ioerror(pwp, SATA, pwrk, msg, sts);
} else {
pmcs_latch_status(pwp, sp, STATUS_GOOD, NULL, 0,
pwrk->phy->path);
@@ -2827,7 +2826,8 @@ pmcs_SATA_rwparm(uint8_t *cdb, uint32_t *xfr, uint64_t *lba, uint64_t lbamax)
* Called with pwrk lock held.
*/
static void
-pmcs_ioerror(pmcs_hw_t *pwp, pmcs_dtype_t t, pmcwork_t *pwrk, uint32_t *w)
+pmcs_ioerror(pmcs_hw_t *pwp, pmcs_dtype_t t, pmcwork_t *pwrk, uint32_t *w,
+ uint32_t status)
{
static uint8_t por[] = {
0xf0, 0x0, 0x6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x28
@@ -2840,11 +2840,9 @@ pmcs_ioerror(pmcs_hw_t *pwp, pmcs_dtype_t t, pmcwork_t *pwrk, uint32_t *w)
pmcs_cmd_t *sp = pwrk->arg;
pmcs_phy_t *phyp = pwrk->phy;
struct scsi_pkt *pkt = CMD2PKT(sp);
- uint32_t status;
uint32_t resid;
ASSERT(w != NULL);
- status = LE_32(w[2]);
resid = LE_32(w[3]);
msg = pmcs_status_str(status);
@@ -2973,6 +2971,8 @@ pmcs_ioerror(pmcs_hw_t *pwp, pmcs_dtype_t t, pmcwork_t *pwrk, uint32_t *w)
break;
case PMCOUT_STATUS_IO_XFER_OPEN_RETRY_TIMEOUT:
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, phyp, phyp->target,
+ "STATUS_BUSY for htag 0x%08x", sp->cmd_tag);
pmcs_latch_status(pwp, sp, STATUS_BUSY, NULL, 0, phyp->path);
break;
diff --git a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_smhba.c b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_smhba.c
index 44c8a68aa9..77a86c8a50 100644
--- a/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_smhba.c
+++ b/usr/src/uts/common/io/scsi/adapters/pmcs/pmcs_smhba.c
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* This file contains SM-HBA support for PMC-S driver
@@ -150,6 +149,12 @@ pmcs_smhba_set_scsi_device_props(pmcs_hw_t *pwp, pmcs_phy_t *pptr,
}
kmem_free(addr, PMCS_MAX_UA_SIZE);
}
+
+ if (pptr->dtype != EXPANDER) {
+ (void) scsi_device_prop_update_int(sd,
+ SCSI_DEVICE_PROP_PATH, SCSI_ADDR_PROP_TARGET_PORT_DEPTH,
+ pptr->level);
+ }
}
void
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 20f47d1160..eec8e78573 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
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -401,6 +400,21 @@ pmcs_setup(pmcs_hw_t *pwp)
}
/*
+ * If the open retry interval is non-zero, set it.
+ */
+ if (pwp->open_retry_interval != 0) {
+ int phynum;
+
+ pmcs_prt(pwp, PMCS_PRT_DEBUG, NULL, NULL,
+ "%s: Setting open retry interval to %d usecs", __func__,
+ pwp->open_retry_interval);
+ for (phynum = 0; phynum < pwp->nphy; phynum ++) {
+ pmcs_wr_gsm_reg(pwp, OPEN_RETRY_INTERVAL(phynum),
+ pwp->open_retry_interval);
+ }
+ }
+
+ /*
* Enable Interrupt Reassertion
* Default Delay 1000us
*/
diff --git a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs.h b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs.h
index db257cf6d9..0061a3445c 100644
--- a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs.h
+++ b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs.h
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* This file is the principle header file for the PMCS driver
@@ -674,6 +673,7 @@ struct pmcs_hw {
uint16_t debug_mask;
uint16_t phyid_block_mask;
uint16_t phys_started;
+ uint16_t open_retry_interval;
uint32_t hipri_queue;
uint32_t mpibar;
uint32_t intr_pri;
@@ -684,6 +684,12 @@ struct pmcs_hw {
kcondvar_t ict_cv;
kthread_t *ict_thread;
+ /*
+ * Receptacle information - FMA
+ */
+ char *recept_labels[PMCS_NUM_RECEPTACLES];
+ int recept_pm[PMCS_NUM_RECEPTACLES];
+
#ifdef DEBUG
kmutex_t dbglock;
uint32_t ltags[256];
diff --git a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_def.h b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_def.h
index 2f53f8d485..56a1daa4f8 100644
--- a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_def.h
+++ b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_def.h
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _PMCS_DEF_H
#define _PMCS_DEF_H
@@ -559,6 +558,17 @@ typedef struct pmcs_fw_event_hdr_s {
uint32_t fw_el_entry_size;
} pmcs_fw_event_hdr_t;
+/*
+ * Receptacle information
+ */
+#define PMCS_NUM_RECEPTACLES 2
+
+#define PMCS_RECEPT_LABEL_0 "SAS0"
+#define PMCS_RECEPT_LABEL_1 "SAS1"
+
+#define PMCS_RECEPT_PM_0 0xf0
+#define PMCS_RECEPT_PM_1 0xf
+
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_reg.h b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_reg.h
index fefc1be9e4..800fbd81cd 100644
--- a/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_reg.h
+++ b/usr/src/uts/common/sys/scsi/adapters/pmcs/pmcs_reg.h
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- *
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* PMC 8x6G register definitions
@@ -352,6 +351,16 @@ extern "C" {
#define PMCS_GPIO_TSMODE_BIT0 (1 << 0)
#define PMCS_GPIO_TSMODE_BIT1 (1 << 1)
+/*
+ * SAS/SATA PHY Layer Registers
+ * These are in MEMBASE-III (i.e. in GSM space)
+ */
+#define OPEN_RETRY_INTERVAL(phy) \
+ (phy < 4) ? (0x330B4 + (0x4000 * (phy))) : \
+ (0x430B4 + (0x4000 * (phy - 4)))
+
+#define OPEN_RETRY_INTERVAL_DEF 20
+#define OPEN_RETRY_INTERVAL_MAX 0x7FFF
/*
* Register Access Inline Functions
diff --git a/usr/src/uts/common/sys/scsi/impl/scsi_sas.h b/usr/src/uts/common/sys/scsi/impl/scsi_sas.h
index fd06df55ae..53e0f79ba8 100644
--- a/usr/src/uts/common/sys/scsi/impl/scsi_sas.h
+++ b/usr/src/uts/common/sys/scsi/impl/scsi_sas.h
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _SYS_SCSI_IMPL_SCSI_SAS_H
@@ -193,10 +192,17 @@ typedef struct sas_phy_stats {
/*
- * Phy-mask property names for the target port and attached port
+ * Phy-mask property names for the target port, attached port and receptacle
*/
#define SCSI_ADDR_PROP_TARGET_PORT_PM "target-port-pm"
#define SCSI_ADDR_PROP_ATTACHED_PORT_PM "attached-port-pm"
+#define SCSI_HBA_PROP_RECEPTACLE_PM "receptacle-pm"
+
+/*
+ * Target port depth property names - Indicates the number of expanders
+ * between the initiator port and the target port
+ */
+#define SCSI_ADDR_PROP_TARGET_PORT_DEPTH "target-port-depth"
/*
diff --git a/usr/src/uts/common/sys/scsi/impl/transport.h b/usr/src/uts/common/sys/scsi/impl/transport.h
index 7389409f5c..90d0509891 100644
--- a/usr/src/uts/common/sys/scsi/impl/transport.h
+++ b/usr/src/uts/common/sys/scsi/impl/transport.h
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _SYS_SCSI_IMPL_TRANSPORT_H
@@ -680,6 +679,8 @@ void scsi_hba_tgtmap_destroy(scsi_hba_tgtmap_t *tgt_map);
#define INST2SCSI(x) (((x) << INST_MINOR_SHIFT) | SCSI_MINOR)
#define MINOR2INST(x) ((x) >> INST_MINOR_SHIFT)
+#define SCSI_HBA_PROP_RECEPTACLE_LABEL "receptacle-label"
+
#endif /* _KERNEL */
#ifdef __cplusplus