Skip to content

Commit 39fdbc8

Browse files
committed
Updated the clearing of the status register bits to use a straight '=', rather than an '|='. Use of the latter caused an extra, unwanted read of the status register before the write-to-clear operation, which, in some cases, allowed new status bits to assert (relative to the initial read of the status register two statements earlier), and then be cleared blindly and unconditionally during the write-back. This had the potential (and, in my case, observed) effect of dropping the handling of an enabled interrupt. Ultimately, the system would lock up in a busy state, with no hope of clearing the condition. See Issue hathach#1339 for more information.
1 parent b797d1a commit 39fdbc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/portable/ehci/ehci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void hcd_int_handler(uint8_t rhport)
657657
uint32_t int_status = regs->status;
658658
int_status &= regs->inten;
659659

660-
regs->status |= int_status; // Acknowledge handled interrupt
660+
regs->status = int_status; // Acknowledge handled interrupt
661661

662662
if (int_status == 0) return;
663663

0 commit comments

Comments
 (0)