linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	Albert Lee <albertcc@tw.ibm.com>
Subject: Re: ATAPI corruption found
Date: Thu, 06 Oct 2005 23:33:36 +0900	[thread overview]
Message-ID: <434535C0.5040007@gmail.com> (raw)
In-Reply-To: <4344F4BB.20707@pobox.com>


  Hello, Jeff.

Jeff Garzik wrote:
> Tejun Heo wrote:
> 
>>
>>  Hi, Jeff.
>>
>> Jeff Garzik wrote:
>>
>>>
>>> When atapi_qc_complete() takes the error path, completes the SCSI 
>>> command, SCSI EH runs, and the code attempts to complete the SCSI 
>>> command again, this time with scsi_finish_command().
>>
>>
>>
>>  Umm.. that's how it worked until now by design.  Can you elaborate 
>> how corruption occurs?
> 
> 
> It completes the SCSI command twice.  Once in atapi_qc_complete(), and 
> once in ata_qc_timeout().

  I hope I'm not completely misunderstanding what you're saying.  If so, 
please be kind enough to point out.

  When a SCSI LLDD reports failure of a command to midlayer, several 
actions can be taken.  scsi_decide_disposition() determines what to do 
depending on which result code LLDD reports and what content the sense 
buffer contains.  Some commands are just reported upward 
(scsi_finish_command), some retried and other are passed on to EH for 
further recovery action.

  When a scmd is handed off to EH,

- it isn't finished yet.
- it will be finished or retried by calling either scsi_finish_command()
   or scsi_queue_insert().

  So, when EH is needed, SCSI ML passes the scmd to EH without finishing 
it and EH is responsible of what to do with the scmd.

  This is exactly what's going on w/ ATAPI request sensing.  libata asks 
SCSI ML to invoke EH for the scmd by completing a scmd with CHECK_SENSE 
but without sense data, so SCSI ML invokes EH to read sense data and 
actually determine what to do.  libata EH is invoked and it reads sense 
data and finishes the scmd with the sense data.  AFAIK, this is how SCSI 
EH works.

> And I doubt it has ever -really- worked as hoped...

  With proper fixes to libata EH, it works.  I can definitely tell you 
that and I think Albert can also verify that ATAPI request sensing 
works.  libata EH currently has some issues with stuff like 
synchronization with normal processing and etc, but it's nothing 
fundamental.  After all, that's how SCSI EH works.

  If I'm being stupid here, please point out.  I'll hit my head as hard 
as I can and take a long tearful shower.  :-)

  Thanks.

-- 
tejun

      reply	other threads:[~2005-10-06 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05 10:05 ATAPI corruption found Jeff Garzik
2005-10-06  6:12 ` Tejun Heo
2005-10-06  9:56   ` Jeff Garzik
2005-10-06 14:33     ` Tejun Heo [this message]

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=434535C0.5040007@gmail.com \
    --to=htejun@gmail.com \
    --cc=albertcc@tw.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).