public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Pat LaVarre <p.lavarre@ieee.org>
To: dmitrik@users.sourceforge.net
Cc: linux-scsi@vger.kernel.org
Subject: Re: [usb-storage] mode sense blacklist how
Date: 20 Nov 2003 08:57:15 -0700	[thread overview]
Message-ID: <1069343835.6663.16.camel@patrh9> (raw)
In-Reply-To: <1069337187.3fbcca6395f44@webmail.netregistry.net>

> The only really important question IMHO is
> how come SG_IO is not interruptible.

Yes, now being pursued by Doug G in this thread.

> > In the log I see this command repeated, time and again.  Did you ask for
> > this command repeatedly yourself, or is it the code of SG_IO and below
> > that is so helpfully retrying?
> 
> That wasn't me. I see these commands were sent *after* the device has 
> been unplugged. It must've been SCSI layer.

This also could matter.  In our kernel code who wrongly thinks we gave
permission to retry SG_IO?  This evidence echoes someone else's - may
have been Patrick M - who saw mode sense stuttering.  I don't remember
if that was different (rude mode sense from the kernel) or the same
(rude mode sense via SG_IO from plscsi).

> Anyway, it must be obvious by now that the device is broken or shall
> we say proprietary. There is a quick workaround already in place. I'd
> say blacklist it in unusual_devs and be done with it.

Not broken.

This device explicitly self-identifies itself as a proprietary kind of
SCSI via bInterfaceSubClass = xFF and also the almost-proprietary kind
of SCSI over USB that is bInterfaceProtocol != x50.

No separate blacklist needed.  Recently near here I think I heard:

We of usb-storage are instead choosing to blacklist all the reserved
bInterfaceSubClass codes altogether.  Already we blacklist such devices
in that we don't try talking unless they appear in unusual_devs.  Now
also we won't try non-Microsoft mode sense even if they do appear in
unusual_devs.

> > the plscsi workaround: -X time 5 0. 
> > Does that work for you?  
> 
> Yes, ... Still, ... device ... must be unplugged ...

Curious.  If the mode senses that work aren't the first mode senses that
Windows tries, then the resets of Windows must be working ...

> try more MODE SENSE(10) ... finally found some that work:
> 
> ./plscsi /dev/sg1 -v -p -X time 10 0 -i xC0 -x "5A 00 3F 00 00 00 00 00 C0 00"
> produces the following output:
> 
> x 00000000 5A 00 3F:00:00:00 00 00:C0 00 .. .. .. .. .. .. "Z@?@@@@@@@"
> x 00000000 00:32:00:00 00:00:00:00 05:1E:00:12 04:20:02:00 "@2@@@@@@E^@RD B@"
> x 00000010 01:00:00:00 00:00:00:00 00:00:00:00 00:00:00:00 "A@@@@@@@@@@@@@@@"
> x 00000020 00:00:00:00 00:B4:00:00 1B:0A:C0:00 00:00:00:00 "@@@@@4@@[J@@@@@@"
> x 00000030 00:00:00:00 00:00:00:00 00:00:00:00 00:00:00:00 "@@@@@@@@@@@@@@@@"
> ...
> x 000000B0 00:00:00:00 00:00:00:00 00:00:00:00 00:00:00:00 "@@@@@@@@@@@@@@@@"

Ah.  Eight byte header claiming x34 bytes available.  No optional block
descriptor.  x20 bytes of page x05 for boot H:S:C.  x0C bytes of page
x1B to please Windows.    x 8 + 20 + 0C = 34, good.

> // 0 = plscsi.main exit int
> 
> It looks like the device does support MODE SENSE(10) for pages 5 and 1B only.

Perhaps that is all that PC boot BIOS and Windows require.  This could
be a sample of design-by-test: edit, compile, test, ship when it does
not crash.  Do you know if the device firmware is upgradable?

> "5A 00 05 00 00 00 00 00 C0 00" and "5A 00 1B 00 00 00 00 00 C0 00" also work.
> 
> There is not much useful info on those 2 pages, what was the point 
> of implementing them I wonder?

t10.org as we speak is hashing over the value or not of reporting a
fictional C:H:S geometry in the mode page x05 that can report C:H:S up
to about 8 GiB.

Page x1B I don't remember the t10.org name of but it appears in Windows
traces, so someone on Earth thinks it can be useful.  Name might be
something like "power conditions".

> > Have you tried `modprobe -r usb-storage`?
> "Module in use"
> Not entirely unexpected since plscsi holds an open handle at this point.

I'm sure I'm enough of a kernelnewbie to be deeply confused here, but I
don't understand why we can kill the plscsi process without gaining
permission to kill the SG_IO.
 
> > Adding -v might tell us more.
>
> Not really:) It just shows the command going down and that's it.

Thanks for saying, now I feel less bad about not suggesting -v to begin
with.

> > Here we see "auto-sense" "code: 0x70, key: 0x5, ASC: 0x24, ASCQ: 0x0".
> > 
> > In the t10.org English, x 5 24 means cdb[0] opcode understood, but whole
> > cdb not understood.  x 5 20 means cdb[0] opcode not understood.
> > 
> > This result suggests, without guaranteeing, that the vendor-specific
> > bInterfaceSubClass = xFF SCSI of this device includes some cdb's that
> > begin with op x1A Mode Sense (6).
> 
> Hmm, I tried MODE SENSE(6) with the same pages (5,1B and 3F) that worked 
> with MODE SENSE(10) and I've got the same error: x 5 24.

Ouch, maybe this device is creatively reporting x 5 24 to mean x 5 20.

Pat LaVarre



  reply	other threads:[~2003-11-20 15:57 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12 23:50 [PATCH] fix Sony USB mass storage - pass larger receive buffer Patrick Mansfield
2003-11-13  0:09 ` Matthew Dharm
2003-11-13  0:13   ` Patrick Mansfield
2003-11-13  0:44     ` Patrick Mansfield
2003-11-13  1:56       ` Matthew Dharm
2003-11-13 14:54         ` [usb-storage] " Alan Stern
2003-11-13 16:21           ` Pat LaVarre
2003-11-13 17:09             ` Alan Stern
2003-11-13 17:24               ` Pat LaVarre
2003-11-13 18:04                 ` Patrick Mansfield
2003-11-13 18:15                   ` Pat LaVarre
2003-11-13 18:22                     ` Pat LaVarre
2003-11-13 18:26                       ` Pat LaVarre
2003-11-13 18:37                         ` Pat LaVarre
2003-11-13 19:13                           ` Matthew Dharm
2003-11-13 19:30                             ` Pat LaVarre
2003-11-13 22:03                               ` Alan Stern
2003-11-13 23:40                                 ` Pat LaVarre
2003-11-13 23:51                                   ` Dmitri Katchalov
2003-11-14  0:16                                     ` Pat LaVarre
2003-11-14  1:04                                   ` Matthew Dharm
2003-11-14  1:10                                     ` Pat LaVarre
2003-11-14  1:13                                       ` Matthew Dharm
2003-11-13 22:01                 ` Alan Stern
2003-11-13 23:37                   ` Pat LaVarre
2003-11-14  0:24                     ` Patrick Mansfield
2003-11-14  1:54                       ` Pat LaVarre
2003-11-14  2:08                         ` Matthew Dharm
2003-11-14  2:24                           ` Pat LaVarre
2003-11-17 21:38                       ` Pat LaVarre
2003-11-17 22:00                         ` Patrick Mansfield
2003-11-17 23:36                           ` Pat LaVarre
2003-11-14  1:03                     ` Matthew Dharm
2003-11-13 23:44                   ` Pat LaVarre
2003-11-14  0:13                     ` Dmitri Katchalov
2003-11-14  0:55                       ` Pat LaVarre
2003-11-14  1:13                       ` Matthew Dharm
2003-11-14  2:02                         ` Pat LaVarre
2003-11-14  2:10                       ` Pat LaVarre
2003-11-14  2:19                         ` Matthew Dharm
2003-11-14  2:38                           ` [usb-storage] mode sense blacklist how Pat LaVarre
2003-11-14  2:44                             ` Matthew Dharm
2003-11-14 17:27                               ` Pat LaVarre
2003-11-14 17:57                                 ` Pat LaVarre
2003-11-14  3:11                             ` Dmitri Katchalov
2003-11-14 19:41                               ` Pat LaVarre
     [not found]                                 ` <20031114153607.A7207@beaverton.ibm.com>
     [not found]                                   ` <20031116121039.A13224@beaverton.ibm.com>
2003-11-17 20:14                                     ` Pat LaVarre
2003-11-19 12:55                                 ` Dmitri Katchalov
2003-11-19 16:34                                   ` Pat LaVarre
2003-11-19 17:02                                   ` Pat LaVarre
2003-11-19 23:34                                     ` Douglas Gilbert
2003-11-20 16:32                                       ` Pat LaVarre
2003-11-21  1:17                                         ` SG_IO ioctl (was: mode sense blacklist how) Douglas Gilbert
2003-11-21  3:18                                           ` Willem Riede
2003-11-21 20:51                                           ` Pat LaVarre
2003-11-28 17:07                                             ` Pat LaVarre
2003-11-28 17:14                                               ` Pat LaVarre
2003-11-28 17:31                                               ` Pat LaVarre
2003-11-28 17:09                                             ` Pat LaVarre
2003-11-21 21:29                                           ` Pat LaVarre
2003-11-20 14:06                                     ` [usb-storage] mode sense blacklist how Dmitri Katchalov
2003-11-20 15:57                                       ` Pat LaVarre [this message]
2003-11-14  1:06                     ` [usb-storage] Re: [PATCH] fix Sony USB mass storage - pass larger receive buffer Matthew Dharm
2003-11-14 16:14                     ` Alan Stern
2003-11-14 17:29                       ` Matthew Dharm
2003-11-14 17:50                       ` Pat LaVarre
2003-11-14  2:02 ` Douglas Gilbert
2003-11-14 21:45   ` [usb-storage] " Pat LaVarre

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=1069343835.6663.16.camel@patrh9 \
    --to=p.lavarre@ieee.org \
    --cc=dmitrik@users.sourceforge.net \
    --cc=linux-scsi@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