public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Masao Fukuchi <fukuchi.masao@jp.fujitsu.com>
Cc: "Moore, Eric Dean" <emoore@lsil.com>,
	Hironobu Ishii <ishii.hironobu@jp.fujitsu.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	mpt_linux_developer@lsil.com
Subject: Re: PROBLEM: 2.6.0-test9: SCSI mid layer tells a lie.
Date: Wed, 3 Dec 2003 18:05:08 -0800	[thread overview]
Message-ID: <20031204020508.GB1775@beaverton.ibm.com> (raw)
In-Reply-To: <200312032348.AA02824@fukuchi.jp.fujitsu.com>

Masao Fukuchi [fukuchi.masao@jp.fujitsu.com] wrote:
> 
> I also tested with kernel 2.6.0-test11 + mpt fusion 2.05.00.05 driver,
> but the problem didn't solve.
> I think the problem is in the retry sequence of mid layer not mpt driver.
> At the last retry sequence, bus reset finished with success but mid layer
> didn't retry read command again and returned to application with success 
> status.
> 

In reviewing the error handler with Patrick it looks like there is a bug
in scsi_eh_flush_done_q when scmd->allowed has been exceeded and the
command error was a timeout.

The patch below may help, but I only have compile / boot tested it.
Could you test this on your error and see if it helps.

If it does not help. Turning on scsi logging for error recovery would
provide more info.

-andmike
--
Michael Anderson
andmike@us.ibm.com

DESC
This patch fixes a bug in scsi_eh_flush_done_q when the allowed count has
been exceeded and the command errored for a timeout. The bug is that the
result will be left at zero and the command finished.

Thu Dec  4 01:42:46 UTC 2003
EDESC


 drivers/scsi/scsi_error.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff -puN drivers/scsi/scsi_error.c~scsi_error_retry drivers/scsi/scsi_error.c
--- 2.6/drivers/scsi/scsi_error.c~scsi_error_retry	Wed Dec  3 16:36:35 2003
+++ 2.6-andmike/drivers/scsi/scsi_error.c	Wed Dec  3 16:43:02 2003
@@ -1421,23 +1421,20 @@ static void scsi_eh_flush_done_q(struct 
 	list_for_each_safe(lh, lh_sf, done_q) {
 		scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
 		list_del_init(lh);
-		if (!scmd->device->online) {
-			 scmd->result |= (DRIVER_TIMEOUT << 24);
-		} else {
-			if (++scmd->retries < scmd->allowed) {
-				SCSI_LOG_ERROR_RECOVERY(3,
-					printk("%s: flush retry"
-					       " cmd: %p\n",
-						  current->comm,
-						  scmd));
+		if (scmd->device->online && 
+		    	(++scmd->retries < scmd->allowed)) {
+			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
+							  " retry cmd: %p\n",
+							  current->comm,
+							  scmd));
 				scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
-				continue;
-			}
+		} else {
+			scmd->result |= (DRIVER_TIMEOUT << 24);
+			SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
+							" cmd: %p\n",
+							current->comm, scmd));
+			scsi_finish_command(scmd);
 		}
-		SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
-				       " cmd: %p\n",
-					  current->comm, scmd));
-		scsi_finish_command(scmd);
 	}
 }
 

_

  reply	other threads:[~2003-12-04  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03 16:15 PROBLEM: 2.6.0-test9: SCSI mid layer tells a lie Moore, Eric Dean
2003-12-03 23:48 ` Masao Fukuchi
2003-12-04  2:05   ` Mike Anderson [this message]
2003-12-04 14:58     ` Hironobu Ishii
2003-12-04 20:21       ` Mike Anderson
  -- strict thread matches above, loose matches on Subject: below --
2003-12-03  6:43 Hironobu Ishii
2003-12-03  7:51 ` Hironobu Ishii

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=20031204020508.GB1775@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=emoore@lsil.com \
    --cc=fukuchi.masao@jp.fujitsu.com \
    --cc=ishii.hironobu@jp.fujitsu.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mpt_linux_developer@lsil.com \
    /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