linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	Jens Axboe <axboe@suse.de>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] Improve code for detecting errors near the end of a CD
Date: Sat, 15 Oct 2005 13:35:07 +1000	[thread overview]
Message-ID: <435078EB.2040203@torque.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0510142203230.24065-100000@netrider.rowland.org>

Alan Stern wrote:
> On Sat, 15 Oct 2005, Douglas Gilbert wrote:
> 
> 
>>Alan,
>>In include/scsi/scsi_eh.h there are several helper functions
>>to aid processing SCSI errors. This includes SCSI sense data
>>descriptor format (which won't be needed for DVD/HD/BD for
>>some time with a (2**32 * 2048) byte maximum using existing
>>fixed sense data format). However there is
>>scsi_get_sense_info_fld() to fetch the info field.
>>
>>sd, st and sg have been converted to use these helpers,
>>where appropriate.
>>
>>MMC-4 does not mention that the valid bit needs to
>>be set on a MEDIUM/HARDWARE error and I have seen
>>real life examples of this. [So it's poorly defined
>>if one gets a medium error on lba 0.] You may also like to
>>consider deferred errors which can occur according to
>>MMC-4.
> 
> 
> Thanks for the comments.  It will be easiest to start with this patch and 
> then add others on top.  I wouldn't mind writing another update to use 
> scsi_get_sense_info_fld and friends.
> 
> I'm not familiar with the MMC standards and it will take some time to get 
> up to speed on MMC-4.  I just downloaded the draft standard, and it's not 
> obvious where (if anywhere) it describes the sense data values.

Alan,
With mmc4r05a.pdf search for "medium error". It talks
about setting the info field but says nothing about
the valid bit. In similar situations sbc (disks) and
ssc (tapes) do mention the valid bit. They should
all conform to spc (primary commands) but at the
margin (especially mmc) they don't. I have brought
up the subject on the "t10@t10.org" reflector, the
response, if memory serves, was along the lines of
"yep, live with it".

> As for deferred errors, I don't know the proper way of handling them.  It 
> would be better for someone else to take care of it.

While searching in the pdf you could look for
"deferred" as well. Lots of hits. Hard to say what
exactly to do, but reporting something to the log
wouldn't be a bad start. This file:
include/scsi/scsi_dbg.h
also contains sense data helper declarations.


Aside ... not addressed to Alan
Why this function is in scsi_dbg.h and is declared
like this:
extern const char *scsi_extd_sense_format(
		unsigned char, unsigned char);
rather than something like this:
extern const char *scsi_asc_ascq_str(
		unsigned char asc, unsigned char ascq);
is beyond me. What has "_extd_" got to do with it?
Basically even when I know the function is there,
and publically available, it is still difficult
to find!

Doug Gilbert

  reply	other threads:[~2005-10-15  3:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14 20:07 [PATCH] Improve code for detecting errors near the end of a CD Alan Stern
2005-10-15  0:49 ` Douglas Gilbert
2005-10-15  2:36   ` Alan Stern
2005-10-15  3:35     ` Douglas Gilbert [this message]
2005-10-19 20:32   ` Alan Stern
2005-10-20  2:56     ` Douglas Gilbert
2005-10-20 16:04       ` Alan Stern
2005-10-21  3:05         ` Douglas Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2005-09-29 18:44 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=435078EB.2040203@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@SteelEye.com \
    --cc=axboe@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).