All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH #upstream-fixes 2/2] libata: ATA_12/16 doesn't fall into ATAPI_MISC
Date: Wed, 02 Apr 2008 17:35:19 +0900	[thread overview]
Message-ID: <47F34547.7040601@gmail.com> (raw)
In-Reply-To: <47F343BE.4030103@gmail.com>

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 <htejun@gmail.com>
---
 drivers/ata/libata-core.c |    5 +++++
 include/linux/libata.h    |    3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: work1/drivers/ata/libata-core.c
===================================================================
--- work1.orig/drivers/ata/libata-core.c
+++ work1/drivers/ata/libata-core.c
@@ -412,6 +412,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;
 	}
Index: work1/include/linux/libata.h
===================================================================
--- work1.orig/include/linux/libata.h
+++ work1/include/linux/libata.h
@@ -347,7 +347,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 {

  reply	other threads:[~2008-04-02  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02  8:28 [PATCH #upstream-fixes 1/2] libata: uninline atapi_cmd_type() Tejun Heo
2008-04-02  8:35 ` Tejun Heo [this message]
2008-04-04  6:47 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47F34547.7040601@gmail.com \
    --to=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.