|
From: Bart V. A. <bva...@ac...> - 2012-02-25 10:05:14
|
On Wed, Feb 22, 2012 at 2:47 AM, Vladislav Bolkhovitin <vs...@vl...> wrote: > There's no print_hex_dump() in your patch, but it isn't needed. Attached is > example of the warnings taken with "scsi" logging enabled. > Thanks for making that log available. I've found the following in the log you provided: Feb 21 21:41:41 tgt kernel: [440106.795994] [11315]: scst: scst_parse_cmd:761:Warning: expected transfer length 512 for opcode 0x85 (handler vdisk_nullio, target scst_local) doesn't match decoded value 0 Feb 21 21:41:41 tgt kernel: [440106.796038] [11315]: scst_parse_cmd:763:Suspicious CDB: Feb 21 21:41:41 tgt kernel: [440106.796055] (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F Feb 21 21:41:41 tgt kernel: [440106.796071] 0: 85 08 2e 00 00 00 00 00 00 00 00 00 00 40 ec 00 .............@.. According to SAT-3 r02, the meaning of that CDB is as follows: * [0] 0x85: ATA PASS-THROUGH (16) * [1] 0x08: MULTIPLE_COUNT = 0; PROTOCOL = 4; EXTEND = 0 * [2] 0x2E: OFF_LINE = 0; CK_COND = 1; T_TYPE = 0; T_DIR = 1; BYTE_BLOCK = 1; T_LENGTH = 2 * [3, 4] 0x0000: FEATURES = 0 * [5, 6] 0x0000: SECTOR_COUNT = 0 * [7, 8] 0x0000: LBA_LOW = 0 * [9, 10] 0x0000: LBA_MID = 0 * [11, 12] 0x0000: LBA_HIGH = 0 * [13] 0x40: DEVICE = 0x40 * [14] 0xEC: COMMAND = 0xEC * [15] 0x00: CONTROL = 0 According to table 133 the combination (BYTE_BLOCK == 1 && T_TYPE == 0 && T_LENGTH != 0) means that the transfer length is specified as a number of 512 byte blocks. And according to table 134 T_LENGTH == 2 means that the transfer length is specified in the SECTOR_COUNT field. That field is zero. So if I interpret SAT-3 correctly, the ATA PASS-THROUGH patch I posted decoded the transfer length correctly for this command. Note: according to what I've found in the ATA spec command 0xEC stands for IDENTIFY DEVICE and sends back 512 bytes data from the device to the host. My conclusion is that for this particular case the Linux kernel generated an incorrect ATA pass-through CDB. Note: I've encountered more strange results for ATA PASS-THROUGH recently. As an example, it doesn't look correct to me that the transfer length is set to eight bytes for a TEST UNIT READY command. Does that mean something is wrong with the ATA pass-through implementation in Linux ? This is what I found in the system log: [7849]: scst: scst_parse_cmd:761:Warning: expected transfer length 8 for opcode 0x00 (handler vcdrom, target scst_local) doesn't match decoded value 0 [7849]: scst_parse_cmd:763:Suspicious CDB: (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F 0: 00 00 00 00 00 00 ...... Bart. |