diff options
-rw-r--r-- | drivers/ata/libata-core.c | 1 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 37 | ||||
-rw-r--r-- | include/linux/libata.h | 1 |
3 files changed, 31 insertions, 8 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index bf8d3b8c171d..85283c04d642 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -6826,6 +6826,7 @@ EXPORT_SYMBOL_GPL(ata_check_status); | |||
6826 | EXPORT_SYMBOL_GPL(ata_altstatus); | 6826 | EXPORT_SYMBOL_GPL(ata_altstatus); |
6827 | EXPORT_SYMBOL_GPL(ata_exec_command); | 6827 | EXPORT_SYMBOL_GPL(ata_exec_command); |
6828 | EXPORT_SYMBOL_GPL(ata_port_start); | 6828 | EXPORT_SYMBOL_GPL(ata_port_start); |
6829 | EXPORT_SYMBOL_GPL(ata_sff_port_start); | ||
6829 | EXPORT_SYMBOL_GPL(ata_interrupt); | 6830 | EXPORT_SYMBOL_GPL(ata_interrupt); |
6830 | EXPORT_SYMBOL_GPL(ata_do_set_mode); | 6831 | EXPORT_SYMBOL_GPL(ata_do_set_mode); |
6831 | EXPORT_SYMBOL_GPL(ata_data_xfer); | 6832 | EXPORT_SYMBOL_GPL(ata_data_xfer); |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index e35d13466c69..ce84805ba5f1 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -80,25 +80,25 @@ u8 ata_dummy_irq_on (struct ata_port *ap) { return 0; } | |||
80 | u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | 80 | u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) |
81 | { | 81 | { |
82 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; | 82 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; |
83 | u8 host_stat, post_stat, status; | 83 | u8 host_stat = 0, post_stat = 0, status; |
84 | 84 | ||
85 | status = ata_busy_wait(ap, bits, 1000); | 85 | status = ata_busy_wait(ap, bits, 1000); |
86 | if (status & bits) | 86 | if (status & bits) |
87 | if (ata_msg_err(ap)) | 87 | if (ata_msg_err(ap)) |
88 | printk(KERN_ERR "abnormal status 0x%X\n", status); | 88 | printk(KERN_ERR "abnormal status 0x%X\n", status); |
89 | 89 | ||
90 | /* get controller status; clear intr, err bits */ | 90 | if (ap->ioaddr.bmdma_addr) { |
91 | host_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 91 | /* get controller status; clear intr, err bits */ |
92 | iowrite8(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, | 92 | host_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
93 | ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 93 | iowrite8(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, |
94 | 94 | ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | |
95 | post_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | ||
96 | 95 | ||
96 | post_stat = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | ||
97 | } | ||
97 | if (ata_msg_intr(ap)) | 98 | 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 | printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", |
99 | __FUNCTION__, | 100 | __FUNCTION__, |
100 | host_stat, post_stat, status); | 101 | host_stat, post_stat, status); |
101 | |||
102 | return status; | 102 | return status; |
103 | } | 103 | } |
104 | 104 | ||
@@ -516,6 +516,27 @@ void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) | |||
516 | ata_bmdma_stop(qc); | 516 | ata_bmdma_stop(qc); |
517 | } | 517 | } |
518 | 518 | ||
519 | /** | ||
520 | * ata_sff_port_start - Set port up for dma. | ||
521 | * @ap: Port to initialize | ||
522 | * | ||
523 | * Called just after data structures for each port are | ||
524 | * initialized. Allocates space for PRD table if the device | ||
525 | * is DMA capable SFF. | ||
526 | * | ||
527 | * May be used as the port_start() entry in ata_port_operations. | ||
528 | * | ||
529 | * LOCKING: | ||
530 | * Inherited from caller. | ||
531 | */ | ||
532 | |||
533 | int ata_sff_port_start(struct ata_port *ap) | ||
534 | { | ||
535 | if (ap->ioaddr.bmdma_addr) | ||
536 | return ata_port_start(ap); | ||
537 | return 0; | ||
538 | } | ||
539 | |||
519 | #ifdef CONFIG_PCI | 540 | #ifdef CONFIG_PCI |
520 | 541 | ||
521 | static int ata_resources_present(struct pci_dev *pdev, int port) | 542 | static int ata_resources_present(struct pci_dev *pdev, int port) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index a6a3113120a4..745c4f9b4caa 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -753,6 +753,7 @@ extern u8 ata_check_status(struct ata_port *ap); | |||
753 | extern u8 ata_altstatus(struct ata_port *ap); | 753 | extern u8 ata_altstatus(struct ata_port *ap); |
754 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 754 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
755 | extern int ata_port_start (struct ata_port *ap); | 755 | extern int ata_port_start (struct ata_port *ap); |
756 | extern int ata_sff_port_start (struct ata_port *ap); | ||
756 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance); | 757 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance); |
757 | extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, | 758 | extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, |
758 | unsigned int buflen, int write_data); | 759 | unsigned int buflen, int write_data); |