linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Linux IDE <linux-ide@vger.kernel.org>, Doug Maxey <dwm@enoyolf.org>
Subject: [PATCH 2/6] libata: support PIO multi commands
Date: Thu, 07 Jun 2007 15:49:22 +0800	[thread overview]
Message-ID: <4667B882.6080606@tw.ibm.com> (raw)
In-Reply-To: <4667B767.5060601@tw.ibm.com>

Patch 2/6:
  support the pass through of PIO multi commands.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---

diff -Nrup 01_protocol_update/drivers/ata/libata-scsi.c 02_pio_multi/drivers/ata/libata-scsi.c
--- 01_protocol_update/drivers/ata/libata-scsi.c	2007-06-07 11:38:50.000000000 +0800
+++ 02_pio_multi/drivers/ata/libata-scsi.c	2007-06-07 11:38:53.000000000 +0800
@@ -2551,10 +2551,6 @@ static unsigned int ata_scsi_pass_thru(s
 	if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0)
 		goto invalid_fld;
 
-	if (cdb[1] & 0xe0)
-		/* PIO multi not supported yet */
-		goto invalid_fld;
-
 	/*
 	 * 12 and 16 byte CDBs use different offsets to
 	 * provide the various register values.
@@ -2606,6 +2602,22 @@ static unsigned int ata_scsi_pass_thru(s
 		tf->device = qc->dev->devno ?
 			tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1;
 
+	/* sanity check for pio multi commands */
+	if ((cdb[1] & 0xe0) && !is_multi_taskfile(tf))
+		goto invalid_fld;
+
+	if (is_multi_taskfile(tf)) {
+		unsigned int multi_count = 1 << (cdb[1] >> 5);
+
+		/* compare the passed through multi_count
+		 * with the cached multi_count of libata
+		 */
+		if (multi_count != dev->multi_count)
+			ata_dev_printk(dev, KERN_WARNING,
+				       "invalid multi_count %u ignored\n",
+				       multi_count);
+	}	
+
 	/* READ/WRITE LONG use a non-standard sect_size */
 	qc->sect_size = ATA_SECT_SIZE;
 	switch (tf->command) {
diff -Nrup 01_protocol_update/include/linux/ata.h 02_pio_multi/include/linux/ata.h
--- 01_protocol_update/include/linux/ata.h	2007-06-01 12:08:32.000000000 +0800
+++ 02_pio_multi/include/linux/ata.h	2007-06-06 13:34:05.000000000 +0800
@@ -249,7 +249,7 @@ enum ata_tf_protocols {
 	/* ATA taskfile protocols */
 	ATA_PROT_UNKNOWN,	/* unknown/invalid */
 	ATA_PROT_NODATA,	/* no data */
-	ATA_PROT_PIO,		/* PIO single sector */
+	ATA_PROT_PIO,		/* PIO data xfer */
 	ATA_PROT_DMA,		/* DMA */
 	ATA_PROT_NCQ,		/* NCQ */
 	ATA_PROT_ATAPI,		/* packet command, PIO data xfer*/



  parent reply	other threads:[~2007-06-07  7:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07  7:44 [PATCH 0/6] libata: ATA passthru fixes Albert Lee
2007-06-07  7:47 ` [PATCH 1/6] libata: update protocol numbers Albert Lee
2007-06-10  2:46   ` Jeff Garzik
2007-06-10  3:12   ` Jeff Garzik
2007-06-10 22:31     ` Mark Lord
2007-06-15 14:45       ` Jeff Garzik
2007-06-07  7:49 ` Albert Lee [this message]
2007-06-07  7:50 ` [PATCH 3/6] libata: map UDMA protocols Albert Lee
2007-06-07  7:52 ` [PATCH 4/6] libata: always enforce correct DEV bit Albert Lee
2007-06-07  7:59 ` [PATCH 5/6] libata: support ATAPI devices Albert Lee
2007-06-07  8:01 ` [PATCH 6/6] libata: update cached device paramters Albert Lee

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=4667B882.6080606@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=albertl@mail.com \
    --cc=dwm@enoyolf.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).