aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Milburn <dmilburn@redhat.com>2009-05-13 19:02:21 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-05-15 14:08:10 -0400
commit19799bfc5da476ad72eecc5f0f9018c5d351cbd5 (patch)
tree44dfb7e03f353e74ca37da20630ddc5eb1529ea9 /drivers
parent67651ee5710c45ea62fae68b768d65395ccf47c2 (diff)
[libata] sata_sx4: fixup interrupt handling
Issuing ATA_CMD_SET_FEATURES (0xef) times out because pdc20621_interrupt ignores command completion since ATA_TFLAG_POLLING flag is set. This has already been fixed for sata_promise: commit 51b94d2a5a90d4800e74d7348bcde098a28f4fb3 Author: Tejun Heo <htejun@gmail.com> Date: Fri Jun 8 13:46:55 2007 -0700 sata_promise: use TF interface for polling NODATA commands Also, this patch includes Mikael's original patches: http://marc.info/?l=linux-ide&m=121135828227724&w=2 http://marc.info/?l=linux-ide&m=121144512109826&w=2 Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: David Milburn <dmilburn@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/sata_sx4.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 1ce98afa69b6..eb05a3c82a9e 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -687,8 +687,11 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc)
687static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc) 687static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc)
688{ 688{
689 switch (qc->tf.protocol) { 689 switch (qc->tf.protocol) {
690 case ATA_PROT_DMA:
691 case ATA_PROT_NODATA: 690 case ATA_PROT_NODATA:
691 if (qc->tf.flags & ATA_TFLAG_POLLING)
692 break;
693 /*FALLTHROUGH*/
694 case ATA_PROT_DMA:
692 pdc20621_packet_start(qc); 695 pdc20621_packet_start(qc);
693 return 0; 696 return 0;
694 697
@@ -787,12 +790,7 @@ static inline unsigned int pdc20621_host_intr(struct ata_port *ap,
787 790
788static void pdc20621_irq_clear(struct ata_port *ap) 791static void pdc20621_irq_clear(struct ata_port *ap)
789{ 792{
790 struct ata_host *host = ap->host; 793 ioread8(ap->ioaddr.status_addr);
791 void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
792
793 mmio += PDC_CHIP0_OFS;
794
795 readl(mmio + PDC_20621_SEQMASK);
796} 794}
797 795
798static irqreturn_t pdc20621_interrupt(int irq, void *dev_instance) 796static irqreturn_t pdc20621_interrupt(int irq, void *dev_instance)
@@ -877,14 +875,12 @@ static void pdc_freeze(struct ata_port *ap)
877static void pdc_thaw(struct ata_port *ap) 875static void pdc_thaw(struct ata_port *ap)
878{ 876{
879 void __iomem *mmio = ap->ioaddr.cmd_addr; 877 void __iomem *mmio = ap->ioaddr.cmd_addr;
880 void __iomem *mmio_base;
881 u32 tmp; 878 u32 tmp;
882 879
883 /* FIXME: start HDMA engine, if zero ATA engines running */ 880 /* FIXME: start HDMA engine, if zero ATA engines running */
884 881
885 /* reading SEQ mask register clears IRQ */ 882 /* clear IRQ */
886 mmio_base = ap->host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS; 883 ioread8(ap->ioaddr.status_addr);
887 readl(mmio_base + PDC_20621_SEQMASK);
888 884
889 /* turn IRQ back on */ 885 /* turn IRQ back on */
890 tmp = readl(mmio + PDC_CTLSTAT); 886 tmp = readl(mmio + PDC_CTLSTAT);
@@ -974,7 +970,7 @@ static int pdc_check_atapi_dma(struct ata_queued_cmd *qc)
974static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 970static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
975{ 971{
976 WARN_ON(tf->protocol == ATA_PROT_DMA || 972 WARN_ON(tf->protocol == ATA_PROT_DMA ||
977 tf->protocol == ATA_PROT_NODATA); 973 tf->protocol == ATAPI_PROT_DMA);
978 ata_sff_tf_load(ap, tf); 974 ata_sff_tf_load(ap, tf);
979} 975}
980 976
@@ -982,7 +978,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
982static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 978static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
983{ 979{
984 WARN_ON(tf->protocol == ATA_PROT_DMA || 980 WARN_ON(tf->protocol == ATA_PROT_DMA ||
985 tf->protocol == ATA_PROT_NODATA); 981 tf->protocol == ATAPI_PROT_DMA);
986 ata_sff_exec_command(ap, tf); 982 ata_sff_exec_command(ap, tf);
987} 983}
988 984