Skip to content

Commit 943547a

Browse files
bzolnierJeff Garzik
authored andcommitted
pata_amd/pata_via: de-couple programming of PIO/MWDMA and UDMA timings
* Don't program UDMA timings when programming PIO or MWDMA modes. This has also a nice side-effect of fixing regression added by commit 681c80b ("libata: correct handling of SRST reset sequences") (->set_piomode method for PIO0 is called before ->cable_detect method which checks UDMA timings to get the cable type). * Bump driver version. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Tested-by: "Thomas Lindroth" <thomas.lindroth@gmail.com> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent 6ba8695 commit 943547a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/ata/pata_amd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <linux/libata.h>
2626

2727
#define DRV_NAME "pata_amd"
28-
#define DRV_VERSION "0.3.9"
28+
#define DRV_VERSION "0.3.10"
2929

3030
/**
3131
* timing_setup - shared timing computation and load
@@ -115,7 +115,8 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse
115115
}
116116

117117
/* UDMA timing */
118-
pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
118+
if (at.udma)
119+
pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
119120
}
120121

121122
/**

drivers/ata/pata_via.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#include <linux/dmi.h>
6464

6565
#define DRV_NAME "pata_via"
66-
#define DRV_VERSION "0.3.2"
66+
#define DRV_VERSION "0.3.3"
6767

6868
/*
6969
* The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -296,7 +296,7 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
296296
}
297297

298298
/* Set UDMA unless device is not UDMA capable */
299-
if (udma_type) {
299+
if (udma_type && t.udma) {
300300
u8 cable80_status;
301301

302302
/* Get 80-wire cable detection bit */

0 commit comments

Comments
 (0)