rpms/kernel/F-7 linux-2.6-ata-call-check-dma-with-qc-prepared.patch, NONE, 1.1 kernel-2.6.spec, 1.3238, 1.3239

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Thu Jun 28 21:05:15 UTC 2007


Author: cebbert

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

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-ata-call-check-dma-with-qc-prepared.patch 
Log Message:
* Thu Jun 28 2007 Chuck Ebbert <cebbert at redhat.com>
- libata: call ata_check_atapi_dma() with qc better prepared


linux-2.6-ata-call-check-dma-with-qc-prepared.patch:

--- NEW FILE linux-2.6-ata-call-check-dma-with-qc-prepared.patch ---
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e00f1ff3c8977eff07d0214d2f3478ac947bda0f
Commit:     e00f1ff3c8977eff07d0214d2f3478ac947bda0f
Parent:     914616a3c2a54504f3b0eda0b67fcd32226b3e83
Author:     Tejun Heo <htejun at gmail.com>
AuthorDate: Wed Jun 27 02:47:35 2007 +0900
Committer:  Jeff Garzik <jeff at garzik.org>
CommitDate: Wed Jun 27 02:50:08 2007 -0400

    libata: call ata_check_atapi_dma() with qc better prepared
    
    In atapi_xlat(), prepare qc better before calling
    ata_check_atapi_dma() such that ata_check_atapi_dma() can use info
    from qc.  While at it, reformat weird looking if/else block in the
    function.
    
    Signed-off-by: Tejun Heo <htejun at gmail.com>
    Signed-off-by: Jeff Garzik <jeff at garzik.org>
---
 drivers/ata/libata-scsi.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index c228df2..4ddf00c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2373,11 +2373,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
 	int using_pio = (dev->flags & ATA_DFLAG_PIO);
 	int nodata = (scmd->sc_data_direction == DMA_NONE);
 
-	if (!using_pio)
-		/* Check whether ATAPI DMA is safe */
-		if (ata_check_atapi_dma(qc))
-			using_pio = 1;
-
 	memset(qc->cdb, 0, dev->cdb_len);
 	memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len);
 
@@ -2390,19 +2385,22 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
 	}
 
 	qc->tf.command = ATA_CMD_PACKET;
+	qc->nbytes = scmd->request_bufflen;
+
+	/* check whether ATAPI DMA is safe */
+	if (!using_pio && ata_check_atapi_dma(qc))
+		using_pio = 1;
 
-	/* no data, or PIO data xfer */
 	if (using_pio || nodata) {
+		/* no data, or PIO data xfer */
 		if (nodata)
 			qc->tf.protocol = ATA_PROT_ATAPI_NODATA;
 		else
 			qc->tf.protocol = ATA_PROT_ATAPI;
 		qc->tf.lbam = (8 * 1024) & 0xff;
 		qc->tf.lbah = (8 * 1024) >> 8;
-	}
-
-	/* DMA data xfer */
-	else {
+	} else {
+		/* DMA data xfer */
 		qc->tf.protocol = ATA_PROT_ATAPI_DMA;
 		qc->tf.feature |= ATAPI_PKT_DMA;
 
@@ -2411,8 +2409,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
 			qc->tf.feature |= ATAPI_DMADIR;
 	}
 
-	qc->nbytes = scmd->request_bufflen;
-
 	return 0;
 }
 


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3238
retrieving revision 1.3239
diff -u -r1.3238 -r1.3239
--- kernel-2.6.spec	28 Jun 2007 16:32:29 -0000	1.3238
+++ kernel-2.6.spec	28 Jun 2007 21:04:37 -0000	1.3239
@@ -643,6 +643,7 @@
 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
+Patch2214: linux-2.6-ata-call-check-dma-with-qc-prepared.patch
 
 # ATA spindown
 Patch2220: linux-2.6-2110_scsi-sd-printing.patch
@@ -1457,6 +1458,8 @@
 %patch2212 -p1
 # libata: use PIO when xfer is not a multiple of 16
 %patch2213 -p1
+# libata: call check_dma with qc better prepared
+%patch2214 -p1
 
 # ATA spindown
 %patch2220 -p1
@@ -2460,6 +2463,9 @@
 
 %changelog
 * Thu Jun 28 2007 Chuck Ebbert <cebbert at redhat.com>
+- libata: call ata_check_atapi_dma() with qc better prepared
+
+* 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)
 




More information about the fedora-extras-commits mailing list