linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luben Tuikov <luben_tuikov@adaptec.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: Handling erroneous READ CAPACITY response in sd.c
Date: Wed, 20 Oct 2004 08:40:49 -0400	[thread overview]
Message-ID: <41765CD1.8060108@adaptec.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0410191738250.713-100000@netrider.rowland.org>

Alan Stern wrote:
>>A third possibility is to use the PMI bit to get the proper value
>>of the LBA of the last logical block.
>>
>>If you want to move this into sd, then do you know if those
>>devices support the use of PMI bit in READ CAPACITY CDB?
>>As block devices they should.
> 
> 
> I don't know.  Yes, they should -- but considering that the READ CAPACITY 
> support is wrong it wouldn't be surprising if the PMI support is also 
> wrong.  There's an excellent chance the devices will return the same value 
> whether PMI is set or not.

Yeah, I agree.  It's worth a try though.  If the device implements
SBC, then it should implement PMI in READ CAPACITY.  Unless it implements
RBC (Reduced Block Commands) in which case PMI is not present, neither
is READ CAPACITY(16), only the 10 byte version.

>>See the appended/attached patch.  Can you test it against such a USB
>>device?
> 
> 
> I'll ask some people to try.  Do you think that READ FORMAT CAPACITIES (op
> 0x23) might be a better approach?

READ FORMAT CAPACITIES is an _optional_ command for MMC (cd/dvd devices),
so I don't think block devices would implement it.

Given that USB block devices already implement READ CAPACITY, there's a
chance that they implement the PMI bit.  Other than that, reading a "random"
sector trying to guess the capacity might set the device into an unknown
state or hang, so this is risky.

Anyone else with such a device willing to try this patch?

	Luben


  reply	other threads:[~2004-10-20 12:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-15 19:19 Handling erroneous READ CAPACITY response in sd.c Alan Stern
2004-10-19 20:58 ` Luben Tuikov
2004-10-19 21:52   ` Alan Stern
2004-10-20 12:40     ` Luben Tuikov [this message]
2004-10-20 15:48       ` Alan Stern
2004-10-24 12:34         ` Eero Volotinen
2004-10-25 19:41           ` Alan Stern
2004-10-25 20:27             ` Luben Tuikov
2004-10-25 20:08           ` Luben Tuikov
     [not found]             ` <417D6123.4060902@ping-viini.org>
2004-10-25 20:55               ` Luben Tuikov
2004-11-05 16:18       ` Alan Stern
2004-11-05 18:06         ` Matthew Dharm
2004-11-05 18:34           ` Alan Stern
2004-11-05 18:44           ` [usb-storage] " Andries Brouwer
2004-11-05 21:38             ` Alan Stern
2004-11-05 21:59               ` Andries Brouwer
2004-11-08 18:55         ` Luben Tuikov
2004-11-08 21:03           ` Alan Stern
2004-11-08 21:35             ` Luben Tuikov
2004-11-08 22:04             ` Matthew Dharm
2004-11-08 22:08               ` Alan Stern
2004-10-20 13:28     ` Luben Tuikov
     [not found] <417AFDA5.5080806@micro.ee.nthu.edu.tw>
2004-10-24 17:11 ` Alan Stern
2004-10-25 21:54   ` Darsen
2004-10-26 14:43     ` Alan Stern
     [not found] <417F6412.90000@micro.ee.nthu.edu.tw>
2004-10-27 19:11 ` Alan Stern
2004-10-29 14:22   ` Darsen
2004-10-29 16:46     ` 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=41765CD1.8060108@adaptec.com \
    --to=luben_tuikov@adaptec.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;
as well as URLs for NNTP newsgroup(s).