diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2013-11-01 12:05:12 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-11-25 10:56:45 -0600 |
commit | a535d81c92615b8ffb99b7e1fd1fb01effaed1af (patch) | |
tree | 2aa52efe0447fdd839d14936cd87817acabeb53c /drivers/usb/dwc3/ep0.c | |
parent | 655403c21236af7b121c8c44618e60ff747acc87 (diff) | |
download | linux-stable-a535d81c92615b8ffb99b7e1fd1fb01effaed1af.tar.gz linux-stable-a535d81c92615b8ffb99b7e1fd1fb01effaed1af.tar.bz2 linux-stable-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/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 95f7649c71a7..21a352079bc2 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -459,6 +459,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, dep = dwc3_wIndex_to_dep(dwc, wIndex); if (!dep) return -EINVAL; + if (set == 0 && (dep->flags & DWC3_EP_WEDGE)) + break; ret = __dwc3_gadget_ep_set_halt(dep, set); if (ret) return -EINVAL; |