shithub: riscv

Download patch

ref: f3609bada2fdae4f5f66d00eecb1ed3068abcf42
parent: df1d6ba99da637f21cc38d2690ad599c1a803a86
author: cinap_lenrek <[email protected]>
date: Thu Apr 19 10:50:00 EDT 2012

sdide: increase Drq wait timeouts (fixes i/o errors in vbox)

--- a/sys/src/9/pc/sdide.c
+++ b/sys/src/9/pc/sdide.c
@@ -1108,7 +1108,7 @@
 	outb(cmdport+Command, Cpkt);
 
 	microdelay(1);
-	as = ataready(cmdport, ctlport, 0, Bsy, Drq|Chk, 4*1000);
+	as = ataready(cmdport, ctlport, 0, Bsy, Drq|Chk, 400*1000);
 	if(as < 0 || (as & (Bsy|Chk))){
 		drive->status = as<0 ? 0 : as;
 		ctlr->curdrive = nil;
@@ -1256,8 +1256,7 @@
 	case Cws:
 	case Cwsm:
 		microdelay(1);
-		/* 10*1000 for flash ide drives - maybe detect them? */
-		as = ataready(cmdport, ctlport, 0, Bsy, Drq|Err, 10*1000);
+		as = ataready(cmdport, ctlport, 0, Bsy, Drq|Err, 400*1000);
 		if(as < 0 || (as & Err)){
 			iunlock(ctlr);
 			return -1;
@@ -1479,8 +1478,7 @@
 		USED(d);
 	else if(!isdma){
 		microdelay(1);
-		/* 10*1000 for flash ide drives - maybe detect them? */
-		as = ataready(cmdport, ctlport, 0, Bsy, Drq|Err, 10*1000);
+		as = ataready(cmdport, ctlport, 0, Bsy, Drq|Err, 400*1000);
 		if(as < 0 || (as & Err)){
 			iunlock(ctlr);
 			return -1;