qtd = DWC_CIRCLEQ_FIRST(&qh->qtd_list);
if (qtd->urb != NULL) {
hcd->fops->complete(hcd, qtd->urb->priv,
- qtd->urb, -DWC_E_TIMEOUT);
+ qtd->urb, -DWC_E_SHUTDOWN);
dwc_otg_hcd_qtd_remove_and_free(hcd, qtd, qh);
}
if (!hcd->flags.b.port_connect_status) {
/* No longer connected. */
- DWC_ERROR("Not connected\n");
+ DWC_DEBUG("Not connected\n");
return -DWC_E_NO_DEVICE;
}
int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd)
{
int retval = 0;
+ dwc_irqflags_t flags;
dwc_otg_core_if_t *core_if = dwc_otg_hcd->core_if;
gintsts_data_t gintsts;
if (core_if->hibernation_suspend == 1) {
return retval;
}
- DWC_SPINLOCK(dwc_otg_hcd->lock);
+ DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &flags);
/* Check if HOST Mode */
if (dwc_otg_is_host_mode(core_if)) {
gintsts.d32 = dwc_otg_read_core_intr(core_if);
if (!gintsts.d32) {
- DWC_SPINUNLOCK(dwc_otg_hcd->lock);
+ DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, flags);
return 0;
}
#ifdef DEBUG
#endif
}
- DWC_SPINUNLOCK(dwc_otg_hcd->lock);
+ DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, flags);
return retval;
}
{
DWC_ERROR("--Host Channel %d Interrupt: "
"Data Toggle Error--\n", hc->hc_num);
+ if (!hcd->flags.b.port_connect_status) {
+ /* No longer connected. */
+ DWC_ERROR("Not connected\n");
+ return 1;
+ }
if (hc->ep_is_in) {
qtd->error_count += 3;//Complete the error URB immediately
} else {