Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1543925 > unrolled thread
| Started by | John Stultz <john.stultz@linaro.org> |
|---|---|
| First post | 2016-12-17 06:40 +0100 |
| Last post | 2016-12-17 06:40 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[RFC][PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board John Stultz <john.stultz@linaro.org> - 2016-12-17 06:40 +0100
[RFC][PATCH 3/5 v2] usb: dwc2: Force port resume on switching to device mode John Stultz <john.stultz@linaro.org> - 2016-12-17 06:40 +0100
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2016-12-17 06:40 +0100 |
| Subject | [RFC][PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board |
| Message-ID | <sPfSV-5nh-3@gated-at.bofh.it> |
I just wanted to re-send my current queue of patches for dwc2 controller on the HiKey board, as my last patchset ended up colliding with a number of changes that landed in the 4.10-rc merge window. I've fixed things up and validated these against HiKey. I also made a small change to one of the patches as suggested by Vardan. This does exclude my patchset[1] to add extcon support to dwc2, which John Youn suspects a pending rework of the dwc2 fifo init logic might make unnecssary (however, no such changes appeared to have landed in 4.10-rc, so I'm still using that patchset in my testing). I'm also out for the holidays after today, and while I suspect others are likely going to be out as well, I figured I'd send these out for a chance at review, rather then sit on them for two weeks. I'll resend after the new year addressing any feedback I do get though. Feedback would be greatly appreciated! thanks -john [1] https://lkml.org/lkml/2016/12/6/69 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: Douglas Anderson <dianders@chromium.org> Cc: Chen Yu <chenyu56@huawei.com> Cc: Vardan Mikayelyan <mvardan@synopsys.com> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Felipe Balbi <felipe.balbi@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Chen Yu (2): usb: dwc2: Force port resume on switching to device mode usb: dwc2: Add a quirk to allow speed negotiation for Hisilicon Hi6220 John Stultz (3): usb: dwc2: Avoid sleeping while holding hsotg->lock usb: dwc2: Workaround case where GOTGCTL state is wrong usb: dwc2: Avoid suspending if we're in gadget mode drivers/usb/dwc2/core.c | 6 ++-- drivers/usb/dwc2/core.h | 9 +++++- drivers/usb/dwc2/gadget.c | 2 +- drivers/usb/dwc2/hcd.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/dwc2/params.c | 19 ++++++++++++ 5 files changed, 110 insertions(+), 5 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2016-12-17 06:40 +0100 |
| Subject | [RFC][PATCH 3/5 v2] usb: dwc2: Force port resume on switching to device mode |
| Message-ID | <sPfSW-5nh-11@gated-at.bofh.it> |
| In reply to | #1543925 |
From: Chen Yu <chenyu56@huawei.com>
We've seen failures when switching between host and gadget mode,
which was diagnosed as being caused due to the bus being
auto-suspended when we switched.
So this patch forces a port resume when switching to device
mode if the bus is suspended.
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: Douglas Anderson <dianders@chromium.org>
Cc: Chen Yu <chenyu56@huawei.com>
Cc: Vardan Mikayelyan <mvardan@synopsys.com>
Cc: Kishon Vijay Abraham I <kishon@ti.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: Chen Yu <chenyu56@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
drivers/usb/dwc2/hcd.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index b60307a..a089946 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -54,6 +54,8 @@
#include "core.h"
#include "hcd.h"
+static void dwc2_port_resume(struct dwc2_hsotg *hsotg);
+
/*
* =========================================================================
* Host Core Layer Functions
@@ -3235,6 +3237,11 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
if (gotgctl & GOTGCTL_CONID_B) {
/* Wait for switch to device mode */
dev_dbg(hsotg->dev, "connId B\n");
+ if (hsotg->bus_suspended) {
+ dev_info(hsotg->dev,
+ "Do port resume before switching to device mode\n");
+ dwc2_port_resume(hsotg);
+ }
while (!dwc2_is_device_mode(hsotg)) {
dev_info(hsotg->dev,
"Waiting for Peripheral Mode, Mode=%s\n",
--
2.7.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web