On Sun, 2014-05-11 at 00:43 +0800, loody wrote: > hi James: > > > 2014-05-10 23:10 GMT+08:00 James Bottomley > <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>: > > On Sat, 2014-05-10 at 22:38 +0800, loody wrote: > >> hi all: > >> I have a USB hard disk and when I play specific file. > >> it will show below message > >> ( I purpose enable usb/storage/transport.c debug message about urb debug) > >> what makes me confused are > >> 1. Does " Unhandled sense code" mean the " SCSI Request Sense" command? > > > > Error handling couldn't correct the error so it was passed up. > > > >> 2. if #1 is correct, there should be any error handling for not keep > >> sending following commands. Why usb driver keep clear this halt > >> enpoint? > >> isn't there any timeout mechanism no matter in scsi layer or usb layer? > >> > >> appreciate your help > >> > >> > >> [22:06:48]clearing endpoint halt for pipe 0xc0008280 > >> [22:06:48]sd 0:0:0:0: [sda] Unhandled sense code > >> [22:06:48]sd 0:0:0:0: [sda] Result: hostbyte=0x10 driverbyte=0x08 > >> [22:06:48]sd 0:0:0:0: [sda] Sense Key : 0x3 [current] > >> [22:06:48]sd 0:0:0:0: [sda] ASC=0x11 ASCQ=0x0 > >> [22:06:48]sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 24 42 22 00 00 f0 00 > >> [22:06:48]end_request: critical target error, dev sda, sector 2376226 > > > > If you compiled your kernel with SCSI messages it would tell you that > > this is a medium error, unrecovered read error in sector 2376226 > > > > The device is failing and the sector cannot be recovered. > in my opinion, the OS will not hang up when this problem happen, right? > But my platform is always trying to clear halt endpoint, and it seems > Block or File system layer still try to access this sector. That depends on what's being done and the configuration of the layers above. For this error SCSI passes up as fast as possible. The log implied some churn below in USB. On a real FS, the page should eventually be marked as error, which should cause this to stop, but there are a variety of daemons which poke the disk, it could be one of them. > is that related to file node open method or file read method? > such that read bad sector will hang up the OS. Depends, it's definitely possible to trigger repeat behaviour with a DIO read because there's no memory of the error in the page cache. There may be other ways. James -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html