On 8/25/2016 3:01 AM, Heiko Stübner wrote:
> Hi John,
> 
> Am Mittwoch, 24. August 2016, 16:20:01 schrieb John Youn:
>> When a force mode bit is set and the IDDIG debounce filter is enabled,
>> there is a delay for the forced mode to take effect. This delay is due
>> to the IDDIG debounce filter and is variable depending on the platform's
>> PHY clock speed. To account for this delay we can poll for the expected
>> mode.
>>
>> On a clear force mode, since we don't know what mode to poll for, delay
>> for a fixed 50 ms. This is the maximum delay based on the slowest PHY
>> clock speed.
>>
>> Signed-off-by: John Youn <johny...@synopsys.com>
> 
> starting with this patch, I see debounce-failed messages:
> [    7.934100] usb usb2-port1: connect-debounce failed
> 
> on my rk3188. Port is in host-mode and I'll try to investigate further.
> 
> One more thing below.
> 
>> ---
>>  drivers/usb/dwc2/core.c | 32 ++++++++++++++------------------
>>  1 file changed, 14 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
>> index bb903e2..caad6121 100644
>> --- a/drivers/usb/dwc2/core.c
>> +++ b/drivers/usb/dwc2/core.c
>> @@ -397,9 +397,9 @@ int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>>   * Checks are done in this function to determine whether doing a force
>>   * would be valid or not.
>>   *
>> - * If a force is done, it requires a 25ms delay to take effect.
>> - *
>> - * Returns true if the mode was forced.
>> + * If a force is done, it requires a IDDIG debounce filter delay if
>> + * the filter is configured and enabled. We poll the current mode of
>> + * the controller to account for this delay.
>>   */
>>  static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host)
>>  {
>> @@ -434,12 +434,17 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg,
>> bool host) gusbcfg |= set;
>>      dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG);
>>
>> -    msleep(25);
>> -    return true;
>> +    dwc2_wait_for_mode(hsotg, host, 50);
> 
> missing a return value and thus resulting in
> 
> ../drivers/usb/dwc2/core.c: In function ‘dwc2_force_mode’:
> ../drivers/usb/dwc2/core.c:438:1: warning: control reaches end of non-void 
> function [-Wreturn-type]
> 

Ok, I'll resubmit the series with this fix and without patch 4 for
now.

Thanks for testing.

I'm not sure what could be going on here and how it could affect the
hub port debounce. This patch doesn't really do much and only adjust a
few delays per the databook.

With the fixed series, could you provide a log with debug enabled in
the usb core and verbose debug enabled in dwc2? And also with/without
patch 3 applied?

In particular I'd like to know what delays are being introduced or
removed, and if the rk3188 has the IDDIG filter.

Regards,
John
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to