Skip to content

Commit

Permalink
ohci: Disable MIE interrupt during IRQ processing, zero HccADoneHead …
Browse files Browse the repository at this point in the history
…on completion
  • Loading branch information
wooyay authored and Ryzee119 committed Feb 18, 2023
1 parent c105c30 commit 0045b17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/portable/ohci/ohci.c
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0045b17

Please sign in to comment.