On Sat, 29 May 2004, Tomasz Motylewski wrote:
>
> On Wed, 26 May 2004, Alan Stern wrote:
> > On Wed, 26 May 2004, Tomasz Motylewski wrote:
> > > I would like to ask first whether there is some reliable, recommended
> > > workaround to get writing to such USB/IDE disks? Reading goes very well with a
> > > speed over 30 MB/s. ID: 05e3:0702
> > > EHCI controller Intel 82801DB (ICH4).
> >
> > No, there isn't.
>
> Yes, there is ;-)
>
> diff -ur linux-2.6.7-rc1-bk3/drivers/usb/storage/transport.c
> linux-2.6.7-rc1-bk3-genesys/drivers/usb/storage/transport.c
> --- linux-2.6.7-rc1-bk3/drivers/usb/storage/transport.c 2004-05-29
> 14:43:07.000000000 +0200
> +++ linux-2.6.7-rc1-bk3-genesys/drivers/usb/storage/transport.c 2004-05-29
> 13:51:17.000000000 +0200
> @@ -1008,7 +1008,7 @@
> }
>
> /* did the attempt to read the CSW fail? */
> - if (result == USB_STOR_XFER_STALLED) {
> + if (result == USB_STOR_XFER_STALLED || result == USB_STOR_XFER_SHORT) {
>
> /* get the status again */
> US_DEBUGP("Attempting to get CSW (2nd try)...\n");
>
> It comes from http://www.uwsg.iu.edu/hypermail/linux/kernel/0402.1/0041.html
> The whole patch cited there is included already in linux-2.6.7-rc1 except of
> the last chunk which was critical to get write running. A pity that the patch
> signing system did not work then, I would have known who has dropped it ;-)
I think your history is a little mixed up. That web page includes three
patches, of which I wrote the first two. They are both included in 2.6.6.
I don't remember writing the last chunk, so probably somebody else did it.
It wasn't dropped, because it was never part of the patches that did get
applied. However it does almost the same thing as the second patch on
that page.
If you want, you can try applying the patch below to 2.6.6 or 2.6.7. It
changes the existing code to look for a short CSW rather than a 0-length
CSW. I don't think it's as safe as the existing code, but if it helps
people we'll try to put it in. Judging by other people's logs, though,
I'm not too confident. The problem with Genesys interfaces hasn't been
that they provide a short CSW, it's that they don't send any CSW at all --
they just stop working.
--- usb-2.6/drivers/usb/storage/transport.c Fri May 28 17:09:18 2004
+++ usb-2.6/drivers/usb/storage/transport.c Sat May 29 15:12:27 2004
@@ -997,12 +997,9 @@
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, &cswlen);
- /* Some broken devices add unnecessary zero-length packets to the
- * end of their data transfers. Such packets show up as 0-length
- * CSWs. If we encounter such a thing, try to read the CSW again.
- */
- if (result == USB_STOR_XFER_SHORT && cswlen == 0) {
- US_DEBUGP("Received 0-length CSW; retrying...\n");
+ /* Fix for broken Genesys Logic USB-IDE interface */
+ if (result == USB_STOR_XFER_SHORT) {
+ US_DEBUGP("Received short CSW; retrying...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, &cswlen);
}
> Well, this particular bug was not possible to reproduce. But the whole SCSI-USB
> usb-storage is very unstable when connect/disconnect/reconnect is considered
> (but probably this is what I get for using *-bk* kernels).
Yes. A patch to fix that was recently posted. See
https://lists.one-eyed-alien.net/pipermail/usb-storage/2004-May/000338.html
(Don't worry if your browser complains about invalid certificates.)
> BUT WAIT, it looks that this lsusb crash got logged, I have noticed it just
> now. See below.
Your log shows a combination of problems in usb-storage and in the SCSI
layer. The patch in the web page above should fix usb-storage, and the
SCSI driver has been under revision so it is improved now as well.
> First, even just after reboot, sometimes the USB device is not recognized (I am
> using Debian sid hotplug 0.0.20040329-8 and modutils 2.4.26-1). If I connect is
> the second time then it is USUALLY not recognized (no messages at all). Under
> Windows it looks much better. I have found this to a common complaint when
> searching the net.
Some of the USB hotplugging utilities can be very intrusive and interfere
with normal device operation. One that has been particularly bad is
usbmodules (I think that was the program). If you can disable it maybe
things will work better.
Let me know how your tests go, especially the Genesys change.
Alan Stern
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel