From: Tejun Heo <htejun@gmail.com>
To: Luben Tuikov <luben_tuikov@adaptec.com>
Cc: Albert Lee <albertcc@tw.ibm.com>, Jeff Garzik <jgarzik@pobox.com>,
linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
Doug Maxey <dwm@maxeymade.com>
Subject: Re: [RFC] libata new EH document
Date: Thu, 01 Sep 2005 10:17:15 +0900 [thread overview]
Message-ID: <4316569B.6080406@gmail.com> (raw)
In-Reply-To: <43146DE7.1070501@adaptec.com>
Luben Tuikov wrote:
> On 08/30/05 06:26, Tejun Heo wrote:
>
>>Albert Lee wrote:
>>
>>
>>>>4. Corresponding scmd's result code is set to
>>>> SAM_STAT_CHECK_CONDITION and qc->scsidone() callback is called
>>>> directly. As we haven't filled sense data,
>>>> scsi_determine_disposition() will return FAILED and SCSI EH will
>>>> be scheduled. Note that as we directly call qc->scsidone(), qc is
>>>> left intact.
>>>>
>>>>
>>>
>>>Could we get the sense data before calling qc->scsidone()? (Using the
>>>proposed separate
>>>EH qc can keep the original qc intact.)
>>>
>>>The issue:
>>>When a DVD drive returns MEDIUM_ERROR in the sense data, libata doesn't
>>>retry the command.
>>>
>>>For libata, when scsi_softirq() calls scsi_decide_disposition() and
>>>scsi_check_sense() to determine
>>>how to handle the result, scsi_check_sense() always returns "fail" since
>>>the sense data is not there
>>>yet. The sense data is requested later in the libata error handler. But
>>>the command has already been
>>>considered as an "error".
>>>
>>>By having the sense data ready before calling qc->scsidone(), we can
>>>make the
>>>NEEDS_RETRY work in scsi_softirq(). So, for things like MEDIUM_ERROR,
>>>the device has
>>>a chance to retry/recover the error. This seems to be important for
>>>devices with built-in
>>>defect management system.
>>
>>
>> There are two ways a scmd can leave EH - retry by scsi_queue_insert()
>>and finish by scsi_finish_cmd(). I think the problem you described can
>>be easily solved by choosing the former method when finishing the qc
>>from EH. Note that other advanced EH stuff like reconfiguring transport
>>speed also requires retrying, so we will surely have a mechanism for
>>retrying failed qc's from EH.
>
>
> What is needed is autosense simulation for ATA, so that SCSI Core doesn't
> know that the device doesn't support autosense.
>
> So, before a failed command reaches SCSI Core recovery, it should pass by
> ATA layer recovery to get sense.
>
> Note: if you send another command for execution after the failed command
> _and_ no autosense is provided, then any sense data is lost -- this is further
> subject to more rules set forth in SAM and SPC.
>
IMHO, it's a good idea to maintain one qc to one ATA/ATAPI command
mapping as long as possible. And, in the suggested framework, it's
guaranteed that no other command can come inbetween CHECK_SENSE and
REQUEST_SENSE.
Requesting sense from EH, calling scsi_decide_disposition() on the
sense and following the verdict should achieve the same effect as
emulating autosense. Is there any compelling reason to break one qc to
one command mapping?
--
tejun
next prev parent reply other threads:[~2005-09-01 1:17 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-29 6:11 [RFC] libata new EH document Tejun Heo
2005-08-29 6:13 ` Tejun Heo
2005-08-30 9:10 ` Albert Lee
2005-08-30 10:26 ` Tejun Heo
2005-08-30 14:32 ` Luben Tuikov
2005-09-01 1:17 ` Tejun Heo [this message]
2005-09-01 2:22 ` Jeff Garzik
2005-09-01 2:42 ` Tejun Heo
2005-09-01 3:33 ` Luben Tuikov
2005-09-01 3:30 ` Luben Tuikov
2005-09-01 3:44 ` Tejun Heo
2005-09-01 4:38 ` Luben Tuikov
2005-09-01 5:44 ` Tejun Heo
2005-09-01 5:54 ` Jeff Garzik
2005-09-01 13:24 ` James Bottomley
2005-09-01 21:40 ` Luben Tuikov
2005-09-01 21:46 ` Jeff Garzik
2005-09-01 22:09 ` Luben Tuikov
2005-09-01 22:27 ` Jeff Garzik
2005-09-01 23:17 ` Luben Tuikov
2005-09-02 7:09 ` Stefan Richter
2005-09-01 22:22 ` Luben Tuikov
2005-09-01 22:31 ` Jeff Garzik
2005-09-01 21:55 ` James Bottomley
2005-09-01 22:07 ` Luben Tuikov
2005-09-01 22:23 ` James Bottomley
2005-09-01 22:36 ` Luben Tuikov
2005-09-01 23:01 ` James Bottomley
2005-09-01 23:03 ` Luben Tuikov
2005-09-01 23:27 ` Luben Tuikov
2005-09-01 2:22 ` Jeff Garzik
2005-08-30 14:27 ` James Bottomley
2005-09-07 8:25 ` Jeff Garzik
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=4316569B.6080406@gmail.com \
--to=htejun@gmail.com \
--cc=albertcc@tw.ibm.com \
--cc=dwm@maxeymade.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=luben_tuikov@adaptec.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;
as well as URLs for NNTP newsgroup(s).