> ----- Original Message ----- > Date: Wed, 4 May 2005 10:54:16 -0400 (EDT) > From: Alan Stern <[EMAIL PROTECTED]> > To: Gregory SCHMITT <[EMAIL PROTECTED]> > Cc: USB development list <linux-usb-devel@lists.sourceforge.net>
> Subject: Re: [linux-usb-devel] Data corruption on usb key > On Tue, 3 May 2005, Grégory SCHMITT wrote: > > > Hello, > > > > I have a no-name USB mp3 player coming with 128 MB. > > > > Vendor: Winbond Electronics Corp. 0x0416 > > Product: CT986 0xc986 > > > > It works fine under windows: sometimes data corruption will occur, but > > that remains rare and reading/writing speed is decent. > > > > Pluging it the first time under linux didn't work at all. A lot of > > errors like "SCSI error : <0 0 0 0> return code = 0x10070000". > > Partition table wasn't recognized at all. > > > > It was natively not working with kernel 2.6.11, so I decided to hack > > the unusual_devs.h. I added those line: > > > > UNUSUAL_DEV(0x0416, 0xc986, 0x0100, 0x0100, > > "Winbond Electronics Corp.", > > "CT986", > > US_SC_DEVICE, > > US_PR_BULK, > > NULL, > > US_FL_IGNORE_RESIDUE | US_FL_FIX_INQUIRY | US_FL_NEED_OVERRIDE), > > > > All switches are required, device seems to accept only Bulk according > > to the Windows driver. > > The switches are _not_ all required. Instead of US_PR_BULK you should > have US_PR_DEVICE, and you should omit US_FL_NEED_OVERRIDE. > > Also I doubt that US_FL_FIX_INQUIRY is needed. To justify having it, you > should post usb-storage verbose debugging logs showing what happens when > you plug in the device, both with and without the FIX_INQUIRY flag > present. Well, without US_PR_BULK and US_FL_NEED_OVERRIDE, I cannot access the partition table (fdisk will always fail), so I don't even have access to sda1. US_FL_FIX_INQUIRY has proven to be useful to display the vendor & product information in the dmesg log. > > Adding those lines helped a lot: key is recognized correctly (sda1), and > > reading files is fine. > > > > However, writing always fails, with such error messages (tons of them): > > > > SCSI error : <0 0 0 0> return code = 0x10070000 > > end_request: I/O error, dev sda, sector 400 > > Buffer I/O error on device sda1, logical block 0 > > > > (sector and logical block changing in each message). > > > > I tried to add the "sync" option in the fstab, and it wil copy files, > > but for no more than 2048 bytes. > > > > I tried to decrease the max_sectors to 8, helped only for littles > > files. Bigger files will be corrupted. > > > > I tried latest patch regarding ignoring residue for read and write > > operations, it somehow helped as all those error message are gone and > > files are copied without problem, but it is horribly slow (transfer > > rate around 20 kb/s at best), which makes mp3 transfers a real pain. > > > > Any idea ? Will 2.6.12 provide a solution ? > > It sounds like the ignore-residue-for-writes patch fixed your problem. > The patch will be included in 2.6.12. The reason for the your slow > transfers is probably that you are still using the "sync" option. I tried to remove the sync option. Data will be corrupted on the key, even with the patch, though no error messages appear in the log. Putting a low value (like 16) for max-sectors seems to help, but transfers are so slow... -- Grégory SCHMITT <mailto:[EMAIL PROTECTED]> ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel