From 39fdbc8ffca3cb0a610ce4140e1d527beb47ad3d Mon Sep 17 00:00:00 2001 From: Tom Peterson Date: Fri, 25 Feb 2022 12:39:09 -0600 Subject: [PATCH] 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 #1339 for more information. --- src/portable/ehci/ehci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c index e92f8a951..9b998cda6 100644 --- a/src/portable/ehci/ehci.c +++ b/src/portable/ehci/ehci.c @@ -657,7 +657,7 @@ void hcd_int_handler(uint8_t rhport) uint32_t int_status = regs->status; int_status &= regs->inten; - regs->status |= int_status; // Acknowledge handled interrupt + regs->status = int_status; // Acknowledge handled interrupt if (int_status == 0) return;