Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbcLGBoa (ORCPT ); Tue, 6 Dec 2016 20:44:30 -0500 Received: from mail-oi0-f44.google.com ([209.85.218.44]:34293 "EHLO mail-oi0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbcLGBo2 (ORCPT ); Tue, 6 Dec 2016 20:44:28 -0500 MIME-Version: 1.0 In-Reply-To: References: <1481011582-7162-1-git-send-email-john.stultz@linaro.org> <1481011582-7162-2-git-send-email-john.stultz@linaro.org> <4be239ba-b2f1-a951-d558-7469bf835556@synopsys.com> <5c4f7288-c0b1-f770-2141-067f4724e95f@synopsys.com> From: John Stultz Date: Tue, 6 Dec 2016 17:44:23 -0800 Message-ID: Subject: Re: [RFC][PATCH 1/3 v2] usb: dwc2: Add extcon support to dwc2 driver To: John Youn Cc: lkml , Wei Xu , Guodong Xu , Amit Pundir , Rob Herring , Douglas Anderson , Chen Yu , Kishon Vijay Abraham I , Felipe Balbi , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1680 Lines: 35 On Tue, Dec 6, 2016 at 4:35 PM, John Stultz wrote: > On Tue, Dec 6, 2016 at 4:26 PM, John Youn wrote: >> On 12/6/2016 4:05 PM, John Stultz wrote: >>> On Tue, Dec 6, 2016 at 3:17 PM, John Youn wrote: >>>> Also, do you really need this at all? Wasn't your system previously >>>> able to detect the ID pin change correctly via the connection id >>>> status change interrupt? This would only be needed if that were not >>>> the case. >>> >>> So it can be made work w/o this, but we needed other hacks because the >>> usb-gadget disconnect logic never triggered when the cable was >>> unplugged. The controller would jump over to host mode, then when we >>> re-plugged in the usb-gadget cable, it would fail often as we never >>> got a disconnect signal. That's why earlier I was using this hack to >>> force gadget disconnect before the reset was called: >>> https://lkml.org/lkml/2016/10/20/26 >> >> Other than the triggering WARN_ON() in fifo init, is there any other >> negative effects? > > Well, when we see the WARN_ON, it doesn't connect into usb-gadget > mode. I had to unplug and re-plug the cable. > (The hack I linked to above avoids this, but I suspect its not correct). > > Also Amit Pundir had mentioned earlier that the UDC sysfs state > doesn't get reported correctly since it doesn't register the > usb-gadget as unplugged until the cable is re-inserted. Actually, this is still an outstanding issue, as /sys/class/udc/f72c0000.usb/state seems to be stuck at "configured" no matter the state of the cable, even with my patches. I'll need to look further at the details there. thanks -john