sata_mv: don't issue two DMA commands concurrently

sata_mv allowed issuing two DMA commands concurrently which the
hardware allows.  Unfortunately, libata core layer isn't ready for
this yet and spews ugly warning message and malfunctions on this.
Don't allow concurrent DMA commands for now.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Tejun Heo 2008-08-13 20:24:16 +09:00 committed by Jeff Garzik
parent 05944bdf6f
commit 4bdee6c510

View file

@ -1134,30 +1134,16 @@ static int mv_qc_defer(struct ata_queued_cmd *qc)
if (ap->nr_active_links == 0) if (ap->nr_active_links == 0)
return 0; return 0;
if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { /*
/* * The port is operating in host queuing mode (EDMA) with NCQ
* The port is operating in host queuing mode (EDMA). * enabled, allow multiple NCQ commands. EDMA also allows
* It can accomodate a new qc if the qc protocol * queueing multiple DMA commands but libata core currently
* is compatible with the current host queue mode. * doesn't allow it.
*/ */
if (pp->pp_flags & MV_PP_FLAG_NCQ_EN) { if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) &&
/* (pp->pp_flags & MV_PP_FLAG_NCQ_EN) && ata_is_ncq(qc->tf.protocol))
* The host queue (EDMA) is in NCQ mode. return 0;
* 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;
}
}
return ATA_DEFER_PORT; return ATA_DEFER_PORT;
} }