diff options
author | Alan Cox <alan@redhat.com> | 2008-08-01 04:18:34 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-22 02:27:49 -0400 |
commit | b15b3ebae102f89c25ccbcae0b2099af312f2e82 (patch) | |
tree | 73f64d0e578d1c6bc6a3dc43f940a31f24daad8f /drivers/ata/pata_oldpiix.c | |
parent | 20e2de4a505aa02131a95665e8920eb053fce686 (diff) |
libata: Fix a large collection of DMA mode mismatches
Dave Müller sent a diff for the pata_oldpiix that highlighted a problem
where a lot of the ATA drivers assume dma_mode == 0 means "no DMA" while
the core code uses 0xFF.
This turns out to have other consequences such as code doing >= XFER_UDMA_0
also catching 0xFF as UDMAlots. Fortunately it doesn't generally affect
set_dma_mode, although some drivers call back into their own set mode code
from other points.
Having been through the drivers I've added helpers for using_udma/using_mwdma
dma_enabled so that people don't open code ranges that may change (eg if UDMA8
appears somewhere)
Thanks to David for the initial bits
[and added fix for pata_oldpiix from and signed-off-by Dave Mueller
<dave.mueller@gmx.ch> -jg]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_oldpiix.c')
-rw-r--r-- | drivers/ata/pata_oldpiix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c index e678af383d13..df64f2443001 100644 --- a/drivers/ata/pata_oldpiix.c +++ b/drivers/ata/pata_oldpiix.c | |||
@@ -198,7 +198,7 @@ static unsigned int oldpiix_qc_issue(struct ata_queued_cmd *qc) | |||
198 | 198 | ||
199 | if (adev != ap->private_data) { | 199 | if (adev != ap->private_data) { |
200 | oldpiix_set_piomode(ap, adev); | 200 | oldpiix_set_piomode(ap, adev); |
201 | if (adev->dma_mode) | 201 | if (ata_dma_enabled(adev)) |
202 | oldpiix_set_dmamode(ap, adev); | 202 | oldpiix_set_dmamode(ap, adev); |
203 | } | 203 | } |
204 | return ata_sff_qc_issue(qc); | 204 | return ata_sff_qc_issue(qc); |