]> Pileus Git - ~andy/linux/blobdiff - drivers/ide/siimage.c
tracing/kprobes: Add probe handler dispatcher to support perf and ftrace concurrent use
[~andy/linux] / drivers / ide / siimage.c
index 6a643fdf0e6ea1ba89553ce60e2b8f1c4a7308e8..d95df528562f0db7d1dd0b782954d4a30e7125ef 100644 (file)
@@ -338,24 +338,14 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
        sil_iowrite16(dev, ultra, ua);
 }
 
-/* returns 1 if dma irq issued, 0 otherwise */
-static int siimage_io_dma_test_irq(ide_drive_t *drive)
+static int sil_test_irq(ide_hwif_t *hwif)
 {
-       ide_hwif_t *hwif        = drive->hwif;
        struct pci_dev *dev     = to_pci_dev(hwif->dev);
-       u8 dma_altstat          = 0;
        unsigned long addr      = siimage_selreg(hwif, 1);
+       u8 val                  = sil_ioread8(dev, addr);
 
-       /* return 1 if INTR asserted */
-       if (inb(hwif->dma_base + ATA_DMA_STATUS) & 4)
-               return 1;
-
-       /* return 1 if Device INTR asserted */
-       pci_read_config_byte(dev, addr, &dma_altstat);
-       if (dma_altstat & 8)
-               return 0;       /* return 1; */
-
-       return 0;
+       /* Return 1 if INTRQ asserted */
+       return (val & 8) ? 1 : 0;
 }
 
 /**
@@ -369,7 +359,6 @@ static int siimage_io_dma_test_irq(ide_drive_t *drive)
 static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = drive->hwif;
-       unsigned long addr      = siimage_selreg(hwif, 0x1);
        void __iomem *sata_error_addr
                = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET];
 
@@ -398,10 +387,6 @@ static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
        if (readb((void __iomem *)(hwif->dma_base + ATA_DMA_STATUS)) & 4)
                return 1;
 
-       /* return 1 if Device INTR asserted */
-       if (readb((void __iomem *)addr) & 8)
-               return 0;       /* return 1; */
-
        return 0;
 }
 
@@ -410,7 +395,7 @@ static int siimage_dma_test_irq(ide_drive_t *drive)
        if (drive->hwif->host_flags & IDE_HFLAG_MMIO)
                return siimage_mmio_dma_test_irq(drive);
        else
-               return siimage_io_dma_test_irq(drive);
+               return ide_dma_test_irq(drive);
 }
 
 /**
@@ -695,6 +680,7 @@ static const struct ide_port_ops sil_pata_port_ops = {
        .set_pio_mode           = sil_set_pio_mode,
        .set_dma_mode           = sil_set_dma_mode,
        .quirkproc              = sil_quirkproc,
+       .test_irq               = sil_test_irq,
        .udma_filter            = sil_pata_udma_filter,
        .cable_detect           = sil_cable_detect,
 };
@@ -705,6 +691,7 @@ static const struct ide_port_ops sil_sata_port_ops = {
        .reset_poll             = sil_sata_reset_poll,
        .pre_reset              = sil_sata_pre_reset,
        .quirkproc              = sil_quirkproc,
+       .test_irq               = sil_test_irq,
        .udma_filter            = sil_sata_udma_filter,
        .cable_detect           = sil_cable_detect,
 };