ohci: Disable MIE interrupt during IRQ processing, zero HccADoneHead on completion

This commit is contained in:
wooyay 2023-02-14 17:03:19 +00:00 committed by Ryan Wendland
parent 75f6583c1c
commit 4e2afdf5e1
1 changed files with 6 additions and 0 deletions

View File

@ -606,6 +606,7 @@ static void done_queue_isr(uint8_t hostid)
// done head is written in reversed order of completion --> need to reverse the done queue first
ohci_td_item_t* td_head = list_reverse ( (ohci_td_item_t*) tu_align16(ohci_data.hcca.done_head) );
ohci_data.hcca.done_head = 0;
while( td_head != NULL )
{
@ -652,6 +653,9 @@ void hcd_int_handler(uint8_t hostid)
if (int_status == 0) return;
// Disable MIE as per OHCI spec 5.3
OHCI_REG->interrupt_disable = OHCI_INT_MASTER_ENABLE_MASK;
// Frame number overflow
if ( int_status & OHCI_INT_FRAME_OVERFLOW_MASK )
{
@ -694,6 +698,8 @@ void hcd_int_handler(uint8_t hostid)
}
OHCI_REG->interrupt_status = int_status; // Acknowledge handled interrupt
OHCI_REG->interrupt_enable = OHCI_INT_MASTER_ENABLE_MASK; // Enable MIE
}
//--------------------------------------------------------------------+
// HELPER