]> err.no Git - linux-2.6/blobdiff - drivers/ata/ahci.c
ALSA: wm8750: add missing VREF output
[linux-2.6] / drivers / ata / ahci.c
index 65d4e968feb497928e14c30d07b544de033844d9..ef3e5522e1a4a41979ff5ec56b72ed860d004275 100644 (file)
@@ -1142,12 +1142,15 @@ static int ahci_reset_controller(struct ata_host *host)
                        readl(mmio + HOST_CTL); /* flush */
                }
 
-               /* reset must complete within 1 second, or
+               /*
+                * to perform host reset, OS should set HOST_RESET
+                * and poll until this bit is read to be "0".
+                * reset must complete within 1 second, or
                 * the hardware should be considered fried.
                 */
-               ssleep(1);
+               tmp = ata_wait_register(mmio + HOST_CTL, HOST_RESET,
+                                       HOST_RESET, 10, 1000);
 
-               tmp = readl(mmio + HOST_CTL);
                if (tmp & HOST_RESET) {
                        dev_printk(KERN_ERR, host->dev,
                                   "controller reset failed (0x%x)\n", tmp);
@@ -1270,7 +1273,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
        void __iomem *mmio = ap->host->iomap[AHCI_PCI_BAR];
        u32 em_ctl;
        u32 message[] = {0, 0};
-       unsigned int flags;
+       unsigned long flags;
        int pmp;
        struct ahci_em_priv *emp;
 
@@ -2133,7 +2136,6 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
        if (qc->tf.protocol == ATA_PROT_NCQ)
                writel(1 << qc->tag, port_mmio + PORT_SCR_ACT);
        writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE);
-       readl(port_mmio + PORT_CMD_ISSUE);      /* flush */
 
        ahci_sw_activity(qc->dev->link);