From: Bernd Schubert <bs@q-leap.de>
To: Linux SCSI Mailing List <linux-scsi@vger.kernel.org>
Cc: Eric Moore <Eric.Moore@lsi.com>, Sathya Prakash <Sathya.Prakash@lsi.com>
Subject: [PATCH 5/5] fusion disable scsi hard resets
Date: Fri, 12 Sep 2008 21:03:20 +0200 [thread overview]
Message-ID: <200809122103.20995.bs@q-leap.de> (raw)
In-Reply-To: <200809122057.41565.bs@q-leap.de>
For 53C1030 based dual port HBAs the hard reset handler will still cause
trouble on the second channel with innocent devices. It is then better
to fail the device which activated the error handler than to fail
entirely innocent devices. Real solutions would be of course to figure out
why the hard reset handler cause trouble on the second channel. Probably
only LSI can do, though. Is it o.k. to do this for all mpt fusion based HBAs,
thus, are all of these 53C1030 based?
Signed-off-by: Bernd Schubert <bs@q-leap.de>
drivers/message/fusion/mptscsih.c | 45 ++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
Index: linux-2.6.26/drivers/message/fusion/mptscsih.c
===================================================================
--- linux-2.6.26.orig/drivers/message/fusion/mptscsih.c
+++ linux-2.6.26/drivers/message/fusion/mptscsih.c
@@ -1890,6 +1890,33 @@ mptscsih_bus_reset(struct scsi_cmnd * SC
return FAILED;
}
+/**
+ * Check if there are devices connected to the second (alt) ioc.
+ * Return 1 if there is at least on device and 0 if there are
+ * none or no alt_ioc.
+ */
+static int
+alt_ioc_with_dev(MPT_ADAPTER *ioc)
+{
+ struct Scsi_Host *shost;
+ struct scsi_device *sdev;
+ int have_devices = 0;
+
+ if (!ioc->alt_ioc)
+ return 0;
+
+ shost = ioc->alt_ioc->sh;
+
+ shost_for_each_device(sdev, shost) {
+ /* when we are here, we know there is is a device
+ * attached to this host, which is all we need to know */
+ have_devices = 1;
+ break;
+ }
+
+ return have_devices ? 1 : 0;
+}
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/**
* mptscsih_host_reset - Perform a SCSI host adapter RESET (new_eh variant)
@@ -1922,8 +1949,22 @@ mptscsih_host_reset(struct scsi_cmnd *SC
* status. The host will be taken off line by the SCSI mid-layer.
*/
retval = mpt_SoftResetHandler(ioc, CAN_SLEEP);
- if (retval != 0)
- retval = mpt_HardResetHandler(ioc, CAN_SLEEP);
+ if (retval != 0) {
+ if (alt_ioc_with_dev(ioc) == 0) {
+ /* On dual port HBAs based on the 53C1030 chip the
+ * hard reset handler will cause DID_SOFT_ERROR on
+ * the second (in principle independent) port.
+ * Almost always this error cannot be recovered
+ * causing entire device failures. So it better not
+ * to call the hard reset handler at all in order to
+ * prevent failures of independent devices */
+ retval = mpt_HardResetHandler(ioc, CAN_SLEEP);
+ } else {
+ printk(MYIOC_s_INFO_FMT "Skipping hard reset in "
+ "order to prevent failures on %s.\n",
+ ioc->name, ioc->alt_ioc->name);
+ }
+ }
if (retval < 0)
status = FAILED;
next prev parent reply other threads:[~2008-09-12 19:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 18:57 [PATCH 0/5] mpt fusion error handler patches Bernd Schubert
2008-09-12 18:59 ` [PATCH 1/5] scsi abort Bernd Schubert
2008-09-12 19:00 ` [PATCH 2/5] fusion reset handler Bernd Schubert
2008-09-12 19:01 ` [PATCH 3/5] fusion remove the TMHandler Bernd Schubert
2008-09-12 19:02 ` [PATCH 4/5] fusion prevent DV deadlock Bernd Schubert
2008-09-13 12:24 ` Bernd Schubert
2008-09-12 19:03 ` Bernd Schubert [this message]
2008-09-13 4:32 ` [PATCH 0/5] mpt fusion error handler patches Mr. James W. Laferriere
2008-09-13 12:25 ` Bernd Schubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809122103.20995.bs@q-leap.de \
--to=bs@q-leap.de \
--cc=Eric.Moore@lsi.com \
--cc=Sathya.Prakash@lsi.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox