make sure there are no pending interrupts during setup

This commit is contained in:
Marcus Overhagen
2012-09-14 18:58:57 +02:00
parent c2ff7a30e3
commit 863a181c0b
@@ -122,6 +122,10 @@ AHCIController::Init()
return B_ERROR;
}
// make sure interrupts are disabled
fRegs->ghc &= ~GHC_IE;
FlushPostedWrites();
if (ResetController() < B_OK) {
TRACE("controller reset failed\n");
goto err;
@@ -194,6 +198,12 @@ AHCIController::Init()
}
}
// clear any pending interrupts
uint32 interruptsPending;
interruptsPending = fRegs->is;
fRegs->is = interruptsPending;
FlushPostedWrites();
// enable interrupts
fRegs->ghc |= GHC_IE;
FlushPostedWrites();