mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "usb: dwc3: gadget: Prevent queue on endpoints after bus reset"
This commit is contained in:
commit
d326c44fa2
1 changed files with 6 additions and 3 deletions
|
|
@ -1596,7 +1596,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
|
|||
{
|
||||
struct dwc3 *dwc = dep->dwc;
|
||||
|
||||
if (!dep->endpoint.desc || !dwc->pullups_connected) {
|
||||
if (!dep->endpoint.desc || !dwc->pullups_connected ||
|
||||
!dwc->connected) {
|
||||
dev_err_ratelimited(dwc->dev, "%s: can't queue to disabled endpoint\n",
|
||||
dep->name);
|
||||
return -ESHUTDOWN;
|
||||
|
|
@ -3361,6 +3362,8 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)
|
|||
{
|
||||
struct usb_gadget_driver *gadget_driver;
|
||||
|
||||
dwc->connected = false;
|
||||
|
||||
if (!dwc->gadget_driver)
|
||||
return;
|
||||
|
||||
|
|
@ -3494,8 +3497,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
|
|||
{
|
||||
u32 reg;
|
||||
|
||||
dwc->connected = true;
|
||||
|
||||
/*
|
||||
* WORKAROUND: DWC3 revisions <1.88a have an issue which
|
||||
* would cause a missing Disconnect Event if there's a
|
||||
|
|
@ -3681,6 +3682,8 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
|
|||
dwc3_writel(dwc->regs, DWC3_DCTL, reg);
|
||||
}
|
||||
|
||||
dwc->connected = true;
|
||||
|
||||
dep = dwc->eps[0];
|
||||
ret = __dwc3_gadget_ep_enable(dep, DWC3_DEPCFG_ACTION_MODIFY);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue