summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/drivers/usb/dwc2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/dwc2.c b/payloads/libpayload/drivers/usb/dwc2.c
index 0941eb64d1..c51c0e71f0 100644
--- a/payloads/libpayload/drivers/usb/dwc2.c
+++ b/payloads/libpayload/drivers/usb/dwc2.c
@@ -274,6 +274,9 @@ dwc2_do_xfer(endpoint_t *ep, int size, int pid, ep_dir_t dir,
if (do_copy && (dir == EPDIR_OUT))
memcpy(aligned_buf, data_buf, size);
+ if (dwc2_disconnected(ep->dev->controller))
+ return -HCSTAT_DISCONNECTED;
+
writel(hctsiz.d32, &reg->host.hchn[ch_num].hctsizn);
writel((uint32_t)virt_to_bus(aligned_buf),
&reg->host.hchn[ch_num].hcdman);