2777 mpt_sas needs to try MUR reset at attach() time.
Reviewed by: Richard Elling <
[email protected]>
Reviewed by: Jason King <
[email protected]>
Reviewed by: Gordon Ross <
[email protected]>
Reviewed by: Josef 'Jeff' Sipek <
[email protected]>
Approved by: Garrett D'Amore <
[email protected]>
--- a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c Thu May 24 02:15:22 2012 +0100
+++ b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c Tue May 29 10:57:43 2012 -0400
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -1761,7 +1762,7 @@
MPTSAS_DISABLE_INTR(mpt);
mptsas_raid_action_system_shutdown(mpt);
mpt->m_softstate |= MPTSAS_SS_MSG_UNIT_RESET;
- (void) mptsas_ioc_reset(mpt);
+ (void) mptsas_ioc_reset(mpt, FALSE);
mutex_exit(&mpt->m_mutex);
mptsas_rem_intrs(mpt);
ddi_taskq_destroy(mpt->m_event_taskq);
@@ -12338,7 +12339,7 @@
/*
* Reset the chip
*/
- rval = mptsas_ioc_reset(mpt);
+ rval = mptsas_ioc_reset(mpt, first_time);
if (rval == MPTSAS_RESET_FAIL) {
mptsas_log(mpt, CE_WARN, "hard reset failed!");
goto fail;
--- a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c Thu May 24 02:15:22 2012 +0100
+++ b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c Tue May 29 10:57:43 2012 -0400
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -955,7 +956,7 @@
}
int
-mptsas_ioc_reset(mptsas_t *mpt)
+mptsas_ioc_reset(mptsas_t *mpt, int first_time)
{
int polls = 0;
uint32_t reset_msg;
@@ -973,8 +974,16 @@
* it a message unit reset to put it back in the ready state
*/
if (ioc_state & MPI2_IOC_STATE_OPERATIONAL) {
- if (mpt->m_event_replay && (mpt->m_softstate &
- MPTSAS_SS_MSG_UNIT_RESET)) {
+ /*
+ * If the first time, try MUR anyway, because we haven't even
+ * queried the card for m_event_replay and other capabilities.
+ * Other platforms do it this way, we can still do a hard
+ * reset if we need to, MUR takes less time than a full
+ * adapter reset, and there are reports that some HW
+ * combinations will lock up when receiving a hard reset.
+ */
+ if ((first_time || mpt->m_event_replay) &&
+ (mpt->m_softstate & MPTSAS_SS_MSG_UNIT_RESET)) {
mpt->m_softstate &= ~MPTSAS_SS_MSG_UNIT_RESET;
reset_msg = MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET;
ddi_put32(mpt->m_datap, &mpt->m_reg->Doorbell,
--- a/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h Thu May 24 02:15:22 2012 +0100
+++ b/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h Tue May 29 10:57:43 2012 -0400
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -1313,7 +1314,7 @@
*/
int mptsas_ioc_wait_for_response(mptsas_t *mpt);
int mptsas_ioc_wait_for_doorbell(mptsas_t *mpt);
-int mptsas_ioc_reset(mptsas_t *mpt);
+int mptsas_ioc_reset(mptsas_t *mpt, int);
int mptsas_send_handshake_msg(mptsas_t *mpt, caddr_t memp, int numbytes,
ddi_acc_handle_t accessp);
int mptsas_get_handshake_msg(mptsas_t *mpt, caddr_t memp, int numbytes,