From e52dcc4899cf1b7601379c31542bd91cd2997a64 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 2 Apr 2008 17:35:19 +0900 Subject: [PATCH] libata: ATA_12/16 doesn't fall into ATAPI_MISC SAT passthrus don't really fit into ATAPI_MISC class. SAT passthru commands always transfer multiple of 512 bytes and variable length response is not allowed. This patch creates a separate category - ATAPI_PASS_THRU - for these. This fixes HSM violation on "hdparm -I". Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/ata/libata-core.c | 5 +++++ include/linux/libata.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e9b69ba489d2..be95fdb69726 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -353,6 +353,11 @@ int atapi_cmd_type(u8 opcode) case GPCMD_READ_CD_MSF: return ATAPI_READ_CD; + case ATA_16: + case ATA_12: + if (atapi_passthru16) + return ATAPI_PASS_THRU; + /* fall thru */ default: return ATAPI_MISC; } diff --git a/include/linux/libata.h b/include/linux/libata.h index 92c64909ed25..37ee881c42ac 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -350,7 +350,8 @@ enum { ATAPI_READ = 0, /* READs */ ATAPI_WRITE = 1, /* WRITEs */ ATAPI_READ_CD = 2, /* READ CD [MSF] */ - ATAPI_MISC = 3, /* the rest */ + ATAPI_PASS_THRU = 3, /* SAT pass-thru */ + ATAPI_MISC = 4, /* the rest */ }; enum ata_xfer_mask { -- 2.20.1