summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-05-02 04:23:21 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-05-02 04:23:21 +0200
commitbeb665051bc635299e905ecb8abc5dfd9c3f011e (patch)
tree5bc27ed379d01d3898852725ee8af53da94dd9d3
parent8fea0399b0535193af7c1cba0c7a72c00c146a78 (diff)
downloadplan9front-beb665051bc635299e905ecb8abc5dfd9c3f011e.tar.xz
sdide: never timeout or retry scsi commands from the controller driver
this was a big mistake. we should never attempt to timeout or retry a scsi command from the controller driver because theres no way to tell how long a command would take or if a command has side effects when being retried.
-rw-r--r--sys/src/9/pc/sdide.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/src/9/pc/sdide.c b/sys/src/9/pc/sdide.c
index ce7a391a3..892285ddf 100644
--- a/sys/src/9/pc/sdide.c
+++ b/sys/src/9/pc/sdide.c
@@ -1115,11 +1115,14 @@ atapktio0(Drive *drive, SDreq *r)
atadmastart(ctlr, drive->write);
iunlock(ctlr);
- if(iowait(drive, 30*1000, 0) <= 0){
- ilock(ctlr);
+ while(iowait(drive, 30*1000, 1) == 0)
+ ;
+
+ ilock(ctlr);
+ if(!ctlr->done){
+ rv = SDcheck;
ataabort(drive, 0);
- } else
- ilock(ctlr);
+ }
if(drive->error){
if(drive->pktdma)
atadmastop(ctlr);
@@ -1128,12 +1131,11 @@ atapktio0(Drive *drive, SDreq *r)
}
iunlock(ctlr);
- if(drive->status & Chk){
+ if(rv != SDcheck && drive->status & Chk){
rv = SDcheck;
if(drive->pktdma){
print("atapktio: disabling dma\n");
drive->dmactl = 0;
- rv = SDretry;
}
}
return rv;