pata_it8213: fix wrong PIO timings being programmed
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 3 Dec 2009 19:32:10 +0000 (20:32 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 3 Dec 2009 21:00:56 +0000 (16:00 -0500)
* do not clear PIO timings for master when programming slave
* program new PIO timings in the correct register nibble

Both changes should be safe as this is how we have been doing
things in IDE it8213 host driver for years.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_it8213.c

index 36d1f61491df8395558a8c1b4be2f33e50eb31bf..092af531aa09a3dbc9773b4bc45a5ad8cb2cb258 100644 (file)
@@ -112,13 +112,13 @@ static void it8213_set_piomode (struct ata_port *ap, struct ata_device *adev)
        } else {
                u8 slave_data;
 
-               idetm_data &= 0xCC0F;
+               idetm_data &= 0xFF0F;
                idetm_data |= (control << 4);
 
                /* Slave timing in separate register */
                pci_read_config_byte(dev, 0x44, &slave_data);
                slave_data &= 0xF0;
-               slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 4;
+               slave_data |= (timings[pio][0] << 2) | timings[pio][1];
                pci_write_config_byte(dev, 0x44, slave_data);
        }