From b36db23b277112bffabe661363bdcf01b08ecaa6 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 26 Sep 2007 00:02:41 -0400 Subject: [PATCH] --- yaml --- r: 68126 b: refs/heads/master c: 3cc3eb1148e4b2dfabf7a1dcf36fd8be1331ca95 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/ata/ahci.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 29e24ff3bdc1..0841a6159a46 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b90fe23bd51c6b1c298159591c833bdd24f55002 +refs/heads/master: 3cc3eb1148e4b2dfabf7a1dcf36fd8be1331ca95 diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index 9f3c591c7214..b615390b6b8a 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -827,8 +827,14 @@ static int ahci_reset_controller(struct ata_host *host) void __iomem *mmio = host->iomap[AHCI_PCI_BAR]; u32 tmp; - /* global controller reset */ + /* we must be in AHCI mode, before using anything + * AHCI-specific, such as HOST_RESET. + */ tmp = readl(mmio + HOST_CTL); + if (!(tmp & HOST_AHCI_EN)) + writel(tmp | HOST_AHCI_EN, mmio + HOST_CTL); + + /* global controller reset */ if ((tmp & HOST_RESET) == 0) { writel(tmp | HOST_RESET, mmio + HOST_CTL); readl(mmio + HOST_CTL); /* flush */