From: Douglas Gilbert <dougg@torque.net>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
linux-scsi@vger.kernel.org, usb-storage@one-eyed-alien.net,
ronald@kuetemeier.com, dmitrik@users.sourceforge.net,
idan@idanso.dyndns.org
Subject: Re: [PATCH] fix Sony USB mass storage - pass larger receive buffer
Date: Fri, 14 Nov 2003 12:02:05 +1000 [thread overview]
Message-ID: <3FB4379D.3060708@torque.net> (raw)
In-Reply-To: <20031112155029.A20986@beaverton.ibm.com>
Patrick Mansfield wrote:
> James - can you please apply? This should not affect other devices since
> we are not changing the requested length, just the size of the receive
> buffer.
>
> This patch against a recent 2.6 bk fixes problems with Sony USB mass
> storage devices: they are sending back 10 bytes even when we ask for 8
> bytes (USB babble).
>
> Just use a larger receive buffer for MODE SENSE even though we are
> requesting 8 bytes.
>
> Tested by Ronald Kuetemei with his Sony camera, also tested with a USB CF
> card reader.
>
> diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/scsi_lib.c modesense-bufflen-bk-2.5/drivers/scsi/scsi_lib.c
> --- bl-25/drivers/scsi/scsi_lib.c Mon Sep 29 12:21:09 2003
> +++ modesense-bufflen-bk-2.5/drivers/scsi/scsi_lib.c Mon Nov 10 15:42:03 2003
<snip>
>
> + WARN_ON((buf_len < 8) || (buf_len < len));
> + if (buf_len > 255)
> + buf_len = 255;
> + if (len > 255)
> + len = 255;
Patrick,
SPC-3 section 6.25 (REQUEST SENSE command) [spc3r15.pdf]
says the maximum allocation length should be 252 (not
255). They are steering alway from odd numbers and preferring
the next lower modulo 4 number.
<snip>
> if (!scsi_status_is_good(res))
> - res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 255, &data);
> + res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 255, buf_len,
> + &data);
dito
Doug Gilbert
next prev parent reply other threads:[~2003-11-14 2:40 UTC|newest]
Thread overview: 70+ 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
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 [this message]
2003-11-14 21:45 ` Pat LaVarre
-- strict thread matches above, loose matches on Subject: below --
2003-11-13 14:21 Pat LaVarre
2003-11-13 14:28 ` 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=3FB4379D.3060708@torque.net \
--to=dougg@torque.net \
--cc=James.Bottomley@steeleye.com \
--cc=dmitrik@users.sourceforge.net \
--cc=idan@idanso.dyndns.org \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.ibm.com \
--cc=ronald@kuetemeier.com \
--cc=usb-storage@one-eyed-alien.net \
/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).