Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "André Cruz" <afafc@rnl.ist.utl.pt>
To: Andries.Brouwer@cwi.nl, James.Bottomley@steeleye.com
Cc: alan@lxorguk.ukuu.org.uk, greg@kroah.com,
	linux-scsi@vger.kernel.org,
	linux-usb-devel@lists.sourceforge.net, mike@hingston.demon.co.uk,
	stelian@popies.net, torvalds@transmeta.com
Subject: RE: [example PATCH - not for applying] exclude certain commands
Date: Thu, 24 Apr 2003 09:05:18 +0100	[thread overview]
Message-ID: <000001c30a38$3f5ece50$040000c0@giga> (raw)
In-Reply-To: <UTC200304232239.h3NMdSf07801.aeb@smtp.cwi.nl>

It worked for me.
Great! :)
I was able to mount the CF card, list it's contents, etc.
You guys are on the right track. Keep up the good work.
cya

_________________________________________
André Cruz
ICQ#: 9519211
_________________________________________


-----Original Message-----
From: Andries.Brouwer@cwi.nl [mailto:Andries.Brouwer@cwi.nl] 
Sent: quarta-feira, 23 de Abril de 2003 23:39
To: James.Bottomley@steeleye.com
Cc: afafc@rnl.ist.utl.pt; alan@lxorguk.ukuu.org.uk; greg@kroah.com;
linux-scsi@vger.kernel.org; linux-usb-devel@lists.sourceforge.net;
mike@hingston.demon.co.uk; stelian@popies.net; torvalds@transmeta.com
Subject: [example PATCH - not for applying] exclude certain commands


Yesterday or so we discussed three people's problems with USB devices.
Today a fourth very similar complaint was reported.

I asked

> Could you try this patch of drivers/scsi/sd.c?
>
> --- sd.c~       Sun Apr 20 12:59:32 2003
> +++ sd.c        Wed Apr 23 21:45:10 2003
> @@ -1079,6 +1079,9 @@
>                   int dbd, int modepage, unsigned char *buffer, int len) {
>         unsigned char cmd[8];
>
> +       if (len < 8)
> +               len = 8;
> +
>         memset((void *) &cmd[0], 0, 8);
>         cmd[0] = MODE_SENSE;
>         cmd[1] = dbd;

and got the reply

#
# Wohoo! Patch worked like a charm. Thanks Andries!
#

So, for the time being I assume we know what is causing
these problems. It would be nice if the other three
(afafc@rnl.ist.utl.pt, mike@hingston.demon.co.uk, stelian@popies.net)
could report on their experiences with the above patch.

The next question is whether this is a bug in these devices
or a bug in the usb-storage code.

As Alan remarked, drivers/usb/storage/protocol.c contains
the fragment

        case MODE_SENSE:
                srb->cmnd[8] = 8;

But that is in usb_stor_ufi_command(), and
usb_stor_transparent_scsi_command() doesn't do this.
Nevertheless, MODE_SENSE has minimum length 4, and
MODE_SENSE_10 has minum length 8 for its reply.
So, possibly the latter routine should do something
similar. For example

--- protocol.c~ Fri Nov 22 22:40:13 2002
+++ protocol.c  Thu Apr 24 00:38:31 2003
@@ -366,6 +366,8 @@
                        srb->cmnd[2] = srb->cmnd[2];
                        srb->cmnd[1] = srb->cmnd[1];
                        srb->cmnd[0] = srb->cmnd[0] | 0x40;
+                       if (srb->cmnd[8] < 8)
+                               srb->cmnd[8] = 8;
                        break;
                } /* switch (srb->cmnd[0]) */
        } /* if (us->flags & US_FL_MODE_XLATE) */

(yes, ugly, no guarantee that the buffer is large enough).

Comments?

Andries



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

  parent reply	other threads:[~2003-04-24  8:05 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 22:39 [example PATCH - not for applying] exclude certain commands Andries.Brouwer
2003-04-24  0:10 ` Matthew Dharm
2003-04-24  8:05 ` André Cruz [this message]
2003-04-24  9:15 ` Stelian Pop
2003-04-24  9:22   ` Stelian Pop
2003-04-24 11:45 ` Mike Bursell
2003-04-24 12:44 ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2003-04-24  9:08 Andries.Brouwer
2003-04-24 18:22 ` Matthew Dharm
2003-04-24  9:46 Andries.Brouwer
2003-04-24  9:56 ` Stelian Pop
2003-04-24 14:05 ` Alan Stern
2003-04-24 14:26   ` James Bottomley
2003-04-24 14:46     ` Alan Stern
2003-04-24 15:26       ` James Bottomley
2003-04-24 15:21 Andries.Brouwer
2003-04-24 15:56 ` Pete
2003-04-24 21:33 ` Stelian Pop
2003-04-24 18:59 Andries.Brouwer
2003-04-24 19:14 ` Matthew Dharm
2003-04-24 20:20   ` James Bottomley
2003-04-24 20:59     ` Matthew Dharm
2003-04-24 21:43       ` Patrick Mansfield
2003-04-25  0:43 Andries.Brouwer
2003-04-25  2:12 ` Matthew Dharm
2003-04-25 14:32 ` Alan Stern
2003-04-25 15:12   ` Oliver Neukum
2003-04-26  0:58     ` Alan Stern
2003-04-26  8:24       ` Oliver Neukum
2003-04-26 15:22         ` Alan Stern
2003-04-26 21:44 Andries.Brouwer
2003-04-26 22:13 ` Matthew Dharm
2003-04-26 22:43   ` James Bottomley
2003-04-27  1:34     ` Matthew Dharm
2003-04-27  2:15       ` James Bottomley
2003-04-27  9:35         ` Matthew Dharm
2003-04-27 15:41           ` James Bottomley
2003-04-27 18:52             ` Kai Makisara
2003-04-27 19:52             ` Matthew Dharm
2003-04-28 19:05               ` Luben Tuikov
2003-04-28 19:12                 ` Luben Tuikov
2003-04-28 20:19                 ` Matthew Dharm
2003-04-28 21:33                   ` Luben Tuikov
2003-04-26 22:29 ` James Bottomley
2003-04-27  0:24   ` Patrick Mansfield
2003-04-27  1:39   ` Matthew Dharm
2003-04-27  2:29 Andries.Brouwer
2003-04-27  4:32 ` James Bottomley

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='000001c30a38$3f5ece50$040000c0@giga' \
    --to=afafc@rnl.ist.utl.pt \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=James.Bottomley@steeleye.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=mike@hingston.demon.co.uk \
    --cc=stelian@popies.net \
    --cc=torvalds@transmeta.com \
    /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