Message ID | 1501816547-23684-2-git-send-email-john.stultz@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patches@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1605635qge; Thu, 3 Aug 2017 20:15:53 -0700 (PDT) X-Received: by 10.98.101.4 with SMTP id z4mr907049pfb.163.1501816553187; Thu, 03 Aug 2017 20:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501816553; cv=none; d=google.com; s=arc-20160816; b=SSDLCCf/ErhqJDDWuxF32QQCenSWvh2PUyXKC2753S+H/KEOcuMNpc4wPeZ9L8LjBY Ym6M4YRhe/A1emZ8B+JpIFkWYgc4s08XVbudIkvPs1Dq/WboTyogblqnMs10LFHVmqlU TXwJWQLJL7u2nISBpjjCoH7kYhDdsWkZzxzqLMRsEaJexuoJbSzRu47bhVeWkgdtMWQ1 2abliVzV++MpPV49yRZOhLMMkZqgXOM0ir7LXW7JFYiGBmjj2BcYiJsKa4Q745apspix NK3mjQgMK+oWFZ2Sb8d4S977+OqgcQsCKvm7Bg3R7a9ciB4aFgecSzjVhZpnuw545KpD kwSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=JnSJEmb/vK41k9UtXqbdtnqqyG4MS94erPHTWvtr6dU=; b=y/C8WhGGvwDI60bwZr70dqIxCgCDII341MJbyYCqSRiFN4SWNyQfPL/17ZRM+hnvCc 2ncBlEjyHC+Jc3rWK0l4qs9xREvuw3/7qWpd0iUKSnADC5xH03w9jtSTzf5qhCvNw+xK j3Cbz+UObQ5O5mlj1H2CqRQJaORGHd5CQUdQTTKjwBPBOtJ8zhq5h/sEa5rNmdeLQlrt fft+13JeBYAEXc9HY5AhA3VDljVqbnnvt6HjF+37YWVuV4biFBJMhd0Y9/ntt4oELK/Q tchUSarmTZ5B1LF0eQ7Tft9Wy9BgZ3eHtK8NkBcVr0C3b05aXJMJyCUQwhScocCE4R6q OsiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=LKfuWhRV; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <john.stultz@linaro.org> Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com. [2607:f8b0:400e:c05::230]) by mx.google.com with ESMTPS id d29si380161plj.904.2017.08.03.20.15.53 for <patches@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 20:15:53 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) client-ip=2607:f8b0:400e:c05::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=LKfuWhRV; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x230.google.com with SMTP id v77so2490888pgb.3 for <patches@linaro.org>; Thu, 03 Aug 2017 20:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JnSJEmb/vK41k9UtXqbdtnqqyG4MS94erPHTWvtr6dU=; b=LKfuWhRVnb3BUkOOJ3ZST72DoHH+fe53inB3ISmCcHTksSMkfQvmO+CbGyEguH81TW FTR4uOQ0CAwCRF36aDYsnVJzpCSPXcOQAaV9noVe5CeT5nkNN3gypehqCRPIFV/yr2Dt vP7RilhgF6r9f0z+UYDltdgUwKYbbeSPPU8i0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JnSJEmb/vK41k9UtXqbdtnqqyG4MS94erPHTWvtr6dU=; b=shHSyw5DJtBnYnku2xEIcHnNyQxsFcT15wPl71MB7YSj4XlxLURnHP/rYO59ViA7xr cETkPAzm7OhmzgBbRNrZ4/BSKtSfZ3/o3VuvketIIyFmVA+JEQpH2JLxhwSDyB10e9Dz 8//MDoI8AtUA+Jf0Itjd9x5FepPgAcRocjSmiy0R16qJjp9nD44pD4mpr75XbYCNcOUE rxKbStE59Au4dx1fYaDS4wMylvXBGxYx2Y+ilClZylC7B6JyuUA9IH/De6cP2c8gnTmc 1sgj0byJ7sGNRDd0xgRcXq1m4y9ZUQsLo/EpUDxHYhEYD31GCb30Ds4YG0IzWY55cfRA OUFQ== X-Gm-Message-State: AIVw113ZfPQ7Kzks38WQy8/vEWTxWzEne1u1By7c2/KF1gf8GnV2EVMk qzJJ+LBC1OriH/Z8V4yAx26D X-Received: by 10.99.95.200 with SMTP id t191mr816676pgb.237.1501816552891; Thu, 03 Aug 2017 20:15:52 -0700 (PDT) Return-Path: <john.stultz@linaro.org> Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id x5sm450262pgq.18.2017.08.03.20.15.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 20:15:52 -0700 (PDT) From: John Stultz <john.stultz@linaro.org> To: lkml <linux-kernel@vger.kernel.org> Cc: John Stultz <john.stultz@linaro.org>, Wei Xu <xuwei5@hisilicon.com>, Guodong Xu <guodong.xu@linaro.org>, Amit Pundir <amit.pundir@linaro.org>, Rob Herring <robh+dt@kernel.org>, John Youn <johnyoun@synopsys.com>, Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>, Douglas Anderson <dianders@chromium.org>, Chen Yu <chenyu56@huawei.com>, Felipe Balbi <felipe.balbi@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-usb@vger.kernel.org Subject: [RFC][PATCH 2/2] usb: dwc2: Fix UDC state tracking Date: Thu, 3 Aug 2017 20:15:47 -0700 Message-Id: <1501816547-23684-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501816547-23684-1-git-send-email-john.stultz@linaro.org> References: <1501816547-23684-1-git-send-email-john.stultz@linaro.org> |
Series |
[RFC,1/2] usb: dwc2: Improve gadget state disconnection handling
|
expand
|
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index c4066cd..e6f2cd8 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3202,6 +3202,8 @@ void dwc2_hsotg_disconnect(struct dwc2_hsotg *hsotg) call_gadget(hsotg, disconnect); hsotg->lx_state = DWC2_L3; + + usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED); } /**
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. Feedback or suggestions would be greatly appreciated! Cc: Wei Xu <xuwei5@hisilicon.com> Cc: Guodong Xu <guodong.xu@linaro.org> Cc: Amit Pundir <amit.pundir@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: John Youn <johnyoun@synopsys.com> Cc: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> Cc: Douglas Anderson <dianders@chromium.org> Cc: Chen Yu <chenyu56@huawei.com> Cc: Felipe Balbi <felipe.balbi@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz <john.stultz@linaro.org> --- drivers/usb/dwc2/gadget.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4