Skip to content

Commit 4e2afdf

Browse files
wooyayRyzee119
authored andcommitted
ohci: Disable MIE interrupt during IRQ processing, zero HccADoneHead on completion
1 parent 75f6583 commit 4e2afdf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/portable/ohci/ohci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ static void done_queue_isr(uint8_t hostid)
606606

607607
// done head is written in reversed order of completion --> need to reverse the done queue first
608608
ohci_td_item_t* td_head = list_reverse ( (ohci_td_item_t*) tu_align16(ohci_data.hcca.done_head) );
609+
ohci_data.hcca.done_head = 0;
609610

610611
while( td_head != NULL )
611612
{
@@ -652,6 +653,9 @@ void hcd_int_handler(uint8_t hostid)
652653

653654
if (int_status == 0) return;
654655

656+
// Disable MIE as per OHCI spec 5.3
657+
OHCI_REG->interrupt_disable = OHCI_INT_MASTER_ENABLE_MASK;
658+
655659
// Frame number overflow
656660
if ( int_status & OHCI_INT_FRAME_OVERFLOW_MASK )
657661
{
@@ -694,6 +698,8 @@ void hcd_int_handler(uint8_t hostid)
694698
}
695699

696700
OHCI_REG->interrupt_status = int_status; // Acknowledge handled interrupt
701+
702+
OHCI_REG->interrupt_enable = OHCI_INT_MASTER_ENABLE_MASK; // Enable MIE
697703
}
698704
//--------------------------------------------------------------------+
699705
// HELPER

0 commit comments

Comments
 (0)