Skip to contentSkip to conversation

usb storage traces

DISCUSSION Alan Stern 2 participants 2 messages Dec 5, 2003 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1070649445.12411.347.camel@patibmrh9

Alan Stern

author
#1 lore raw
Quoted 10 lines · Pat LaVarre
Quoted 2 lines

Anyway, the page x08 data indicates WCE off. So maybe Windows was just trying to turn it on

Apparently yes. Cool, thanks for sharing. I'm now guessing this occurs only when rmb is clear.

If so, then we can say msft turns write-behind etc. on when the drive is hot-pluggable, but turns write-behind etc. off when the disk is fully hot-pluggable or even only hot-pluggable while not prevented. Not good policy, though too late now I suppose.

Be careful with your nomenclature. Hot-pluggable and removable-media are two different things.

Quoted 15 lines

That reality will encourage device folk to virtually unplug the drive when the disk ejects ... else disconnect mode page x08 from reality.

Quoted 9 lines

There was a prior x1a = MODE-SENSE(6) for page x08. Here is the returned data:

	12 00 00 00 00 00 00 00 08 0a 00 00 00 00 00 00
	00 00 00 00

I read this as: mode data length = 18 (inconsistent with the amount of returned data, which is 19 bytes not counting the mode data length byte itself),

Help I'm lost.

Quoted 8 lines

Did we get these plain hex bytes via Windows, rather than from a bus trace? They internally contradict themselves.

Have we unwittingly involved the slightly broken Win mode sense 6/10 translator? This plain hex could be the result from a compliant device if what actually crossed the bus was an op x5A mode sense 10, and then Win gave us the data in unedited, even after Win had helpfully edited the cdb we asked to send.

The trace came from USB Snoopy. I don't know enough about the internals of Windows to say whether the data have been mangled or not.

Quoted 7 lines
Quoted 1 line

these plain hex bytes ... internally contradict themselves.

Digital numbers have value and length, not just value.

Yes x 08 0a 00 00 00 00 00 00 00 00 00 00 appears to be an x0C (12) byte mode page.

Quoted 8 lines

But x 12 00 00 00 00 00 00 00 appears to be an eight byte header for op x5A mode sense 10, which by ANSI T10 SPC definition contains the additional length x 12 00, which at offset zero fits a total available length of x14 (20), which is the number of data bytes you quote.

But we say we traced op x1A mode sense 6, not op x5A mode sense 10.

Help?

Don't ask me, I don't know.

Alan Stern

#2 lore raw
Quoted 7 lines
Quoted 4 lines

If so, then we can say msft turns write-behind etc. on when the drive is hot-pluggable, but turns write-behind etc. off when the disk is fully hot-pluggable or even only hot-pluggable while not prevented. Not good policy, though too late now I suppose.

Be careful with your nomenclature. Hot-pluggable and removable-media are two different things.

Sorry I was unclear. I mean to say Four things:

a) Write-behind risks more if people commonly do yank the device cable or the disk itself while an fs of the disk is mounted.

b) Here we may be seeing msft choose to reduce thruput by turning off write-behind while still shattering streams into just a few bytes/cdb.

c) Here we may be seeing msft making this choice whenever the device sets op x12 Inquiry bytes[1] & x80 RMB to say the disk can unplug without the drive unplugging.

d) Massively distributing host silliness like that provokes silliness in device design. Give an advantage to devices that don't say the disk can unplug without the drive unplugging, and more devices will learn to electronically unplug the drive when the disk unplugs.

Is my jargon still wrong? Am I still unclear? If I have failed again might you tell me?

Pat LaVarre