Re: [PATCH] libata: fix ATA passthrough handling for ATAPI devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tejun Heo wrote:
libata used to pass all SCSI commands directly to ATAPI devices.
However, this is incorrect for ATA passthrough commands as they must
be handled by the SAT layer in libata.  Also, regardless of the
attached ATAPI device's supported packet length, SAT says that both
flavors of passthrough commands (ATA12 and ATA16) should work.

This patch makes the following changes to fix ATA passthrough handling
for ATAPI devices.

* implement atapi_get_xlat_func() and make libata handle ATA12 and
  ATA16 in SAT layer instead of passing it directly to the target
  device even if the device is ATAPI.

* Always allow 16byte CDBs for ATAPI devices.  This makes
  ata_set_port_max_cmd_len() unnecessary and dev->cdb_len meaningless
  for ATA devices.  Both are stripped away.  Note that this doesn't
  breach error checking in any substantial way.  shost->max_cmd_len
  has never beena ble to properly protect CDB length violation anyway.

This problem has been spotted by Doublas Gilbert <dougg@xxxxxxxxxx>.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
Cc: Douglas Gilbert <dougg@xxxxxxxxxx>

Resuming from the thread:

* Regarding CDB length: DEPENDING ON IMPLEMENTATION DETAILS AND HOT PATH IMPACT, I think Douglas's comment about CDB lengths is fair: we could unconditionally set the limit to 16 bytes, and then filter out 16-byte CDBs at a lower level if the ATAPI device doesn't support 16-byte CDBs.

* We need a better solution for the duplicate opcode.

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux