summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-09-27 22:18:10 +0800
committersakumisu <[email protected]>2025-09-27 22:20:10 +0800
commitc25171d69f92584acbc62e065521fd3854d8529c (patch)
treed5d146347889f007df262fa85e420c09451d88aa
parentbfb55eeb369d341712422f824175ab743388e1b8 (diff)
fix(port/ehci): clear iaad status before set
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--port/ehci/usb_hc_ehci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/port/ehci/usb_hc_ehci.c b/port/ehci/usb_hc_ehci.c
index 2ebe1134..e278f523 100644
--- a/port/ehci/usb_hc_ehci.c
+++ b/port/ehci/usb_hc_ehci.c
@@ -1337,6 +1337,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
EHCI_HCOR->usbcmd |= (EHCI_USBCMD_PSEN | EHCI_USBCMD_ASEN);
qh = (struct ehci_qh_hw *)urb->hcpriv;
+ qh->remove_in_iaad = 0;
urb->errorcode = -USB_ERR_SHUTDOWN;
if (urb->timeout) {
@@ -1347,6 +1348,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
if (remove_in_iaad) {
volatile uint32_t timeout = 0;
+ EHCI_HCOR->usbsts = EHCI_USBSTS_IAA;
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
while (!(EHCI_HCOR->usbsts & EHCI_USBSTS_IAA)) {
timeout++;