On Sat, 4 Feb 2006 [EMAIL PROTECTED] wrote:

> I have a (cheap and nasty) EM732X MP3 player made by Yifang Digital:
> http://www.yifangdigital.com/Portals/118056c2de4d/40f5a5ace647/c7d06f0150.html
> 
> which doesn't work out of the box on Linux: there are I/O errors on
> read and write. This turns out to be because it can't handle attempts
> to transfer 32KB or more in one go: if /sys/block/sda/device/max_sectors
> is set to 63 then it works; if set to 64 it does not:
> 
> usb-storage: usb_stor_bulk_transfer_sglist: xfer 32768 bytes, 8 entries
> usb-storage: Status code 0; transferred 32768/32768
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x8c R 4294901760 Stat 0x0
> usb-storage: -- unexpectedly short transfer
> usb-storage: scsi cmd done, result=0x10070000
> 
> Note that the Residue here is 0xFFFF0000 -- looks suspiciously to
> me like something overflowing a signed 16 bit int in the device...

Yes, and as far as we can tell from the log, the transfer really did work 
(that is, the data was transferred successfully) even though the residue 
value is wrong.

> Anyway, there's already special casing for some other device with
> a similar problem in slave_configure() in drivers/usb/storage/scsiglue.c,
> and I was just going to write a patch to add this device, but:
> 
>  (1) shouldn't this be rolled into the unusual_devs.h list rather than
>      being hardcoded inside scsiglue.c?
>  (2) the existing special case just checks the Vendor ID, but my device
>      has a vendor ID of 0419, which the webpage says is Samsung --
>      applying the workaround to all Samsung devices seems a bit broad
>      and I wasn't sure how best to narrow it down.

You're right that scsiglue.c should not be changed.

You have two options.  One is just always to set the max_sectors value
whenever the drive is attached (could be automated by writing a hotplug
script).  The other is to create an unusual_devs.h entry with the
IGNORE_RESIDUE flag.  This has the minor disadvantage that the residue
will be ignored even for transfers less than 32 KB, when it might
conceivably be of some value.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to