fix(port/ehci): clear iaad status before set
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -1337,6 +1337,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
EHCI_HCOR->usbcmd |= (EHCI_USBCMD_PSEN | EHCI_USBCMD_ASEN);
|
EHCI_HCOR->usbcmd |= (EHCI_USBCMD_PSEN | EHCI_USBCMD_ASEN);
|
||||||
|
|
||||||
qh = (struct ehci_qh_hw *)urb->hcpriv;
|
qh = (struct ehci_qh_hw *)urb->hcpriv;
|
||||||
|
qh->remove_in_iaad = 0;
|
||||||
urb->errorcode = -USB_ERR_SHUTDOWN;
|
urb->errorcode = -USB_ERR_SHUTDOWN;
|
||||||
|
|
||||||
if (urb->timeout) {
|
if (urb->timeout) {
|
||||||
@@ -1347,6 +1348,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
|
|
||||||
if (remove_in_iaad) {
|
if (remove_in_iaad) {
|
||||||
volatile uint32_t timeout = 0;
|
volatile uint32_t timeout = 0;
|
||||||
|
EHCI_HCOR->usbsts = EHCI_USBSTS_IAA;
|
||||||
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
|
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
|
||||||
while (!(EHCI_HCOR->usbsts & EHCI_USBSTS_IAA)) {
|
while (!(EHCI_HCOR->usbsts & EHCI_USBSTS_IAA)) {
|
||||||
timeout++;
|
timeout++;
|
||||||
|
|||||||
Reference in New Issue
Block a user