Commit e2617796 authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarFelipe Balbi <balbi@ti.com>
parent e0ce0b0a
No related merge requests found
...@@ -302,11 +302,14 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, ...@@ -302,11 +302,14 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
response_pkt = (__le16 *) dwc->setup_buf; response_pkt = (__le16 *) dwc->setup_buf;
*response_pkt = cpu_to_le16(usb_status); *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.length = sizeof(*response_pkt);
dwc->ep0_usb_req.request.dma = dwc->setup_buf_addr; dwc->ep0_usb_req.request.dma = dwc->setup_buf_addr;
dwc->ep0_usb_req.request.complete = dwc3_ep0_status_cmpl; 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, static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment