summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-11-29 10:35:47 +0200
committerFelipe Balbi <balbi@ti.com>2011-12-12 11:48:46 +0200
commite2617796053437df586c53e462076f74bcf268b4 (patch)
tree0cf93cc0b643af4313bc84e64bdab7d37836976a /drivers/usb/dwc3
parente0ce0b0a0ae5a31ee96b38a7c5390f867634b4f6 (diff)
downloadop-kernel-dev-e2617796053437df586c53e462076f74bcf268b4.zip
op-kernel-dev-e2617796053437df586c53e462076f74bcf268b4.tar.gz
usb: dwc3: ep0: fix GetStatus handling (again)
previous commit fixed part of it but it was still calling usb_ep_queue() from IRQ context without loosing locks. That cannot be done otherwise we will have a recursive locking. Also, we need to assign the 'dep' pointer on dwc->ep0_usb_req otherwise we will have a NULL pointer dereference on dwc3_map_buffer_to_dma(). Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/ep0.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 1ba86a1..d6bfc73 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -302,11 +302,14 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
response_pkt = (__le16 *) dwc->setup_buf;
*response_pkt = cpu_to_le16(usb_status);
+
+ dep = dwc->eps[0];
+ dwc->ep0_usb_req.dep = dep;
dwc->ep0_usb_req.request.length = sizeof(*response_pkt);
dwc->ep0_usb_req.request.dma = dwc->setup_buf_addr;
dwc->ep0_usb_req.request.complete = dwc3_ep0_status_cmpl;
- return usb_ep_queue(&dwc->eps[0]->endpoint, &dwc->ep0_usb_req.request,
- GFP_ATOMIC);
+
+ return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req);
}
static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
OpenPOWER on IntegriCloud