The patch titled ide: backport piix fixes from libata into the legacy driver has been added to the -mm tree. Its filename is ide-backport-piix-fixes-from-libata-into-the-legacy-driver.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: ide: backport piix fixes from libata into the legacy driver From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> There are three flags being set by default by the PIIX driver for speeds > PIO 1, and one not being cleared properly on fallback to PIO0. The most important one is the prefetch/post write control which only works for ATA and can do bad things with ATAPI. The patch does its best to set the flags correctly for drivers/ide. Its not 100% perfect but its closer than the original. 100% perfect requires proper IORDY handling but this isn't critical (and its not right in libata either .. yet) Signed-off-by: Alan Cox <alan@xxxxxxxxxx> Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/ide/pci/piix.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff -puN drivers/ide/pci/piix.c~ide-backport-piix-fixes-from-libata-into-the-legacy-driver drivers/ide/pci/piix.c --- a/drivers/ide/pci/piix.c~ide-backport-piix-fixes-from-libata-into-the-legacy-driver +++ a/drivers/ide/pci/piix.c @@ -224,13 +224,15 @@ static void piix_tune_drive (ide_drive_t u16 master_data; u8 slave_data; static DEFINE_SPINLOCK(tune_lock); + int control = 0; /* ISP RTC */ - u8 timings[][2] = { { 0, 0 }, - { 0, 0 }, - { 1, 0 }, - { 2, 1 }, - { 2, 3 }, }; + static const u8 timings[][2]= { + { 0, 0 }, + { 0, 0 }, + { 1, 0 }, + { 2, 1 }, + { 2, 3 }, }; pio = ide_get_best_pio_mode(drive, pio, 5, NULL); @@ -241,19 +243,30 @@ static void piix_tune_drive (ide_drive_t */ spin_lock_irqsave(&tune_lock, flags); pci_read_config_word(dev, master_port, &master_data); + + if (pio >= 2) + control |= 1; /* Programmable timing on */ + if (drive->media == ide_disk) + control |= 4; /* Prefetch, post write */ + if (pio >= 3) + control |= 2; /* IORDY */ if (is_slave) { master_data = master_data | 0x4000; - if (pio > 1) + if (pio > 1) { /* enable PPE, IE and TIME */ - master_data = master_data | 0x0070; + master_data = master_data | (control << 4); + } else { + master_data &= ~0x0070; + } pci_read_config_byte(dev, slave_port, &slave_data); slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); } else { master_data = master_data & 0xccf8; - if (pio > 1) + if (pio > 1) { /* enable PPE, IE and TIME */ - master_data = master_data | 0x0007; + master_data = master_data | control; + } master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); } pci_write_config_word(dev, master_port, master_data); _ Patches currently in -mm which might be from alan@xxxxxxxxxxxxxxxxxxx are origin.patch correct-tty-doc.patch ide-pdc202xx_oldc-remove-unneeded-tuneproc-call.patch ide-io-increase-timeout-value-to-allow-for-slave-wakeup.patch ide-actually-honor-drives-minimum-pio-dma-cycle-times.patch ide-pdc202xx_old-remove-the-obsolete-busproc.patch fix-ide-deadlock-in-error-reporting-code.patch pdc202xx_old-depends-on-config_blk_dev_idedma.patch remove-code-that-has-long-been-commented-out-from-pdc20265_old.patch ata-add-some-nvidia-chipset-ids.patch via-pata-controller-xfer-fixes.patch git-pcmcia.patch megaraid-gcc-41-warning-fix.patch bogus-disk-geometry-on-large-disks.patch remove-tty_dont_flip.patch old-ide-fix-sata-detection-for-cabling.patch ide-clean-up-siimage.patch ide-claim-extra-dma-ports-regardless-of-channel.patch ide-always-release-dma-engine.patch ide-error-handling-fixes.patch ide-hpt3xxn-clocking-fixes.patch ide-fix-hpt37x-timing-tables.patch ide-optimize-hpt37x-timing-tables.patch ide-fix-hpt3xx-hotswap-support.patch ide-fix-the-case-of-multiple-hpt3xx-chips-present.patch ide-hpt3xx-fix-pci-clock-detection.patch ide-hpt3xx-fix-pci-clock-detection-fix-2.patch piix-fix-82371mx-enablebits.patch piix-remove-check-for-broken-mw-dma-mode-0.patch piix-slc90e66-pio-mode-fallback-fix.patch make-number-of-ide-interfaces-configurable.patch ide_dma_speed-fixes.patch hpt3xx-rework-rate-filtering.patch hpt3xx-rework-rate-filtering-tidy.patch hpt3xx-print-the-real-chip-name-at-startup.patch hpt3xx-switch-to-using-pci_get_slot.patch hpt3xx-cache-channels-mcr-address.patch hpt3x7-merge-speedproc-handlers.patch hpt370-clean-up-dma-timeout-handling.patch enable-cdrom-dma-access-with-pdc20265_old.patch ide-fix-revision-comparison-in-ide_in_drive_list.patch drivers-ide-legacy-ide-csc-make-2-functions-static.patch ide-backport-piix-fixes-from-libata-into-the-legacy-driver.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html