changeset 13704:b0c0d877d231

2777 mpt_sas needs to try MUR reset at attach() time. Reviewed by: Richard Elling <richard.elling@gmail.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Gordon Ross <Gordon.Ross@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Garrett D'Amore <garrett@damore.org>
author Dan McDonald <danmcd@nexenta.com>
date Tue, 29 May 2012 10:57:43 -0400
parents 3ca4cea305f1
children 70355eedf57a
files usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h
diffstat 3 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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,