Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474593 > unrolled thread

[RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays

Started byJohn Youn <johnyoun@synopsys.com>
First post2016-09-01 23:10 +0200
Last post2016-09-07 12:40 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays John Youn <johnyoun@synopsys.com> - 2016-09-01 23:10 +0200
    [RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode John Youn <johnyoun@synopsys.com> - 2016-09-01 23:20 +0200
    Re: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode  delays Stefan Wahren <stefan.wahren@i2se.com> - 2016-09-06 23:50 +0200
      Re: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays Felipe Balbi <balbi@kernel.org> - 2016-09-07 12:40 +0200

#1474593 — [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays

FromJohn Youn <johnyoun@synopsys.com>
Date2016-09-01 23:10 +0200
Subject[RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays
Message-ID<scHpf-70l-7@gated-at.bofh.it>
This series accounts for the delay from the IDDIG debounce filter when
switching modes. This delay is a function of the PHY clock speed and
can range from 5-50 ms. This delay must be taken into account on core
reset and force modes. A full explanation is provided in the patch
commit log and code comments.

This revision of the series increases the IDDIG delay to 100 ms. Some
rockchip platforms seem to timeout even with 50 ms so I have doubled
this.

Appreciate any testing on RK3188 and RPi platforms.

v4:
* Increased the IDDIG delay to 110ms.
* Removed tested-by for patch 2 since I have changed the delays.

v3:
* Added tested-bys for patch 1-2
* Fixed an issue where a function was not returning a value
* Dropped patch 4

v2:
* Broke up the last patch of the original series

Regards,
John

John Youn (3):
  usb: dwc2: gadget: Only initialize device if in device mode
  usb: dwc2: Add delay to core soft reset
  usb: dwc2: Properly account for the force mode delays

 drivers/usb/dwc2/core.c   | 126 +++++++++++++++++++++++++++++++++++++++-------
 drivers/usb/dwc2/core.h   |   1 +
 drivers/usb/dwc2/gadget.c |   7 ++-
 drivers/usb/dwc2/hw.h     |   1 +
 4 files changed, 116 insertions(+), 19 deletions(-)

-- 
2.9.0

[toc] | [next] | [standalone]


#1474616 — [RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode

FromJohn Youn <johnyoun@synopsys.com>
Date2016-09-01 23:20 +0200
Subject[RFT PATCH v4 1/3] usb: dwc2: gadget: Only initialize device if in device mode
Message-ID<scHyW-75a-27@gated-at.bofh.it>
In reply to#1474593
In dwc2_hsotg_udc_start(), don't initialize the controller for device
mode unless we are actually in device mode.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: John Youn <johnyoun@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 94bd19a..4cd6403 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3466,8 +3466,11 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget,
 		otg_set_peripheral(hsotg->uphy->otg, &hsotg->gadget);
 
 	spin_lock_irqsave(&hsotg->lock, flags);
-	dwc2_hsotg_init(hsotg);
-	dwc2_hsotg_core_init_disconnected(hsotg, false);
+	if (dwc2_hw_is_device(hsotg)) {
+		dwc2_hsotg_init(hsotg);
+		dwc2_hsotg_core_init_disconnected(hsotg, false);
+	}
+
 	hsotg->enabled = 0;
 	spin_unlock_irqrestore(&hsotg->lock, flags);
 
-- 
2.9.0

[toc] | [prev] | [next] | [standalone]


#1477835 — Re: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays

FromStefan Wahren <stefan.wahren@i2se.com>
Date2016-09-06 23:50 +0200
SubjectRe: [RFT PATCH v4 0/3] usb: dwc2: Fix core reset and force mode delays
Message-ID<sewpH-7zd-11@gated-at.bofh.it>
In reply to#1474593
Hi John,

> John Youn <johnyoun@synopsys.com> hat am 1. September 2016 um 23:07
> geschrieben:
> 
> 
> This series accounts for the delay from the IDDIG debounce filter when
> switching modes. This delay is a function of the PHY clock speed and
> can range from 5-50 ms. This delay must be taken into account on core
> reset and force modes. A full explanation is provided in the patch
> commit log and code comments.
> 
> This revision of the series increases the IDDIG delay to 100 ms. Some
> rockchip platforms seem to timeout even with 50 ms so I have doubled
> this.
> 
> Appreciate any testing on RK3188 and RPi platforms.

i tested the whole series successful with a Raspberry Pi B in dr_mode "host" and
"otg"

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

[toc] | [prev] | [next] | [standalone]


#1478168

FromFelipe Balbi <balbi@kernel.org>
Date2016-09-07 12:40 +0200
Message-ID<seIqT-6Zc-51@gated-at.bofh.it>
In reply to#1477835

[Multipart message — attachments visible in raw view] — view raw

Hi,

Stefan Wahren <stefan.wahren@i2se.com> writes:
> Hi John,
>
>> John Youn <johnyoun@synopsys.com> hat am 1. September 2016 um 23:07
>> geschrieben:
>> 
>> 
>> This series accounts for the delay from the IDDIG debounce filter when
>> switching modes. This delay is a function of the PHY clock speed and
>> can range from 5-50 ms. This delay must be taken into account on core
>> reset and force modes. A full explanation is provided in the patch
>> commit log and code comments.
>> 
>> This revision of the series increases the IDDIG delay to 100 ms. Some
>> rockchip platforms seem to timeout even with 50 ms so I have doubled
>> this.
>> 
>> Appreciate any testing on RK3188 and RPi platforms.
>
> i tested the whole series successful with a Raspberry Pi B in dr_mode "host" and
> "otg"
>
> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

John, when you're happy with the series, please resend without RFT so I
can apply :-)

-- 
balbi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web