shithub: riscv

Download patch

ref: b3eeb599641a85a06ef039cf495d4ce2b7fac258
parent: eb687adecd365876d6b6918a9ee4f8e8e7f205f6
author: cinap_lenrek <[email protected]>
date: Fri May 16 17:33:49 EDT 2014

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.

--- a/sys/src/9/pc/sdiahci.c
+++ b/sys/src/9/pc/sdiahci.c
@@ -723,7 +723,7 @@
 
 	h->ghc |= Hhr;
 	for(wait = 0; wait < 1000; wait += 100){
-		if(h->ghc == 0)
+		if((h->ghc & Hhr) == 0)
 			return 0;
 		delay(100);
 	}