public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [usb-storage] Re: PATCH: exclude certain commands from emulated SCSI hosts
@ 2003-04-22 17:37 James Bottomley
  2003-04-22 18:13 ` Alan Stern
  0 siblings, 1 reply; 45+ messages in thread
From: James Bottomley @ 2003-04-22 17:37 UTC (permalink / raw)
  To: Andries.Brouwer
  Cc: Alan Cox, greg, SCSI Mailing List, linux-usb-devel, mdharm-scsi,
	mike, torvalds, usb-storage

On Tue, 2003-04-22 at 12:22, Andries.Brouwer@cwi.nl wrote:
[...]

Actually, could this

> Apr  9 17:34:55 lemon: usb-storage: Invoking Mode Translation

Be the root cause?  It indicates that usb storage modified the command.

In 2.5.68 that's doing a translation from MODE SENSE(6) to MODE
SENSE(10) inside the driver.

But the odd thing in usb/storage/protocol.c is this (about line 354):

                case MODE_SENSE:
                case MODE_SELECT:
                        srb->cmd_len = 12;
                        srb->cmnd[11] = 0;
                        srb->cmnd[10] = 0;

Why is a 10 byte command given a command length of 12?

James


^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PATCH: exclude certain commands from emulated SCSI hosts
@ 2003-04-22 19:30 Andries.Brouwer
  2003-04-22 19:41 ` James Bottomley
  0 siblings, 1 reply; 45+ messages in thread
From: Andries.Brouwer @ 2003-04-22 19:30 UTC (permalink / raw)
  To: James.Bottomley, stern
  Cc: Andries.Brouwer, afafc, alan, greg, linux-scsi, linux-usb-devel,
	mdharm-scsi, mike, steliam, torvalds, usb-storage

James writes:

> Why is a 10 byte command given a command length of 12?
> Could this be the root cause?

Alan S. answers:

> No, most likely it's not the cause.

And I agree - here 2.4 and 2.5 do not differ.

Alan continues:

> The error is -EOVERFLOW, which means that the device tried to send back
> more data than we were prepared to receive, i.e., more than 4 bytes.

And again I agree.

That is a pity, because my 4 was arrived at by careful experimentation.
It may mean that there is no uniform length that works.
And no amount of filtering will work, unless we decide
not to use MODE_SENSE at all.

But let us first confirm the theory.

In drivers/scsi/sd.c there is a routine sd_do_mode_sense6().
The theory is that calling that with length 4 causes problems
for some devices. So, could the people with problems try to
add

	if (len < 8)
		len = 8;

directly after

static int
sd_do_mode_sense6(struct scsi_device *sdp, struct scsi_request *SRpnt,
                  int dbd, int modepage, unsigned char *buffer, int len) {
        unsigned char cmd[8];

?

(Maybe try with very large values. like 255 instead of 8, in case
8 does not help.)

Andries

^ permalink raw reply	[flat|nested] 45+ messages in thread
* Re: PATCH: exclude certain commands from emulated SCSI hosts
@ 2003-04-22 19:50 Andries.Brouwer
  0 siblings, 0 replies; 45+ messages in thread
From: Andries.Brouwer @ 2003-04-22 19:50 UTC (permalink / raw)
  To: Andries.Brouwer, James.Bottomley
  Cc: afafc, alan, greg, linux-scsi, linux-usb-devel, mdharm-scsi, mike,
	steliam, stern, torvalds, usb-storage

> we will drop through to the 255 byte request quickly which,
> on the 2.4 evidence, should work.

Yes, on the devices of these three people.
But not on many other devices.

Andries

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2003-04-22 19:39 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20030322193046.A17056@one-eyed-alien.net>
     [not found] ` <20030322193149.B17056@one-eyed-alien.net>
2003-03-23  3:37   ` PATCH: exclude certain commands from emulated SCSI hosts Matthew Dharm
2003-03-23  4:09     ` Linus Torvalds
2003-03-23  7:31       ` Matthew Dharm
2003-03-23  7:39         ` Linus Torvalds
2003-03-23 18:13           ` [usb-storage] " Matthew Dharm
2003-03-24  1:05             ` Douglas Gilbert
2003-03-24  1:26         ` James Bottomley
2003-03-24  1:37           ` Matthew Dharm
2003-03-24  1:39             ` James Bottomley
2003-03-24  7:04               ` Matthew Dharm
2003-03-24 15:15                 ` James Bottomley
2003-03-24 16:29                   ` Linus Torvalds
2003-03-24 16:43                     ` James Bottomley
2003-03-24 16:52                     ` Jens Axboe
2003-03-24 16:56                       ` James Bottomley
2003-03-24 17:30                   ` Matthew Dharm
2003-04-05 15:30                     ` James Bottomley
2003-04-05 19:27                       ` Matthew Dharm
2003-04-05 19:45                         ` James Bottomley
2003-04-05 19:55                           ` Matthew Dharm
2003-04-05 20:08                             ` James Bottomley
2003-04-06  0:20                               ` Matthew Dharm
2003-04-06  0:22                           ` Matthew Dharm
2003-04-06 15:39                             ` James Bottomley
2003-04-07 22:33                       ` Patrick Mansfield
2003-04-07 23:14                         ` James Bottomley
2003-04-08  0:51                           ` Patrick Mansfield
2003-04-20 21:33                       ` Matthew Dharm
2003-04-20 21:35                         ` Matthew Dharm
2003-04-21 16:20                           ` James Bottomley
2003-04-21 17:02                             ` Matthew Dharm
2003-04-21 16:28                         ` James Bottomley
2003-04-21 17:01                           ` Matthew Dharm
2003-04-21 19:23                             ` James Bottomley
2003-04-21 19:35                               ` Matthew Dharm
2003-04-21 21:27                                 ` James Bottomley
2003-04-21 23:37                                   ` Matthew Dharm
2003-04-21 21:28                                 ` Patrick Mansfield
2003-04-21 23:45                                   ` Matthew Dharm
2003-03-24  1:58             ` Linus Torvalds
2003-03-24  6:58               ` Matthew Dharm
2003-04-22 17:37 [usb-storage] " James Bottomley
2003-04-22 18:13 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2003-04-22 19:30 Andries.Brouwer
2003-04-22 19:41 ` James Bottomley
2003-04-22 19:50 Andries.Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox