rpms/kernel/F-7 linux-2.6-ata-use-pio-for-non-16-byte-xfers.patch, NONE, 1.1 kernel-2.6.spec, 1.3237, 1.3238

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Thu Jun 28 16:33:04 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15330

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-ata-use-pio-for-non-16-byte-xfers.patch 
Log Message:
* Thu Jun 28 2007 Chuck Ebbert <cebbert at redhat.com>
- libata: use PIO when xfer is not a multiple of 16
  (should fix failure to IDENTIFY, e.g. bz #245669)


linux-2.6-ata-use-pio-for-non-16-byte-xfers.patch:

--- NEW FILE linux-2.6-ata-use-pio-for-non-16-byte-xfers.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9a4197e266a40d5d1d16c9fb2a852cf10743afe
Commit:     b9a4197e266a40d5d1d16c9fb2a852cf10743afe
Parent:     e00f1ff3c8977eff07d0214d2f3478ac947bda0f
Author:     Tejun Heo <htejun at gmail.com>
AuthorDate: Wed Jun 27 02:48:43 2007 +0900
Committer:  Jeff Garzik <jeff at garzik.org>
CommitDate: Wed Jun 27 02:50:08 2007 -0400

    libata: use PIO for non-16 byte aligned ATAPI commands
    
    The IDE driver used DMA for ATAPI commands if READ/WRITE command is
    multiple of sector size or sg command is multiple of 16 bytes.  For
    libata, READ/WRITE sector alignment is guaranteed by the high level
    driver (sr), so we only have to worry about the 16 byte alignment.
    
    This patch makes ata_check_atapi_dma() always request PIO for all data
    transfer commands which are not multiple of 16 bytes.
    
    The following reports are related to this problem.
    
    http://bugzilla.kernel.org/show_bug.cgi?id=8605		(confirmed)
    http://thread.gmane.org/gmane.linux.kernel/476620	(confirmed)
    https://bugzilla.novell.com/show_bug.cgi?id=229260	(probably)
    
    Albert first pointed out the difference between IDE and libata.  Kudos
    to him.
    
    Signed-off-by: Tejun Heo <htejun at gmail.com>
    Cc: Albert Lee <albertcc at tw.ibm.com>
    Signed-off-by: Jeff Garzik <jeff at garzik.org>
    [cebbert at redhat.com: removed extraneous whitespace change for -stable]
---
 drivers/ata/libata-core.c |   33 ++++++++++-----------------------
 1 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 642097a..094b518 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3900,33 +3900,19 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
 int ata_check_atapi_dma(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	int rc = 0; /* Assume ATAPI DMA is OK by default */
-
-	/* some drives can only do ATAPI DMA on read/write */
-	if (unlikely(qc->dev->horkage & ATA_HORKAGE_DMA_RW_ONLY)) {
-		struct scsi_cmnd *cmd = qc->scsicmd;
-		u8 *scsicmd = cmd->cmnd;
-
-		switch (scsicmd[0]) {
-		case READ_10:
-		case WRITE_10:
-		case READ_12:
-		case WRITE_12:
-		case READ_6:
-		case WRITE_6:
-			/* atapi dma maybe ok */
-			break;
-		default:
-			/* turn off atapi dma */
-			return 1;
-		}
-	}
+
+	/* Don't allow DMA if it isn't multiple of 16 bytes.  Quite a
+	 * few ATAPI devices choke on such DMA requests.
+	 */
+	if (unlikely(qc->nbytes & 15))
+		return 1;
 
 	if (ap->ops->check_atapi_dma)
-		rc = ap->ops->check_atapi_dma(qc);
+		return ap->ops->check_atapi_dma(qc);
 
-	return rc;
+	return 0;
 }
+
 /**
  *	ata_qc_prep - Prepare taskfile for submission
  *	@qc: Metadata associated with taskfile to be prepared


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3237
retrieving revision 1.3238
diff -u -r1.3237 -r1.3238
--- kernel-2.6.spec	27 Jun 2007 22:10:24 -0000	1.3237
+++ kernel-2.6.spec	28 Jun 2007 16:32:29 -0000	1.3238
@@ -642,6 +642,7 @@
 Patch2210: linux-2.6-libata-pata-sis-fix-timing.patch
 Patch2211: linux-2.6-libata-setxfer.patch
 Patch2212: linux-2.6-libata_ali_max_dma_speed.patch
+Patch2213: linux-2.6-ata-use-pio-for-non-16-byte-xfers.patch
 
 # ATA spindown
 Patch2220: linux-2.6-2110_scsi-sd-printing.patch
@@ -1454,6 +1455,8 @@
 %patch2211 -p1
 # pata_ali: limit DMA speeds
 %patch2212 -p1
+# libata: use PIO when xfer is not a multiple of 16
+%patch2213 -p1
 
 # ATA spindown
 %patch2220 -p1
@@ -2456,6 +2459,10 @@
 %endif
 
 %changelog
+* Thu Jun 28 2007 Chuck Ebbert <cebbert at redhat.com>
+- libata: use PIO when xfer is not a multiple of 16
+  (should fix failure to IDENTIFY, e.g. bz #245669)
+
 * Wed Jun 27 2007 Chuck Ebbert <cebbert at redhat.com>
 - detect AMD svm disabled by BIOS (BZ #242765)
 




More information about the fedora-extras-commits mailing list