From: Mike Christie <michaelc@cs.wisc.edu>
To: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/5] convert st to use scsi_execte_async
Date: Sat, 17 Sep 2005 11:25:25 -0500 [thread overview]
Message-ID: <1126974325.10413.5.camel@max> (raw)
In-Reply-To: <432C3C75.5090405@cs.wisc.edu>
On Sat, 2005-09-17 at 10:55 -0500, Mike Christie wrote:
> Mike Christie wrote:
> > Kai Makisara wrote:
> >
> >>
> >> I think I may have found the problem: scsi_execute_async does not use
> >> the parameter retries (the same applies to scsi_execute btw). This
> >> leads to retrying the reads at filemark and this is not correct. I
> >> added the hack below to scsi_execute_async and after this the simple
> >> tests succeed.
> >
> >
> > ah ok. I think when we prep the command we need to copy the retries from
> > the command. So in st.c st_init_command callout we need to copy that
> > value (we are just copying the timeout today).
>
> oh I guess there is not retries count on the request like there is for
> timeout :)
>
> But it looks like retried is always 0. I guess st's init_command could
> just do
>
> SCpnt->allowed = 0;
Or how about this patch it was made against my updated patches here:
http://www.cs.wisc.edu/~michaelc/block/use-sg/v6/
It is the 06-add-retry-field.patch patch. All it does it add a retries
count onto the request so it can be passed around like the timeout
value.
diff -aurp scsi-rc-fixes.tmp/drivers/block/scsi_ioctl.c scsi-rc-fixes/drivers/block/scsi_ioctl.c
--- scsi-rc-fixes.tmp/drivers/block/scsi_ioctl.c 2005-09-17 11:16:42.000000000 -0500
+++ scsi-rc-fixes/drivers/block/scsi_ioctl.c 2005-09-17 11:05:22.000000000 -0500
@@ -302,6 +302,7 @@ static int sg_io(struct file *file, requ
rq->timeout = q->sg_timeout;
if (!rq->timeout)
rq->timeout = BLK_DEFAULT_TIMEOUT;
+ rq->retries = 1;
start_time = jiffies;
@@ -412,6 +413,7 @@ static int sg_scsi_ioctl(struct file *fi
rq->timeout = BLK_DEFAULT_TIMEOUT;
break;
}
+ rq->retries = 1;
memset(sense, 0, sizeof(sense));
rq->sense = sense;
@@ -570,6 +572,7 @@ int scsi_cmd_ioctl(struct file *file, st
rq->data = NULL;
rq->data_len = 0;
rq->timeout = BLK_DEFAULT_TIMEOUT;
+ rq->retries = 1;
memset(rq->cmd, 0, sizeof(rq->cmd));
rq->cmd[0] = GPCMD_START_STOP_UNIT;
rq->cmd[4] = 0x02 + (close != 0);
diff -aurp scsi-rc-fixes.tmp/drivers/scsi/scsi_lib.c scsi-rc-fixes/drivers/scsi/scsi_lib.c
--- scsi-rc-fixes.tmp/drivers/scsi/scsi_lib.c 2005-09-17 11:17:08.000000000 -0500
+++ scsi-rc-fixes/drivers/scsi/scsi_lib.c 2005-09-17 11:06:17.000000000 -0500
@@ -261,6 +261,7 @@ int scsi_execute(struct scsi_device *sde
memcpy(req->cmd, cmd, req->cmd_len);
req->sense = sense;
req->sense_len = 0;
+ req->retries = retries;
req->timeout = timeout;
req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET;
@@ -427,6 +428,7 @@ int scsi_execute_async(struct scsi_devic
req->sense = sioc->sense;
req->sense_len = 0;
req->timeout = timeout;
+ req->retries = retries;
req->flags |= REQ_BLOCK_PC | REQ_QUIET;
req->end_io_data = sioc;
@@ -1340,7 +1342,7 @@ static int scsi_prep_fn(struct request_q
cmd->sc_data_direction = DMA_NONE;
cmd->transfersize = req->data_len;
- cmd->allowed = 3;
+ cmd->allowed = req->retries;
cmd->timeout_per_command = req->timeout;
cmd->done = scsi_generic_done;
}
diff -aurp scsi-rc-fixes.tmp/drivers/scsi/sd.c scsi-rc-fixes/drivers/scsi/sd.c
--- scsi-rc-fixes.tmp/drivers/scsi/sd.c 2005-09-17 11:16:49.000000000 -0500
+++ scsi-rc-fixes/drivers/scsi/sd.c 2005-09-17 11:05:32.000000000 -0500
@@ -86,7 +86,6 @@
* Number of allowed retries
*/
#define SD_MAX_RETRIES 5
-#define SD_PASSTHROUGH_RETRIES 1
static void scsi_disk_release(struct kref *kref);
@@ -248,7 +247,7 @@ static int sd_init_command(struct scsi_c
timeout = rq->timeout;
SCpnt->transfersize = rq->data_len;
- SCpnt->allowed = SD_PASSTHROUGH_RETRIES;
+ SCpnt->allowed = rq->retries;
goto queue;
}
diff -aurp scsi-rc-fixes.tmp/drivers/scsi/st.c scsi-rc-fixes/drivers/scsi/st.c
--- scsi-rc-fixes.tmp/drivers/scsi/st.c 2005-09-17 11:17:08.000000000 -0500
+++ scsi-rc-fixes/drivers/scsi/st.c 2005-09-17 11:06:00.000000000 -0500
@@ -4206,6 +4206,7 @@ static int st_init_command(struct scsi_c
else
SCpnt->sc_data_direction = DMA_NONE;
+ SCpnt->allowed = rq->retries;
SCpnt->timeout_per_command = rq->timeout;
SCpnt->transfersize = rq->data_len;
SCpnt->done = st_intr;
diff -aurp scsi-rc-fixes.tmp/include/linux/blkdev.h scsi-rc-fixes/include/linux/blkdev.h
--- scsi-rc-fixes.tmp/include/linux/blkdev.h 2005-09-17 11:17:08.000000000 -0500
+++ scsi-rc-fixes/include/linux/blkdev.h 2005-09-17 10:59:44.000000000 -0500
@@ -184,6 +184,7 @@ struct request {
void *sense;
unsigned int timeout;
+ int retries;
/*
* For Power Management requests
next prev parent reply other threads:[~2005-09-17 18:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-16 4:39 [PATCH 4/5] convert st to use scsi_execte_async Mike Christie
2005-09-17 11:57 ` Kai Makisara
2005-09-17 15:43 ` Mike Christie
2005-09-17 15:55 ` Mike Christie
2005-09-17 16:25 ` Mike Christie [this message]
2005-09-18 12:01 ` Kai Makisara
2005-09-18 15:03 ` Mike Christie
2005-09-18 15:17 ` Mike Christie
2005-09-18 17:40 ` Kai Makisara
2005-09-18 15:46 ` Mike Christie
2005-09-18 16:13 ` Mike Christie
2005-09-18 16:08 ` Mike Christie
2005-09-18 16:36 ` Mike Christie
2005-09-18 16:38 ` Mike Christie
2005-09-18 19:03 ` Kai Makisara
2005-09-18 17:01 ` Mike Christie
2005-09-19 18:39 ` Kai Makisara
2005-09-19 19:22 ` Mike Christie
2005-09-20 19:23 ` Kai Makisara
2005-09-20 19:55 ` Mike Christie
2005-09-20 20:20 ` James Bottomley
2005-09-20 21:17 ` Kai Makisara
2005-09-20 22:39 ` Douglas Gilbert
2005-09-22 20:12 ` Kai Makisara
2005-09-23 3:20 ` Mike Christie
2005-09-17 15:57 ` Kai Makisara
2005-09-17 16:48 ` Kai Makisara
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=1126974325.10413.5.camel@max \
--to=michaelc@cs.wisc.edu \
--cc=Kai.Makisara@kolumbus.fi \
--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