diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2013-11-01 17:05:12 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-11-25 17:56:45 +0100 |
commit | a535d81c92615b8ffb99b7e1fd1fb01effaed1af (patch) | |
tree | 2aa52efe0447fdd839d14936cd87817acabeb53c /drivers/usb/dwc3/gadget.c | |
parent | usb: gadget: mass storage: fix return of delayed status (diff) | |
download | linux-a535d81c92615b8ffb99b7e1fd1fb01effaed1af.tar.xz linux-a535d81c92615b8ffb99b7e1fd1fb01effaed1af.zip |
usb: dwc3: fix implementation of endpoint wedge
The dwc3 UDC driver doesn't implement endpoint wedging correctly.
When an endpoint is wedged, the gadget driver should be allowed to
clear the wedge by calling usb_ep_clear_halt(). Only the host is
prevented from resetting the endpoint.
This patch fixes the implementation.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Pratyush Anand <pratyush.anand@st.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 5452c0fce360..02e44fcaf205 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1200,9 +1200,6 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value) else dep->flags |= DWC3_EP_STALL; } else { - if (dep->flags & DWC3_EP_WEDGE) - return 0; - ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, DWC3_DEPCMD_CLEARSTALL, ¶ms); if (ret) @@ -1210,7 +1207,7 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value) value ? "set" : "clear", dep->name); else - dep->flags &= ~DWC3_EP_STALL; + dep->flags &= ~(DWC3_EP_STALL | DWC3_EP_WEDGE); } return ret; |