Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 175

kernel-2.6.18-238.el5.src.rpm

From: David Milburn <dmilburn@redhat.com>
Date: Wed, 18 Aug 2010 23:59:42 -0400
Subject: [ata] sata_mv: don't issue two DMA commands concurrently
Message-id: <1282175987-21696-5-git-send-email-dmilburn@redhat.com>
Patchwork-id: 27693
O-Subject: [RHEL5.6 PATCH 4/9] BZ 554872 sata_mv: don't issue two DMA commands
	concurrently
Bugzilla: 554872
RH-Acked-by: Jeff Garzik <jgarzik@redhat.com>

commit 4bdee6c5103696a2729d3db2f235d202191788e4
Author: Tejun Heo <htejun@gmail.com>
Date:   Wed Aug 13 20:24:16 2008 +0900

    sata_mv: don't issue two DMA commands concurrently

BZ 554872

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 8de88ad..d1815be 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1130,30 +1130,16 @@ static int mv_qc_defer(struct ata_queued_cmd *qc)
 	if (ap->nr_active_links == 0)
 		return 0;
 
-	if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) {
-		/*
-		 * The port is operating in host queuing mode (EDMA).
-		 * It can accomodate a new qc if the qc protocol
-		 * is compatible with the current host queue mode.
-		 */
-		if (pp->pp_flags & MV_PP_FLAG_NCQ_EN) {
-			/*
-			 * The host queue (EDMA) is in NCQ mode.
-			 * If the new qc is also an NCQ command,
-			 * then allow the new qc.
-			 */
-			if (qc->tf.protocol == ATA_PROT_NCQ)
-				return 0;
-		} else {
-			/*
-			 * The host queue (EDMA) is in non-NCQ, DMA mode.
-			 * If the new qc is also a non-NCQ, DMA command,
-			 * then allow the new qc.
-			 */
-			if (qc->tf.protocol == ATA_PROT_DMA)
-				return 0;
-		}
-	}
+	/*
+	 * The port is operating in host queuing mode (EDMA) with NCQ
+	 * enabled, allow multiple NCQ commands.  EDMA also allows
+	 * queueing multiple DMA commands but libata core currently
+	 * doesn't allow it.
+	 */
+	if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) &&
+	    (pp->pp_flags & MV_PP_FLAG_NCQ_EN) && ata_is_ncq(qc->tf.protocol))
+		return 0;
+
 	return ATA_DEFER_PORT;
 }