On Tue, 20 Nov 2007, RTE wrote: > On Mon, 19 Nov 2007 23:17:17 +0300, Alan Stern wrote: > > > Below is another test patch for 2.6.17-git22. It includes new code to > > try and fix the problem. > > it works :) > no errors in the copied data
Great! Okay, here's a version of the patch for 2.6.23 and without the debugging information. It ought to work just as well as the previous patch. If it does work, I will submit it for inclusion in 2.6.24. However after testing this patch there's something else you should try. In the logs it looks as though your device wants to have max_sectors <= 188, instead of the default value 240. To learn more about max_sectors, see http://www.linux-usb.org/FAQ.html#i5 My guess is that if you decrease max_sectors to 184 (to make it a multiple of 8) then the device will work without errors, even when the patch isn't present. Alan Stern --- 2.6.23/drivers/scsi/sd.c2 2007-11-20 16:14:04.000000000 -0500 +++ 2.6.23/drivers/scsi/sd.c 2007-11-20 16:16:05.000000000 -0500 @@ -962,7 +962,17 @@ /* This computation should always be done in terms of * the resolution of the device's medium. */ - good_bytes = (bad_lba - start_lba)*SCpnt->device->sector_size; + if (start_lba <= bad_lba && bad_lba < start_lba + + (xfer_size / SCpnt->device->sector_size)) + good_bytes = SCpnt->device->sector_size * + (unsigned int) (bad_lba - start_lba); + + /* If the bad_lba value is no good, maybe the residue value + * is better. + */ + else if (SCpnt->resid > 0 && SCpnt->resid < xfer_size) + good_bytes = (xfer_size - SCpnt->resid) & + (- SCpnt->device->sector_size); break; case RECOVERED_ERROR: case NO_SENSE: ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users