summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2026-10-14 16:14:37 +0800
committersakumisu <[email protected]>2026-10-14 16:14:37 +0800
commit70aa87fa213972cf1b9f0f751c1685cb4fcf7688 (patch)
treebab15b16dcb6967373be59d55090a4b7a6084c32
parentcc6003b6ee8f7de5f055e4900044e2cacd5e993d (diff)
fix(port/ehci): fix killed to zero by 6c40a28302
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--port/ehci/usb_hc_ehci.c8
-rw-r--r--port/ehci/usb_hc_ehci.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/port/ehci/usb_hc_ehci.c b/port/ehci/usb_hc_ehci.c
index 3cbdae17..eaef8aad 100644
--- a/port/ehci/usb_hc_ehci.c
+++ b/port/ehci/usb_hc_ehci.c
@@ -634,14 +634,13 @@ static void ehci_urb_waitup(struct usbh_bus *bus, struct usbh_urb *urb)
qh = (struct ehci_qh_hw *)urb->hcpriv;
+ qh->remove_in_iaad = 0;
+
if (qh->killed == 1U) {
qh->killed = 2U;
return;
}
- qh->remove_in_iaad = 0;
- qh->killed = 0;
-
#ifdef CONFIG_USB_DCACHE_ENABLE
if (urb->transfer_buffer &&
((urb->setup && urb->setup->bmRequestType & 0x80) || (urb->ep->bEndpointAddress & 0x80)) &&
@@ -1393,10 +1392,10 @@ 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->killed = 1U;
urb->errorcode = -USB_ERR_SHUTDOWN;
if (remove_in_iaad) {
+ qh->killed = 1U; /* trigger iaad isr and wait isr done */
qh->remove_in_iaad = 1;
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
usb_osal_leave_critical_section(flags);
@@ -1410,6 +1409,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
return -USB_ERR_TIMEOUT;
}
}
+ qh->killed = 0;
} else {
usb_osal_leave_critical_section(flags);
}
diff --git a/port/ehci/usb_hc_ehci.h b/port/ehci/usb_hc_ehci.h
index 918feb3e..8e040489 100644
--- a/port/ehci/usb_hc_ehci.h
+++ b/port/ehci/usb_hc_ehci.h
@@ -64,7 +64,7 @@ struct ehci_qh_hw {
struct usbh_urb *urb;
usb_osal_sem_t waitsem;
uint8_t remove_in_iaad;
- volatile uint8_t killed;
+ volatile uint8_t killed; /* only used in usbh_kill_urb */
} __attribute__((aligned(CONFIG_USB_EHCI_ALIGN_SIZE)));
struct ehci_itd_hw {