Re: 2.6.24.X: SATA/AHCI related boot delay. - not with 2.6.24.3

From: Tejun Heo
Date: Tue Apr 22 2008 - 10:16:05 EST


Volker Armin Hemmann wrote:
On Dienstag, 22. April 2008, Peer Chen wrote:
Looks like the BIOS trap had been applied, GHC.AE suppose should be set
correctly. Volker, could you try to set the AE twice in the driver or using
mmapper to set the AE manually to check if AE will be set correctly or not?

emm, I am totally out of my depth here. I don't even know what you are talking about. If you explain me in nice, little word or even better, with examples, what I shall try, I will happily do so.

This patch should do the trick.

--
tejun
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 3efa990..dbbf6cf 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -562,15 +562,23 @@ static inline void __iomem *ahci_port_base(struct ata_port *ap)

static void ahci_enable_ahci(void __iomem *mmio)
{
+ int i;
u32 tmp;

- /* turn on AHCI_EN */
tmp = readl(mmio + HOST_CTL);
- if (!(tmp & HOST_AHCI_EN)) {
+ if (tmp & HOST_AHCI_EN)
+ return;
+
+ for (i = 0; i < 10; i++) {
+ msleep(100);
tmp |= HOST_AHCI_EN;
writel(tmp, mmio + HOST_CTL);
tmp = readl(mmio + HOST_CTL); /* flush && sanity check */
- WARN_ON(!(tmp & HOST_AHCI_EN));
+
+ /* turn on AHCI_EN */
+ if (tmp & HOST_AHCI_EN)
+ break;
+ printk("AHCI_EN failed i=%d\n", i);
}
}