On Wed, 26 Sep 2007 00:03:19 -0400
Jeff Garzik <jeff@xxxxxxxxxx> wrote:
Peer Chen wrote:According to the description of section 126.96.36.199 and 10.1.2 of AHCI specification rev1_1/rev1_2, GHC.HR shall only be set to ÂÂ1ÂÂapplied the attached patch, inspired by yours.
by software when GHC.AE is set to ÂÂ1ÂÂ.
Signed-off-by: Peer Chen <peerchen@xxxxxxxxx>
--- linux-2.6.23-rc7/drivers/ata/ahci.c.orig 2007-09-20 11:01:55.000000000 -0400
+++ linux-2.6.23-rc7/drivers/ata/ahci.c 2007-09-20 11:07:31.000000000 -0400
@@ -834,6 +834,10 @@ static int ahci_reset_controller(struct void __iomem *mmio = host->iomap[AHCI_PCI_BAR];
+ /* turn on AHCI mode before controller reset*/
+ writel(HOST_AHCI_EN, mmio + HOST_CTL);
+ (void) readl(mmio + HOST_CTL); /* flush */
NAK - mmio is an iomap so writel and readl are the wrong things to use