diff options
| author | wooyay <[email protected]> | 2023-02-14 17:03:19 +0000 |
|---|---|---|
| committer | Ryan Wendland <[email protected]> | 2023-02-18 10:48:39 +1030 |
| commit | 4e2afdf5e1d72a2232f349a878c3d4147fc43cd6 (patch) | |
| tree | 02efc0030c3f96fd1bacc2d3f5bec4fe2f554dfb | |
| parent | 75f6583c1c9ad3e0c2fc9e3427a649edbf765bef (diff) | |
ohci: Disable MIE interrupt during IRQ processing, zero HccADoneHead on completion
| -rw-r--r-- | src/portable/ohci/ohci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/portable/ohci/ohci.c b/src/portable/ohci/ohci.c index d16de0cca..76f97844c 100644 --- a/src/portable/ohci/ohci.c +++ b/src/portable/ohci/ohci.c @@ -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 |
