diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 41223c7..0c0c444 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -657,6 +657,19 @@ static void ahci_power_up(struct ata_port *ap)

        /* wake up link */
        writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD);
+
+       /*
+        * Wait for PxSSTS.DET == 1h or 3h, step 5 of 10.1.1 in
+        * AHCI 1.3 spec. See 10.10.2 for spin-up procedure.
+        */
+       if (ata_wait_register(ap, port_mmio + ahci_scr_offset(ap, SCR_STATUS),
+                               0x01, 0x00, 1, 10)) {
+               /* also wait for DRQ to be cleared */
+               ata_wait_register(ap, port_mmio + PORT_TFDATA, ATA_DRQ,
+                               ATA_DRQ, 1, 10);
+
+               /* proceed with step 6, 7 of 10.1.1 in AHCI 1.3 spec? */
+       }
 }

 static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
