[coreboot-gerrit] Patch set updated for coreboot: 2e71337 libpayload: ahci: Increase timeout for signature reading

Nico Huber (nico.huber@secunet.com) gerrit at coreboot.org
Mon Jun 17 22:44:51 CEST 2013


Nico Huber (nico.huber at secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3493

-gerrit

commit 2e71337345893e1b4214110a071f0fe9b2ffa10c
Author: Nico Huber <nico.huber at secunet.com>
Date:   Mon Jun 17 17:42:35 2013 +0200

    libpayload: ahci: Increase timeout for signature reading
    
    We can't read the drives signature before it's ready, i.e. spun up.
    So set the timeout to the standard 30s. Also put a notice on the
    console, so the user knows why the signature reading failed.
    
    Change-Id: I2148258f9b0eb950b71544dafd95776ae70afac8
    Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
 payloads/libpayload/drivers/storage/ahci.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/payloads/libpayload/drivers/storage/ahci.c b/payloads/libpayload/drivers/storage/ahci.c
index 2b33b59..f1fe729 100644
--- a/payloads/libpayload/drivers/storage/ahci.c
+++ b/payloads/libpayload/drivers/storage/ahci.c
@@ -406,11 +406,17 @@ static int ahci_dev_init(hba_ctrl_t *const ctrl,
 	dev->cmdtable = cmdtable;
 	dev->rcvd_fis = rcvd_fis;
 
-	/* Wait for D2H Register FIS with device' signature. */
-	int timeout = 200; /* Time out after 200 * 10ms == 2s. */
+	/*
+	 * Wait for D2H Register FIS with device' signature.
+	 * The drive has to spin up here, so wait up to 30s.
+	 */
+	int timeout = 3 * 1000; /* Time out after 3,000 * 10ms == 30s. */
 	while ((port->taskfile_data & HBA_PxTFD_BSY) && timeout--)
 		mdelay(10);
 
+	if (port->taskfile_data & HBA_PxTFD_BSY)
+		printf("ahci: Timed out waiting for device to spin up.\n");
+
 	/* Initialize device or fall through to clean up. */
 	switch (port->signature) {
 	case HBA_PxSIG_ATA:



More information about the coreboot-gerrit mailing list