aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-09-26 10:23:17 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:42 -0400
commit06b74dd28fa607249c5e41e5f1f6dd1885fe0a0d (patch)
tree04312f14d7117251d2ffdc51e966bedb9d664467 /drivers/ata
parent21d2c925d3da6aabf9a0b34e95787202379f682a (diff)
pata_pdc202xx_old MWDMA fixes, and notes
I've been doing an audit of this driver to try and find out why we have problems with some Clevo boxes that use it. Didn't get anywhere other than to discover all the bug reporters I have use vmware, which may or may not be chance. In the process however I did find out our MWDMA2 performance was a bit low and code review showed the MWDMA0/2 timings are reversed due to a thinko in the table ordering Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_pdc202xx_old.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index fd4350029bc4..65d951618c60 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -9,7 +9,7 @@
9 * First cut with LBA48/ATAPI 9 * First cut with LBA48/ATAPI
10 * 10 *
11 * TODO: 11 * TODO:
12 * Channel interlock/reset on both required 12 * Channel interlock/reset on both required ?
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -22,7 +22,7 @@
22#include <linux/libata.h> 22#include <linux/libata.h>
23 23
24#define DRV_NAME "pata_pdc202xx_old" 24#define DRV_NAME "pata_pdc202xx_old"
25#define DRV_VERSION "0.4.2" 25#define DRV_VERSION "0.4.3"
26 26
27static int pdc2026x_cable_detect(struct ata_port *ap) 27static int pdc2026x_cable_detect(struct ata_port *ap)
28{ 28{
@@ -106,9 +106,9 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
106 { 0x20, 0x01 } 106 { 0x20, 0x01 }
107 }; 107 };
108 static u8 mdma_timing[3][2] = { 108 static u8 mdma_timing[3][2] = {
109 { 0x60, 0x03 },
110 { 0x60, 0x04 },
111 { 0xe0, 0x0f }, 109 { 0xe0, 0x0f },
110 { 0x60, 0x04 },
111 { 0x60, 0x03 },
112 }; 112 };
113 u8 r_bp, r_cp; 113 u8 r_bp, r_cp;
114 114
@@ -139,6 +139,9 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
139 * 139 *
140 * In UDMA3 or higher we have to clock switch for the duration of the 140 * In UDMA3 or higher we have to clock switch for the duration of the
141 * DMA transfer sequence. 141 * DMA transfer sequence.
142 *
143 * Note: The host lock held by the libata layer protects
144 * us from two channels both trying to set DMA bits at once
142 */ 145 */
143 146
144static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) 147static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc)
@@ -187,6 +190,9 @@ static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc)
187 * 190 *
188 * After a DMA completes we need to put the clock back to 33MHz for 191 * After a DMA completes we need to put the clock back to 33MHz for
189 * PIO timings. 192 * PIO timings.
193 *
194 * Note: The host lock held by the libata layer protects
195 * us from two channels both trying to set DMA bits at once
190 */ 196 */
191 197
192static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc) 198static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
@@ -206,7 +212,6 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
206 iowrite32(0, atapi_reg); 212 iowrite32(0, atapi_reg);
207 iowrite8(ioread8(clock) & ~sel66, clock); 213 iowrite8(ioread8(clock) & ~sel66, clock);
208 } 214 }
209 /* Check we keep host level locking here */
210 /* Flip back to 33Mhz for PIO */ 215 /* Flip back to 33Mhz for PIO */
211 if (adev->dma_mode >= XFER_UDMA_2) 216 if (adev->dma_mode >= XFER_UDMA_2)
212 iowrite8(ioread8(clock) & ~sel66, clock); 217 iowrite8(ioread8(clock) & ~sel66, clock);