From: James Bottomley <James.Bottomley@SteelEye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-scsi@vger.kernel.org, Albert Lee <albertcc@tw.ibm.com>,
Tejun Heo <htejun@gmail.com>, Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [patch] SCSI: early detection of medium not present, updated
Date: Wed, 05 Dec 2007 18:06:32 +0200 [thread overview]
Message-ID: <1196870792.11927.21.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0712021458120.4185-100000@netrider.rowland.org>
On Sun, 2007-12-02 at 15:02 -0500, Alan Stern wrote:
> On Sun, 2 Dec 2007, James Bottomley wrote:
>
> > Actually, the night train is a good place to do coding. I know this
> > compiles, but could someone check it out? It's the form I think we
> > should do, since the ASC/ASCQ codes for esoteric conditions which we
> > might eventually check for are different for CDs and removable discs.
>
> This part is puzzling:
>
> > + /* try to eat the UNIT_ATTENTION if there are enough retries */
> > + do {
> > + result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
> > + timeout, retries);
> > + } while ((driver_byte(result) & DRIVER_SENSE) &&
> > + sshdr && sshdr->sense_key == UNIT_ATTENTION &&
> > + --retries);
>
> For one thing, you've using retries to control both an outer loop and
> an inner loop -- meaning the total number of attempts could be on the
> order of retries**2.
Sort of; however, there should only really be one cc/ua before the TUR
goes through. Also, TUR produces almost no conditions that would be
retryable in scsi_decide_disposition() and the scsi_execute sends it
down with REQ_FAILFAST anyway, so it's really not used much.
> For another, why do you want to swallow a UNIT_ATTENTION? Shouldn't
> that be up to the code calling scsi_test_unit_ready()?
No, that's a bug in the old code. UA doesn't necessarily mean there's a
media change. It could be asserted for a whole host of reasons. Until
we get proper UA signalling, we need to resend the TUR so we get the
correct media status and discard the UA (Even if the device is asserting
UA for media change reasons, it will still give the correct sense code
response to the following TUR).
James
next prev parent reply other threads:[~2007-12-05 16:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 23:18 [patch] SCSI: early detection of medium not present, updated Andrew Morton
2007-11-30 0:04 ` Tejun Heo
2007-11-30 3:26 ` Alan Stern
2007-12-01 14:24 ` James Bottomley
2007-12-01 15:55 ` Alan Stern
2007-12-02 17:10 ` James Bottomley
2007-12-02 20:02 ` Alan Stern
2007-12-05 16:06 ` James Bottomley [this message]
2007-12-07 15:51 ` Alan Stern
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=1196870792.11927.21.camel@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=akpm@linux-foundation.org \
--cc=albertcc@tw.ibm.com \
--cc=htejun@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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