aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index c561b3be4a97..16bc3e35bdd4 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -64,6 +64,46 @@ u8 ata_irq_on(struct ata_port *ap)
64 return tmp; 64 return tmp;
65} 65}
66 66
67u8 ata_dummy_irq_on (struct ata_port *ap) { return 0; }
68
69/**
70 * ata_irq_ack - Acknowledge a device interrupt.
71 * @ap: Port on which interrupts are enabled.
72 *
73 * Wait up to 10 ms for legacy IDE device to become idle (BUSY
74 * or BUSY+DRQ clear). Obtain dma status and port status from
75 * device. Clear the interrupt. Return port status.
76 *
77 * LOCKING:
78 */
79
80u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
81{
82 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
83 u8 host_stat, post_stat, status;
84
85 status = ata_busy_wait(ap, bits, 1000);
86 if (status & bits)
87 if (ata_msg_err(ap))
88 printk(KERN_ERR "abnormal status 0x%X\n", status);
89
90 /* get controller status; clear intr, err bits */
91 host_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
92 iowrite8(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
93 ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
94
95 post_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
96
97 if (ata_msg_intr(ap))
98 printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n",
99 __FUNCTION__,
100 host_stat, post_stat, status);
101
102 return status;
103}
104
105u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq) { return 0; }
106
67/** 107/**
68 * ata_tf_load - send taskfile registers to host controller 108 * ata_tf_load - send taskfile registers to host controller
69 * @ap: Port to which output is sent 109 * @ap: Port to which output is sent
@@ -370,8 +410,7 @@ void ata_bmdma_thaw(struct ata_port *ap)
370 /* clear & re-enable interrupts */ 410 /* clear & re-enable interrupts */
371 ata_chk_status(ap); 411 ata_chk_status(ap);
372 ap->ops->irq_clear(ap); 412 ap->ops->irq_clear(ap);
373 if (ap->ioaddr.ctl_addr) /* FIXME: hack. create a hook instead */ 413 ap->ops->irq_on(ap);
374 ata_irq_on(ap);
375} 414}
376 415
377/** 416/**