public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Willem Riede <wrlk@riede.org>
To: linux-scsi@vger.kernel.org
Subject: Re: Scsi error handler strategy question - now with [PATCH]
Date: Sun, 18 Jan 2004 10:20:05 -0500	[thread overview]
Message-ID: <20040118152005.GO4339@linnie.riede.org> (raw)
In-Reply-To: <20040104232425.GM4339@linnie.riede.org> (from wrlk@riede.org on Sun, Jan 04, 2004 at 18:24:25 -0500)

On 2004.01.04 18:24, Willem Riede wrote:
> While testing the ide-scsi error handling, I observed that my ATAPI
> device gets offlined too easily.
> 
[snip]
> 
> Am I allowed to submit a patch that will also retry on that condition?

Below is the patch I developed to make the error recovery robust for
my OnStream DI-30 with osst and ide-scsi.

I realize that there may be objections to applying this to the main scsi
subsystem because the slowdown may be extreme for say a fiber connected
SAN with hundreds of disks, but it is absolutely necessary for my ATAPI
devices. So if you don't want to apply this, tell me, and I'll work it 
into a ide-scsi specific error strategy handler.

Thanks, Willem Riede.

--- linux-2.6.1-1.34/drivers/scsi/scsi_error.c	2004-01-09 01:59:03.000000000 -0500
+++ linux-2.6.1-test/drivers/scsi/scsi_error.c	2004-01-18 08:59:30.000000000 -0500
@@ -282,6 +282,11 @@
 			(scmd->sense_buffer[13] == 0x01)) {
 			return NEEDS_RETRY;
 		}
+		/* same for reset occurred and not ready to ready transition */
+		if (((scmd->sense_buffer[12] & ~1) == 0x28) &&
+			(scmd->sense_buffer[13] == 0x00)) {
+			return NEEDS_RETRY;
+		}
 		return SUCCESS;
 
 		/* these three are not supported */
@@ -713,9 +718,11 @@
 static int scsi_eh_tur(struct scsi_cmnd *scmd)
 {
 	static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0};
-	int retry_cnt = 1, rtn;
+	int retry_cnt = 32, rtn;
 
 retry_tur:
+	SCSI_LOG_ERROR_RECOVERY(3, printk("%s: send TUR, attempt %d\n",
+					  current->comm, 33-retry_cnt));
 	memcpy(scmd->cmnd, tur_command, sizeof(tur_command));
 
 	/*
@@ -747,8 +754,10 @@
 	if (rtn == SUCCESS)
 		return 0;
 	else if (rtn == NEEDS_RETRY)
-		if (retry_cnt--)
+		if (retry_cnt--) {
+			scsi_sleep(HZ);
 			goto retry_tur;
+		}
 	return 1;
 }
 

      parent reply	other threads:[~2004-01-18 15:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-04 23:24 Scsi error handler strategy question Willem Riede
2004-01-05  2:42 ` Andre Hedrick
2004-01-05  2:55   ` Willem Riede
2004-01-05  9:44 ` Kurt Garloff
2004-01-18 15:20 ` Willem Riede [this message]

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=20040118152005.GO4339@linnie.riede.org \
    --to=wrlk@riede.org \
    --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