From: Patrick Mansfield <patmans@us.ibm.com>
To: Kurt Garloff <garloff@suse.de>,
Linux SCSI list <linux-scsi@vger.kernel.org>,
James Bottomley <James.Bottomley@steeleye.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: PATCH 5/5: scsi-scan-inq-timeout
Date: Wed, 21 Apr 2004 13:24:54 -0700 [thread overview]
Message-ID: <20040421132454.A19685@beaverton.ibm.com> (raw)
In-Reply-To: <20040421141456.GW28633@tpkurt.garloff.de>; from garloff@suse.de on Wed, Apr 21, 2004 at 04:14:56PM +0200
On Wed, Apr 21, 2004 at 04:14:56PM +0200, Kurt Garloff wrote:
>
> Feature
>
> Make the timeout for INQUIRY during SCSI scan adjustable via boot parameter.
> Note that the second INQUIRY does use a shorter timeout, as the long timeout
> is for recovery from the initial reset, not because existing devices would
> take so long to answer INQUIRY. SPC3 says that INQUIRY should be available
> right away, but real life is different unfortunately.
>
> diff -uNrp linux-2.6.5.dontattachoffl/drivers/scsi/scsi_scan.c linux-2.6.5.inq_timeout/drivers/scsi/scsi_scan.c
> --- linux-2.6.5.dontattachoffl/drivers/scsi/scsi_scan.c 2004-04-21 14:28:13.000000000 +0200
> +++ linux-2.6.5.inq_timeout/drivers/scsi/scsi_scan.c 2004-04-21 14:32:04.000000000 +0200
> @@ -94,6 +94,13 @@ MODULE_PARM_DESC(max_report_luns,
> "REPORT LUNS maximum number of LUNS received (should be"
> " between 1 and 16384)");
>
> +static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ+3;
> +
> +module_param_named(inq_timeout, scsi_inq_timeout, int, S_IRUGO|S_IWUSR);
> +MODULE_PARM_DESC(inq_timeout,
> + "Timeout (in seconds) waiting for devices to answer INQUIRY."
> + " Default is 5. Some non-compliant devices need more.");
> +
> /**
> * scsi_unlock_floptical - unlock device via a special MODE SENSE command
> * @sreq: used to send the command
> @@ -344,7 +351,7 @@ static void scsi_probe_lun(struct scsi_r
>
> memset(inq_result, 0, 36);
> scsi_wait_req(sreq, (void *) scsi_cmd, (void *) inq_result, 36,
> - SCSI_TIMEOUT + 4 * HZ, 3);
> + HZ/2 + HZ*scsi_inq_timeout, 3);
SCSI_TIMEOUT is 2 * HZ.
So we defaulted to 6 seconds, and now we default to 5.5 seconds. Why?
Why not get rid of the HZ/2, and set scsi_inq_timeout = SCSI_TIMEOUT/HZ +
4 so we default to 6 again?
So if a device needs at least N + .5 seconds then just set the
scsi_inq_timeout to N + 1.
>
> SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: 1st INQUIRY %s with"
> " code 0x%x\n", sreq->sr_result ?
> @@ -393,7 +400,7 @@ static void scsi_probe_lun(struct scsi_r
> memset(inq_result, 0, possible_inq_resp_len);
> scsi_wait_req(sreq, (void *) scsi_cmd,
> (void *) inq_result,
> - possible_inq_resp_len, SCSI_TIMEOUT + 4 * HZ, 3);
> + possible_inq_resp_len, (1+scsi_inq_timeout)*(HZ/2), 3);
IMO just make the two timeouts the same and avoid any potential problems
(like some funky device always takes 4 seconds to reponsd to an INQUIRY).
-- Patrick Mansfield
next prev parent reply other threads:[~2004-04-21 20:26 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-18 18:57 Patches for SCSI scanning Kurt Garloff
2004-04-18 23:16 ` James Bottomley
2004-04-20 11:54 ` Kurt Garloff
2004-04-20 12:04 ` Christoph Hellwig
2004-04-20 13:02 ` Kurt Garloff
2004-04-20 14:38 ` James Bottomley
2004-04-20 16:03 ` Kurt Garloff
2004-04-20 16:08 ` James Bottomley
2004-04-21 13:48 ` Kurt Garloff
2004-04-21 15:36 ` James Bottomley
2004-04-21 13:45 ` Kurt Garloff
2004-04-21 14:10 ` PATCH 1/5: scsi-scan-deprecate-forcelun Kurt Garloff
2004-04-21 14:12 ` PATCH 2/5: scsi-scan-blist_replun Kurt Garloff
2004-04-21 15:14 ` Christoph Hellwig
2004-04-21 15:30 ` Kurt Garloff
2004-04-21 16:03 ` Kurt Garloff
2004-04-21 14:13 ` PATCH 3/5: scsi-scan-no-offl-pq-notcon Kurt Garloff
2004-04-21 14:14 ` PATCH 4/5: scsi-scan-dont-att-pq-notcon Kurt Garloff
2004-04-21 15:02 ` Christoph Hellwig
2004-04-21 15:24 ` Kurt Garloff
2004-04-21 15:33 ` Mike Anderson
2004-04-21 15:33 ` Christoph Hellwig
2004-04-21 16:08 ` Kurt Garloff
2004-04-21 16:18 ` James Bottomley
2004-04-21 16:55 ` Patrick Mansfield
2004-04-21 22:51 ` Kurt Garloff
2004-04-22 20:39 ` Patrick Mansfield
2004-04-22 20:45 ` James Bottomley
2004-04-21 16:58 ` Kurt Garloff
2004-04-21 16:16 ` Kurt Garloff
2004-04-21 15:40 ` James Bottomley
2004-04-21 14:14 ` PATCH 5/5: scsi-scan-inq-timeout Kurt Garloff
2004-04-21 20:24 ` Patrick Mansfield [this message]
2004-04-21 22:48 ` Kurt Garloff
2004-04-21 23:49 ` Patrick Mansfield
2004-04-20 16:26 ` Patches for SCSI scanning Patrick Mansfield
2004-04-20 16:42 ` Kurt Garloff
2004-04-20 17:44 ` Patrick Mansfield
2004-04-21 13:52 ` Kurt Garloff
2004-04-20 10:24 ` Fabien Salvi
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=20040421132454.A19685@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@steeleye.com \
--cc=akpm@osdl.org \
--cc=garloff@suse.de \
--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