Myson Century USB enclosure problem
Quoted 4 lines · Matthew Dharm
Do you have MD or other advanced partition features turned on? If so, turning them off might help.
Matt
That could well help, but it doesn't solve the underlying problem. I've thought for a long time that this could bite someone, but it's the first time I've seen an actual example.
When asked to read the last 8 sectors on the disk, your drive returned all but the last 64 bytes of data and then for some reason complained that the command was invalid (it wasn't). The SCSI core retried exactly the same command, and the second time it succeeded. But meanwhile the SCSI core thought the error message indicated that the drive prefers 6-byte READ/WRITE commands instead of the ususal 10-byte form. So it switched over to using 6-byte commands, and from then on the drive didn't work at all.
The patch below is a first step toward correcting the problem. It makes the SCSI core revert back to using the 10-byte commands when the 6-byte version gets an error. This isn't a final solution, because there's a possibility it could lead to an infinite retry loop if the drive doesn't like either the 6- or 10-byte command form. But at least it's a start.
Alan Stern
drivers/scsi/scsi_lib.c +10 -0
@@ -894,6 +894,16 @@*/ scsi_requeue_command (q, cmd); result =0 ; + }else if (!cmd->device->use_10_for_rw && + (cmd->cmnd[0 ] ==READ_6 || + cmd->cmnd[0 ] ==WRITE_6 )) { + cmd->device->use_10_for_rw =1 ; +/* +* This will cause a retry with a 10-byte +* command. +*/ +scsi_requeue_command (q, cmd); + result =0 ; }else {scsi_end_request (cmd,0 , this_count,1 );return ;
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users
Quoted 5 lines · In gmane.linux.usb.user Alan Stern
The patch below is a first step toward correcting the problem. It makes the SCSI core revert back to using the 10-byte commands when the 6-byte version gets an error. This isn't a final solution, because there's a possibility it could lead to an infinite retry loop if the drive doesn't like either the 6- or 10-byte command form. But at least it's a start.
Thanks for the patch and the explanation. I have applied the patch and posted the usb-storage debug output in the same directory.
http://www.cs.pdx.edu/~cklin/usb-error/
The kernel still failed to read the partition table. However, to my untrained eyes, the log indicates that the SCSI core did revert back to 10-byte commands, so we are making progress.
Thanks,
Signature · 14 lines
Chuan-kai Lin http://www.cs.pdx.edu/~cklin/ ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
Quoted 8 lines · Chuan-kai Lin
Thanks for the patch and the explanation. I have applied the patch and posted the usb-storage debug output in the same directory.
http://www.cs.pdx.edu/~cklin/usb-error/
The kernel still failed to read the partition table. However, to my untrained eyes, the log indicates that the SCSI core did revert back to 10-byte commands, so we are making progress.
It did switch back, and as far as the log shows, everything is now working correctly. That error message about "unable to read partition table" is misleading; the kernel _was_ able to read the partition table. It just wasn't able to understand the contents. You may need to run fdisk to check and reinitialize the partition table.
Alan Stern