Merge commit 'origin/master' into next
[cascardo/linux.git] / drivers / ide / sl82c105.c
index dba213c..0924abf 100644 (file)
@@ -10,7 +10,7 @@
  * with the timing registers setup.
  *  -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org
  *
- * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>
+ * Copyright (C) 2006-2007,2009 MontaVista Software, Inc. <source@mvista.com>
  * Copyright (C)      2007 Bartlomiej Zolnierkiewicz
  */
 
@@ -61,7 +61,8 @@ static unsigned int get_pio_timings(ide_drive_t *drive, u8 pio)
        if (cmd_off == 0)
                cmd_off = 1;
 
-       if (pio > 2 || ata_id_has_iordy(drive->id))
+       if ((pio > 2 || ata_id_has_iordy(drive->id)) &&
+           !(pio > 4 && ata_id_is_cfa(drive->id)))
                iordy = 0x40;
 
        return (cmd_on - 1) << 8 | (cmd_off - 1) | iordy;
@@ -145,14 +146,15 @@ static void sl82c105_dma_lost_irq(ide_drive_t *drive)
        u32 val, mask           = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA;
        u8 dma_cmd;
 
-       printk("sl82c105: lost IRQ, resetting host\n");
+       printk(KERN_WARNING "sl82c105: lost IRQ, resetting host\n");
 
        /*
         * Check the raw interrupt from the drive.
         */
        pci_read_config_dword(dev, 0x40, &val);
        if (val & mask)
-               printk("sl82c105: drive was requesting IRQ, but host lost it\n");
+               printk(KERN_INFO "sl82c105: drive was requesting IRQ, "
+                      "but host lost it\n");
 
        /*
         * Was DMA enabled?  If so, disable it - we're resetting the
@@ -161,7 +163,7 @@ static void sl82c105_dma_lost_irq(ide_drive_t *drive)
        dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
        if (dma_cmd & 1) {
                outb(dma_cmd & ~1, hwif->dma_base + ATA_DMA_CMD);
-               printk("sl82c105: DMA was enabled\n");
+               printk(KERN_INFO "sl82c105: DMA was enabled\n");
        }
 
        sl82c105_reset_host(dev);
@@ -189,14 +191,13 @@ static void sl82c105_dma_start(ide_drive_t *drive)
        ide_dma_start(drive);
 }
 
-static void sl82c105_dma_timeout(ide_drive_t *drive)
+static void sl82c105_dma_clear(ide_drive_t *drive)
 {
        struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
 
-       DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name));
+       DBG(("sl82c105_dma_clear(drive:%s)\n", drive->name));
 
        sl82c105_reset_host(dev);
-       ide_dma_timeout(drive);
 }
 
 static int sl82c105_dma_end(ide_drive_t *drive)
@@ -293,12 +294,12 @@ static const struct ide_port_ops sl82c105_port_ops = {
 static const struct ide_dma_ops sl82c105_dma_ops = {
        .dma_host_set           = ide_dma_host_set,
        .dma_setup              = ide_dma_setup,
-       .dma_exec_cmd           = ide_dma_exec_cmd,
        .dma_start              = sl82c105_dma_start,
        .dma_end                = sl82c105_dma_end,
        .dma_test_irq           = ide_dma_test_irq,
        .dma_lost_irq           = sl82c105_dma_lost_irq,
-       .dma_timeout            = sl82c105_dma_timeout,
+       .dma_timer_expiry       = ide_dma_sff_timer_expiry,
+       .dma_clear              = sl82c105_dma_clear,
        .dma_sff_read_status    = ide_dma_sff_read_status,
 };