[libata] AHCI: fix newly introduced host-reset bug
authorJeff Garzik <jeff@garzik.org>
Mon, 29 Oct 2007 14:43:55 +0000 (10:43 -0400)
committerJeff Garzik <jeff@garzik.org>
Mon, 29 Oct 2007 14:43:55 +0000 (10:43 -0400)
The recent fix to host reset introduced a problem, whereby AHCI-enable
bit would be cleared upon reset, if it was not asserted prior to reset.

Unconditionally enable AHCI-enable bit.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/ahci.c

index 93bcb2cb3d35703700d8008bb60a9106d3112c35..c8ab947cf3594347fc159066b133c9db62f57d00 100644 (file)
@@ -898,8 +898,10 @@ static int ahci_reset_controller(struct ata_host *host)
         * AHCI-specific, such as HOST_RESET.
         */
        tmp = readl(mmio + HOST_CTL);
-       if (!(tmp & HOST_AHCI_EN))
-               writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL);
+       if (!(tmp & HOST_AHCI_EN)) {
+               tmp |= HOST_AHCI_EN;
+               writel(tmp, mmio + HOST_CTL);
+       }
 
        /* global controller reset */
        if ((tmp & HOST_RESET) == 0) {