Merge branch 'master'
[powerpc.git] / drivers / scsi / libata-core.c
index 64dce00..5d00bb7 100644 (file)
@@ -962,6 +962,8 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
        spin_unlock_irqrestore(&ap->host_set->lock, flags);
 
        if (!wait_for_completion_timeout(&wait, ATA_TMOUT_INTERNAL)) {
+               ata_port_flush_task(ap);
+
                spin_lock_irqsave(&ap->host_set->lock, flags);
 
                /* We're racing with irq here.  If we lose, the
@@ -1737,7 +1739,7 @@ static int ata_host_set_pio(struct ata_port *ap)
                        continue;
 
                if (!dev->pio_mode) {
-                       printk(KERN_WARNING "ata%u: no PIO support\n", ap->id);
+                       printk(KERN_WARNING "ata%u: no PIO support for device %d.\n", ap->id, i);
                        return -1;
                }
 
@@ -2863,6 +2865,8 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
        ata_fill_sg(qc);
 }
 
+void ata_noop_qc_prep(struct ata_queued_cmd *qc) { }
+
 /**
  *     ata_sg_init_one - Associate command with memory buffer
  *     @qc: Command to be associated
@@ -3907,7 +3911,6 @@ static inline int ata_should_dma_map(struct ata_queued_cmd *qc)
 
        case ATA_PROT_ATAPI:
        case ATA_PROT_PIO:
-       case ATA_PROT_PIO_MULT:
                if (ap->flags & ATA_FLAG_PIO_DMA)
                        return 1;
 
@@ -4199,14 +4202,17 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
 
 void ata_bmdma_irq_clear(struct ata_port *ap)
 {
-    if (ap->flags & ATA_FLAG_MMIO) {
-        void __iomem *mmio = ((void __iomem *) ap->ioaddr.bmdma_addr) + ATA_DMA_STATUS;
-        writeb(readb(mmio), mmio);
-    } else {
-        unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
-        outb(inb(addr), addr);
-    }
+       if (!ap->ioaddr.bmdma_addr)
+               return;
 
+       if (ap->flags & ATA_FLAG_MMIO) {
+               void __iomem *mmio =
+                     ((void __iomem *) ap->ioaddr.bmdma_addr) + ATA_DMA_STATUS;
+               writeb(readb(mmio), mmio);
+       } else {
+               unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
+               outb(inb(addr), addr);
+       }
 }
 
 
@@ -4337,9 +4343,9 @@ idle_irq:
 
 #ifdef ATA_IRQ_TRAP
        if ((ap->stats.idle_irq % 1000) == 0) {
-               handled = 1;
                ata_irq_ack(ap, 0); /* debug trap */
                printk(KERN_WARNING "ata%d: irq trap\n", ap->id);
+               return 1;
        }
 #endif
        return 0;       /* irq not handled */
@@ -5064,6 +5070,7 @@ EXPORT_SYMBOL_GPL(ata_port_stop);
 EXPORT_SYMBOL_GPL(ata_host_stop);
 EXPORT_SYMBOL_GPL(ata_interrupt);
 EXPORT_SYMBOL_GPL(ata_qc_prep);
+EXPORT_SYMBOL_GPL(ata_noop_qc_prep);
 EXPORT_SYMBOL_GPL(ata_bmdma_setup);
 EXPORT_SYMBOL_GPL(ata_bmdma_start);
 EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear);