Skip to content

Commit 06b74dd

Browse files
Alan-CoxJeff Garzik
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 21d2c92 commit 06b74dd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/ata/pata_pdc202xx_old.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* First cut with LBA48/ATAPI
1010
*
1111
* TODO:
12-
* Channel interlock/reset on both required
12+
* Channel interlock/reset on both required ?
1313
*/
1414

1515
#include <linux/kernel.h>
@@ -22,7 +22,7 @@
2222
#include <linux/libata.h>
2323

2424
#define DRV_NAME "pata_pdc202xx_old"
25-
#define DRV_VERSION "0.4.2"
25+
#define DRV_VERSION "0.4.3"
2626

2727
static int pdc2026x_cable_detect(struct ata_port *ap)
2828
{
@@ -106,9 +106,9 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
106106
{ 0x20, 0x01 }
107107
};
108108
static u8 mdma_timing[3][2] = {
109-
{ 0x60, 0x03 },
110-
{ 0x60, 0x04 },
111109
{ 0xe0, 0x0f },
110+
{ 0x60, 0x04 },
111+
{ 0x60, 0x03 },
112112
};
113113
u8 r_bp, r_cp;
114114

@@ -139,6 +139,9 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
139139
*
140140
* In UDMA3 or higher we have to clock switch for the duration of the
141141
* 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
142145
*/
143146

144147
static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc)
@@ -187,6 +190,9 @@ static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc)
187190
*
188191
* After a DMA completes we need to put the clock back to 33MHz for
189192
* 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
190196
*/
191197

192198
static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
@@ -206,7 +212,6 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
206212
iowrite32(0, atapi_reg);
207213
iowrite8(ioread8(clock) & ~sel66, clock);
208214
}
209-
/* Check we keep host level locking here */
210215
/* Flip back to 33Mhz for PIO */
211216
if (adev->dma_mode >= XFER_UDMA_2)
212217
iowrite8(ioread8(clock) & ~sel66, clock);

0 commit comments

Comments
 (0)