diff options
| author | Felipe Balbi <balbi@ti.com> | 2011-12-28 23:32:29 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2012-01-24 08:41:22 -0500 |
| commit | 68d8a781575d7be490f97eb2c403fb13b083da6a (patch) | |
| tree | 3f738a665891e751edeea80ed0af364b7a17fb16 /drivers | |
| parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) | |
usb: dwc3: ep0: tidy up Pending Request handling
The way our code was written, we should never have
a DWC3_EP_PENDING_REQUEST flag set out of a Data Phase
and the code in __dwc3_gadget_ep0_queue() did not
reflect that situation properly.
Tidy up that case to avoid any possible mistakes
when starting requests for IRQs which are long
gone.
Cc: stable@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/dwc3/ep0.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 2f51de57593a..74a3828cf950 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
| @@ -149,20 +149,14 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, | |||
| 149 | 149 | ||
| 150 | direction = !!(dep->flags & DWC3_EP0_DIR_IN); | 150 | direction = !!(dep->flags & DWC3_EP0_DIR_IN); |
| 151 | 151 | ||
| 152 | if (dwc->ep0state == EP0_STATUS_PHASE) { | 152 | if (dwc->ep0state != EP0_DATA_PHASE) { |
| 153 | type = dwc->three_stage_setup | 153 | dev_WARN(dwc->dev, "Unexpected pending request\n"); |
| 154 | ? DWC3_TRBCTL_CONTROL_STATUS3 | ||
| 155 | : DWC3_TRBCTL_CONTROL_STATUS2; | ||
| 156 | } else if (dwc->ep0state == EP0_DATA_PHASE) { | ||
| 157 | type = DWC3_TRBCTL_CONTROL_DATA; | ||
| 158 | } else { | ||
| 159 | /* should never happen */ | ||
| 160 | WARN_ON(1); | ||
| 161 | return 0; | 154 | return 0; |
| 162 | } | 155 | } |
| 163 | 156 | ||
| 164 | ret = dwc3_ep0_start_trans(dwc, direction, | 157 | ret = dwc3_ep0_start_trans(dwc, direction, |
| 165 | req->request.dma, req->request.length, type); | 158 | req->request.dma, req->request.length, |
| 159 | DWC3_TRBCTL_CONTROL_DATA); | ||
| 166 | dep->flags &= ~(DWC3_EP_PENDING_REQUEST | | 160 | dep->flags &= ~(DWC3_EP_PENDING_REQUEST | |
| 167 | DWC3_EP0_DIR_IN); | 161 | DWC3_EP0_DIR_IN); |
| 168 | } else if (dwc->delayed_status) { | 162 | } else if (dwc->delayed_status) { |
