Skip to content

Commit

Permalink
pata_it8213: fix wrong PIO timings being programmed
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Dec 3, 2009
1 parent e0ee792 commit 088ccb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/pata_it8213.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 088ccb5

Please sign in to comment.