aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_efar.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-03 14:32:08 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 15:50:31 -0500
commitf79ff92649efd5ef17f5267fe6f599c64e74e050 (patch)
tree73d35de776b41080547298df54782b8474f42d60 /drivers/ata/pata_efar.c
parent6938594374ee506e91a4c03117a034ea0ed66783 (diff)
pata_efar: fix wrong PIO timings being programmed
* do not clear PIO timings for master when programming slave * do not clear PIO timings for device on the other port when programming slave device Both changes should be safe as this is how we have been doing things in IDE slc90e66 host driver for years. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_efar.c')
-rw-r--r--drivers/ata/pata_efar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c
index 2a6412f5d117..540c36426303 100644
--- a/drivers/ata/pata_efar.c
+++ b/drivers/ata/pata_efar.c
@@ -2,6 +2,7 @@
2 * pata_efar.c - EFAR PIIX clone controller driver 2 * pata_efar.c - EFAR PIIX clone controller driver
3 * 3 *
4 * (C) 2005 Red Hat 4 * (C) 2005 Red Hat
5 * (C) 2009 Bartlomiej Zolnierkiewicz
5 * 6 *
6 * Some parts based on ata_piix.c by Jeff Garzik and others. 7 * Some parts based on ata_piix.c by Jeff Garzik and others.
7 * 8 *
@@ -118,12 +119,12 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
118 int shift = 4 * ap->port_no; 119 int shift = 4 * ap->port_no;
119 u8 slave_data; 120 u8 slave_data;
120 121
121 idetm_data &= 0xCC0F; 122 idetm_data &= 0xFF0F;
122 idetm_data |= (control << 4); 123 idetm_data |= (control << 4);
123 124
124 /* Slave timing in separate register */ 125 /* Slave timing in separate register */
125 pci_read_config_byte(dev, 0x44, &slave_data); 126 pci_read_config_byte(dev, 0x44, &slave_data);
126 slave_data &= 0x0F << shift; 127 slave_data &= ap->port_no ? 0x0F : 0xF0;
127 slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << shift; 128 slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << shift;
128 pci_write_config_byte(dev, 0x44, slave_data); 129 pci_write_config_byte(dev, 0x44, slave_data);
129 } 130 }