On 9/9/2015 3:21 AM, Mian Yousaf Kaukab wrote:
> Make sure there are no requests pending on ep0 before reinitializing
> core. Otherwise, dwc2_hsotg_enqueue_setup will fail afterwards.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kau...@intel.com>
> Tested-by: Robert Baldyga <r.bald...@samsung.com>
> ---
>  drivers/usb/dwc2/gadget.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index c7da6b7..a6a1a6a 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -2287,6 +2287,9 @@ void dwc2_hsotg_core_init_disconnected(struct 
> dwc2_hsotg *hsotg,
>  {
>       u32 val;
>  
> +     /* Kill any ep0 requests as controller will be reinitialized */
> +     kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET);
> +

I am seeing this hang when I start off as a B-device, then plug
in an A-cable with no device attached on the other end. Then
unplug it.

I haven't verified but it is probably due to the
dwc2_hsotg_complete_request() (called from kill_all_requests)
expecting lock to be held. But this is not locked when called
from dwc2_conn_id_status_change().

John

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to