[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>

authored by David Milburn and committed by Jeff Garzik 19799bfc 67651ee5

+9 -13
+9 -13
drivers/ata/sata_sx4.c
··· 687 687 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc) 688 688 { 689 689 switch (qc->tf.protocol) { 690 - case ATA_PROT_DMA: 691 690 case ATA_PROT_NODATA: 691 + if (qc->tf.flags & ATA_TFLAG_POLLING) 692 + break; 693 + /*FALLTHROUGH*/ 694 + case ATA_PROT_DMA: 692 695 pdc20621_packet_start(qc); 693 696 return 0; 694 697 ··· 790 787 791 788 static void pdc20621_irq_clear(struct ata_port *ap) 792 789 { 793 - struct ata_host *host = ap->host; 794 - void __iomem *mmio = host->iomap[PDC_MMIO_BAR]; 795 - 796 - mmio += PDC_CHIP0_OFS; 797 - 798 - readl(mmio + PDC_20621_SEQMASK); 790 + ioread8(ap->ioaddr.status_addr); 799 791 } 800 792 801 793 static irqreturn_t pdc20621_interrupt(int irq, void *dev_instance) ··· 875 877 static void pdc_thaw(struct ata_port *ap) 876 878 { 877 879 void __iomem *mmio = ap->ioaddr.cmd_addr; 878 - void __iomem *mmio_base; 879 880 u32 tmp; 880 881 881 882 /* FIXME: start HDMA engine, if zero ATA engines running */ 882 883 883 - /* reading SEQ mask register clears IRQ */ 884 - mmio_base = ap->host->iomap[PDC_MMIO_BAR] + PDC_CHIP0_OFS; 885 - readl(mmio_base + PDC_20621_SEQMASK); 884 + /* clear IRQ */ 885 + ioread8(ap->ioaddr.status_addr); 886 886 887 887 /* turn IRQ back on */ 888 888 tmp = readl(mmio + PDC_CTLSTAT); ··· 970 974 static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 971 975 { 972 976 WARN_ON(tf->protocol == ATA_PROT_DMA || 973 - tf->protocol == ATA_PROT_NODATA); 977 + tf->protocol == ATAPI_PROT_DMA); 974 978 ata_sff_tf_load(ap, tf); 975 979 } 976 980 ··· 978 982 static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf) 979 983 { 980 984 WARN_ON(tf->protocol == ATA_PROT_DMA || 981 - tf->protocol == ATA_PROT_NODATA); 985 + tf->protocol == ATAPI_PROT_DMA); 982 986 ata_sff_exec_command(ap, tf); 983 987 } 984 988