Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbdLHDhZ (ORCPT ); Thu, 7 Dec 2017 22:37:25 -0500 Received: from imap1.codethink.co.uk ([176.9.8.82]:46408 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751633AbdLHDhX (ORCPT ); Thu, 7 Dec 2017 22:37:23 -0500 Message-ID: <1512704237.18523.221.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 13/49] usb: dwc2: Fix UDC state tracking From: Ben Hutchings To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Wei Xu , Guodong Xu , Amit Pundir , YongQin Liu , John Youn , Minas Harutyunyan , Douglas Anderson , Chen Yu , Felipe Balbi , linux-usb@vger.kernel.org, Minas Harutyunyan , John Stultz , Sasha Levin Date: Fri, 08 Dec 2017 03:37:17 +0000 In-Reply-To: <20171207124705.660131394@linuxfoundation.org> References: <20171207124703.742654162@linuxfoundation.org> <20171207124705.660131394@linuxfoundation.org> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2181 Lines: 66 On Thu, 2017-12-07 at 14:07 +0100, Greg Kroah-Hartman wrote: > 4.4-stable review patch.  If anyone has any objections, please let me > know. > > ------------------ > > From: John Stultz > > > [ Upstream commit ce2b21a4e5ce042c0a42c9db8fa9e0f849427d5e ] > > It has been noticed that the dwc2 udc state reporting doesn't > seem to work (at least on HiKey boards). Where after the initial > setup, the sysfs /sys/class/udc/f72c0000.usb/state file would > report "configured" no matter the state of the OTG port. > > This patch adds a call so that we report to the UDC layer when > the gadget device is disconnected. > > This patch does depend on the previous patch ("usb: dwc2: > Improve gadget state disconnection handling") in this patch set > in order to properly work. Then you should add that (commit d2471d4a24df). Ben. > Cc: Wei Xu > Cc: Guodong Xu > Cc: Amit Pundir > Cc: YongQin Liu > Cc: John Youn > Cc: Minas Harutyunyan > Cc: Douglas Anderson > Cc: Chen Yu > Cc: Felipe Balbi > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > Acked-by: Minas Harutyunyan > Tested-by: Minas Harutyunyan > Reported-by: Amit Pundir > Signed-off-by: John Stultz > Signed-off-by: Felipe Balbi > Signed-off-by: Sasha Levin > Signed-off-by: Greg Kroah-Hartman > --- >  drivers/usb/dwc2/gadget.c |    2 ++ >  1 file changed, 2 insertions(+) > > --- a/drivers/usb/dwc2/gadget.c > +++ b/drivers/usb/dwc2/gadget.c > @@ -2206,6 +2206,8 @@ void dwc2_hsotg_disconnect(struct dwc2_h >   >   call_gadget(hsotg, disconnect); >   hsotg->lx_state = DWC2_L3; > + > + usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED); >  } >   >  /** > > > -- Ben Hutchings Software Developer, Codethink Ltd.