sdide: make pkt io non interruptable, do scsionline in pio mode
This commit is contained in:
parent
a863f74881
commit
807e8e69ec
1 changed files with 15 additions and 7 deletions
|
@ -1228,7 +1228,7 @@ atapktio0(Drive *drive, SDreq *r)
|
||||||
atadmastart(ctlr, drive->write);
|
atadmastart(ctlr, drive->write);
|
||||||
iunlock(ctlr);
|
iunlock(ctlr);
|
||||||
|
|
||||||
if(iowait(drive, 20*1000, 1) <= 0){
|
if(iowait(drive, 30*1000, 0) <= 0){
|
||||||
ilock(ctlr);
|
ilock(ctlr);
|
||||||
ataabort(drive, 0);
|
ataabort(drive, 0);
|
||||||
} else
|
} else
|
||||||
|
@ -1244,7 +1244,7 @@ atapktio0(Drive *drive, SDreq *r)
|
||||||
if(drive->status & Chk){
|
if(drive->status & Chk){
|
||||||
if(drive->pktdma){
|
if(drive->pktdma){
|
||||||
print("atapktio: disabling dma\n");
|
print("atapktio: disabling dma\n");
|
||||||
drive->dmactl=0;
|
drive->dmactl = 0;
|
||||||
rv = SDretry;
|
rv = SDretry;
|
||||||
} else
|
} else
|
||||||
rv = SDcheck;
|
rv = SDcheck;
|
||||||
|
@ -1446,7 +1446,7 @@ atagenio(Drive* drive, SDreq *r)
|
||||||
qunlock(ctlr);
|
qunlock(ctlr);
|
||||||
return atagenioretry(drive, r, lba, count);
|
return atagenioretry(drive, r, lba, count);
|
||||||
}
|
}
|
||||||
iowait(drive, 60*1000, 0);
|
iowait(drive, 30*1000, 0);
|
||||||
if(!ctlr->done){
|
if(!ctlr->done){
|
||||||
/*
|
/*
|
||||||
* What should the above timeout be? In
|
* What should the above timeout be? In
|
||||||
|
@ -2400,11 +2400,13 @@ atadisable(SDev *sdev)
|
||||||
static int
|
static int
|
||||||
ataonline(SDunit *unit)
|
ataonline(SDunit *unit)
|
||||||
{
|
{
|
||||||
Ctlr *ctlr;
|
|
||||||
Drive *drive;
|
Drive *drive;
|
||||||
|
Ctlr *ctlr;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if((ctlr = unit->dev->ctlr) == nil || ctlr->drive[unit->subno] == nil)
|
if((ctlr = unit->dev->ctlr) == nil || ctlr->drive[unit->subno] == nil)
|
||||||
return 0;
|
return 0;
|
||||||
|
ret = 1;
|
||||||
drive = ctlr->drive[unit->subno];
|
drive = ctlr->drive[unit->subno];
|
||||||
if((drive->flags & Online) == 0){
|
if((drive->flags & Online) == 0){
|
||||||
drive->flags |= Online;
|
drive->flags |= Online;
|
||||||
|
@ -2412,9 +2414,15 @@ ataonline(SDunit *unit)
|
||||||
}
|
}
|
||||||
unit->sectors = drive->sectors;
|
unit->sectors = drive->sectors;
|
||||||
unit->secsize = drive->secsize;
|
unit->secsize = drive->secsize;
|
||||||
if(drive->feat & Datapi)
|
if(drive->feat & Datapi){
|
||||||
return scsionline(unit);
|
ulong dma;
|
||||||
return 1;
|
|
||||||
|
dma = drive->dmactl;
|
||||||
|
drive->dmactl = 0;
|
||||||
|
ret = scsionline(unit);
|
||||||
|
drive->dmactl = dma;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue