Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
[pandora-kernel.git] / drivers / ide / ide-iops.c
index 6571652..c67b3b1 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/bitops.h>
+#include <linux/nmi.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -48,11 +49,6 @@ static void ide_insw (unsigned long port, void *addr, u32 count)
        insw(port, addr, count);
 }
 
-static u32 ide_inl (unsigned long port)
-{
-       return (u32) inl(port);
-}
-
 static void ide_insl (unsigned long port, void *addr, u32 count)
 {
        insl(port, addr, count);
@@ -78,11 +74,6 @@ static void ide_outsw (unsigned long port, void *addr, u32 count)
        outsw(port, addr, count);
 }
 
-static void ide_outl (u32 val, unsigned long port)
-{
-       outl(val, port);
-}
-
 static void ide_outsl (unsigned long port, void *addr, u32 count)
 {
        outsl(port, addr, count);
@@ -93,12 +84,10 @@ void default_hwif_iops (ide_hwif_t *hwif)
        hwif->OUTB      = ide_outb;
        hwif->OUTBSYNC  = ide_outbsync;
        hwif->OUTW      = ide_outw;
-       hwif->OUTL      = ide_outl;
        hwif->OUTSW     = ide_outsw;
        hwif->OUTSL     = ide_outsl;
        hwif->INB       = ide_inb;
        hwif->INW       = ide_inw;
-       hwif->INL       = ide_inl;
        hwif->INSW      = ide_insw;
        hwif->INSL      = ide_insl;
 }
@@ -122,11 +111,6 @@ static void ide_mm_insw (unsigned long port, void *addr, u32 count)
        __ide_mm_insw((void __iomem *) port, addr, count);
 }
 
-static u32 ide_mm_inl (unsigned long port)
-{
-       return (u32) readl((void __iomem *) port);
-}
-
 static void ide_mm_insl (unsigned long port, void *addr, u32 count)
 {
        __ide_mm_insl((void __iomem *) port, addr, count);
@@ -152,11 +136,6 @@ static void ide_mm_outsw (unsigned long port, void *addr, u32 count)
        __ide_mm_outsw((void __iomem *) port, addr, count);
 }
 
-static void ide_mm_outl (u32 value, unsigned long port)
-{
-       writel(value, (void __iomem *) port);
-}
-
 static void ide_mm_outsl (unsigned long port, void *addr, u32 count)
 {
        __ide_mm_outsl((void __iomem *) port, addr, count);
@@ -169,12 +148,10 @@ void default_hwif_mmiops (ide_hwif_t *hwif)
           this one is controller specific! */
        hwif->OUTBSYNC  = ide_mm_outbsync;
        hwif->OUTW      = ide_mm_outw;
-       hwif->OUTL      = ide_mm_outl;
        hwif->OUTSW     = ide_mm_outsw;
        hwif->OUTSL     = ide_mm_outsl;
        hwif->INB       = ide_mm_inb;
        hwif->INW       = ide_mm_inw;
-       hwif->INL       = ide_mm_inl;
        hwif->INSW      = ide_mm_insw;
        hwif->INSL      = ide_mm_insl;
 }
@@ -776,7 +753,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (hwif->ide_dma_check)         /* check if host supports DMA */
-               hwif->ide_dma_host_off(drive);
+               hwif->dma_host_off(drive);
 #endif
 
        /*
@@ -853,9 +830,9 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (speed >= XFER_SW_DMA_0)
-               hwif->ide_dma_host_on(drive);
+               hwif->dma_host_on(drive);
        else if (hwif->ide_dma_check)   /* check if host supports DMA */
-               hwif->ide_dma_off_quietly(drive);
+               hwif->dma_off_quietly(drive);
 #endif
 
        switch(speed) {
@@ -997,6 +974,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
        }
        /* done polling */
        hwgroup->polling = 0;
+       hwgroup->resetting = 0;
        return ide_stopped;
 }
 
@@ -1056,6 +1034,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
                }
        }
        hwgroup->polling = 0;   /* done polling */
+       hwgroup->resetting = 0; /* done reset attempt */
        return ide_stopped;
 }
 
@@ -1063,12 +1042,12 @@ static void check_dma_crc(ide_drive_t *drive)
 {
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (drive->crc_count) {
-               (void) HWIF(drive)->ide_dma_off_quietly(drive);
+               drive->hwif->dma_off_quietly(drive);
                ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive));
                if (drive->current_speed >= XFER_SW_DMA_0)
                        (void) HWIF(drive)->ide_dma_on(drive);
        } else
-               (void)__ide_dma_off(drive);
+               ide_dma_off(drive);
 #endif
 }
 
@@ -1142,6 +1121,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
 
        /* For an ATAPI device, first try an ATAPI SRST. */
        if (drive->media != ide_disk && !do_not_try_atapi) {
+               hwgroup->resetting = 1;
                pre_reset(drive);
                SELECT_DRIVE(drive);
                udelay (20);
@@ -1167,6 +1147,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
                return ide_stopped;
        }
 
+       hwgroup->resetting = 1;
        /*
         * Note that we also set nIEN while resetting the device,
         * to mask unwanted interrupts from the interface during the reset.
@@ -1243,6 +1224,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
                if (stat == 0xff)
                        return -ENODEV;
                touch_softlockup_watchdog();
+               touch_nmi_watchdog();
        }
        return -EBUSY;
 }