Kernel: Cleanup and fix xHCI interrupt handling
Always clear EventHandlerBusy bit and remove unnecessary nesting
This commit is contained in:
parent
c1d8790623
commit
480368c878
|
@ -463,16 +463,14 @@ namespace Kernel
|
||||||
|
|
||||||
void XHCIController::handle_irq()
|
void XHCIController::handle_irq()
|
||||||
{
|
{
|
||||||
|
auto& primary_interrupter = runtime_regs().irs[0];
|
||||||
|
primary_interrupter.iman = primary_interrupter.iman | XHCI::IMAN::InterruptPending | XHCI::IMAN::InterruptEnable;
|
||||||
|
|
||||||
auto& operational = operational_regs();
|
auto& operational = operational_regs();
|
||||||
if (!(operational.usbsts & XHCI::USBSTS::EventInterrupt))
|
if (!(operational.usbsts & XHCI::USBSTS::EventInterrupt))
|
||||||
return;
|
return;
|
||||||
operational.usbsts = XHCI::USBSTS::EventInterrupt;
|
operational.usbsts = XHCI::USBSTS::EventInterrupt;
|
||||||
|
|
||||||
auto& primary_interrupter = runtime_regs().irs[0];
|
|
||||||
primary_interrupter.iman = primary_interrupter.iman | XHCI::IMAN::InterruptPending | XHCI::IMAN::InterruptEnable;
|
|
||||||
|
|
||||||
if (current_event_trb().cycle == m_event_cycle)
|
|
||||||
{
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
auto& trb = current_event_trb();
|
auto& trb = current_event_trb();
|
||||||
|
@ -555,7 +553,6 @@ namespace Kernel
|
||||||
|
|
||||||
primary_interrupter.erdp = (m_event_ring_region->paddr() + (m_event_dequeue * sizeof(XHCI::TRB))) | XHCI::ERDP::EventHandlerBusy;
|
primary_interrupter.erdp = (m_event_ring_region->paddr() + (m_event_dequeue * sizeof(XHCI::TRB))) | XHCI::ERDP::EventHandlerBusy;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
volatile XHCI::CapabilityRegs& XHCIController::capability_regs()
|
volatile XHCI::CapabilityRegs& XHCIController::capability_regs()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue