aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-07-19 14:05:08 -0400
committerFelipe Balbi <balbi@ti.com>2012-08-03 02:28:27 -0400
commit7125d584d20ba7624488ddefa84b17ea6ce558f1 (patch)
tree5ae6c805e9b7d318a9d225119193abb30dee7372 /drivers/usb/dwc3
parent2e3db064855a637c45f7e011214f15bc536e61ad (diff)
usb: dwc3: ep0: fix status phase delayed status direction
commit 68d3e66 (usb: dwc3: ep0: fix for possible early delayed_status) added handling for early delayed status, but the current code only works because so far delayed status will always be on the IN direction. This patch makes the code more robust by making sure that we can handle all directions properly. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/ep0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 3936c64c8bab..3f2c698a2bd1 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -164,10 +164,13 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,
164 * handle it here. 164 * handle it here.
165 */ 165 */
166 if (dwc->delayed_status) { 166 if (dwc->delayed_status) {
167 unsigned direction;
168
169 direction = !dwc->ep0_expect_in;
167 dwc->delayed_status = false; 170 dwc->delayed_status = false;
168 171
169 if (dwc->ep0state == EP0_STATUS_PHASE) 172 if (dwc->ep0state == EP0_STATUS_PHASE)
170 __dwc3_ep0_do_control_status(dwc, dwc->eps[1]); 173 __dwc3_ep0_do_control_status(dwc, dwc->eps[direction]);
171 else 174 else
172 dev_dbg(dwc->dev, "too early for delayed status\n"); 175 dev_dbg(dwc->dev, "too early for delayed status\n");
173 176