From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbdCCJTG (ORCPT ); Fri, 3 Mar 2017 04:19:06 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35373 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911AbdCCJTC (ORCPT ); Fri, 3 Mar 2017 04:19:02 -0500 Subject: Re: [PATCH] usb: dwc2: Make sure we disconnect the gadget state To: John Stultz , lkml References: <1488497779-1894-1-git-send-email-john.stultz@linaro.org> Cc: Wei Xu , Guodong Xu , Amit Pundir , Rob Herring , John Youn , Douglas Anderson , Chen Yu , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org From: Sergei Shtylyov Message-ID: Date: Fri, 3 Mar 2017 12:18:29 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1488497779-1894-1-git-send-email-john.stultz@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 3/3/2017 2:36 AM, John Stultz wrote: > I had seen some odd behavior with HiKey's usb-gadget interface > that I finally seemed to have chased down. Basically every other > time I pluged in the OTG port, the gadget interface would Plugged. Perhaps could be fixed while applying... > properly initialize. The other times, I'd get a big WARN_ON > in dwc2_hsotg_init_fifo() about the fifo_map not being clear. > > Ends up if we don't disconnect the gadget state, the fifo-map > doesn't get cleared properly, which causes WARN_ON messages and > also results in the device not properly being setup as a gadget > every other time the OTG port is connected. > > So this patch adds a call to dwc2_hsotg_disconnect() in the > reset path so the state is properly cleared. > > With it, the gadget interface initializes properly on every > plug in. > > Cc: Wei Xu > Cc: Guodong Xu > Cc: Amit Pundir > Cc: Rob Herring > Cc: John Youn > Cc: Douglas Anderson > Cc: Chen Yu > Cc: Felipe Balbi > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > Acked-by: John Youn > Signed-off-by: John Stultz [...] MBR, Sergei