From b3eeb599641a85a06ef039cf495d4ce2b7fac258 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 16 May 2014 21:33:49 +0200 Subject: sdiahci: fix (unused) hba reset function (thanks erik quanstro) from the specification: software may reset the entire HBA by setting GHC.HR to '1'. When software sets the GHC.HR bit to '1', the HBA shall perform an internal reset action. The bit shall be cleared to '0' by the HBA when the reset is complete. --- sys/src/9/pc/sdiahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/9/pc/sdiahci.c b/sys/src/9/pc/sdiahci.c index 2e1d6e0bc..159ee1607 100644 --- a/sys/src/9/pc/sdiahci.c +++ b/sys/src/9/pc/sdiahci.c @@ -723,7 +723,7 @@ ahcihbareset(Ahba *h) h->ghc |= Hhr; for(wait = 0; wait < 1000; wait += 100){ - if(h->ghc == 0) + if((h->ghc & Hhr) == 0) return 0; delay(100); } -- cgit v1.2.3