linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: tegra: Delay for disabling LFPS detector
@ 2020-12-18 16:42 JC Kuo
  2020-12-18 16:53 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: JC Kuo @ 2020-12-18 16:42 UTC (permalink / raw)
  To: mathias.nyman, gregkh, thierry.reding, jonathanh, robh
  Cc: linux-tegra, linux-usb, nkristam, JC Kuo

Occasionally, we are seeing some SuperSpeed devices resumes right after
being directed to U3. This commits add 500us delay to ensure LFPS
detector is disabled before sending ACK to firmware.

[   16.099363] tegra-xusb 70090000.usb: entering ELPG
[   16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203
[   16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16
[   16.120789] tegra-xusb 70090000.usb: entering ELPG failed

Signed-off-by: JC Kuo <jckuo@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 934be1686352..20cdc11f7dc6 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -623,6 +623,12 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
 								     enable);
 			if (err < 0)
 				break;
+
+			/*
+			 * wait 500us for LFPS detector to be disabled before sending ACK
+			 */
+			if (!enable)
+				usleep_range(500, 1000);
 		}
 
 		if (err < 0) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xhci: tegra: Delay for disabling LFPS detector
  2020-12-18 16:42 [PATCH] xhci: tegra: Delay for disabling LFPS detector JC Kuo
@ 2020-12-18 16:53 ` Greg KH
  2021-01-06  6:05   ` JC Kuo
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-12-18 16:53 UTC (permalink / raw)
  To: JC Kuo
  Cc: mathias.nyman, thierry.reding, jonathanh, robh, linux-tegra,
	linux-usb, nkristam

On Sat, Dec 19, 2020 at 12:42:34AM +0800, JC Kuo wrote:
> Occasionally, we are seeing some SuperSpeed devices resumes right after
> being directed to U3. This commits add 500us delay to ensure LFPS
> detector is disabled before sending ACK to firmware.
> 
> [   16.099363] tegra-xusb 70090000.usb: entering ELPG
> [   16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203
> [   16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16
> [   16.120789] tegra-xusb 70090000.usb: entering ELPG failed
> 
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> ---
>  drivers/usb/host/xhci-tegra.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 934be1686352..20cdc11f7dc6 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -623,6 +623,12 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
>  								     enable);
>  			if (err < 0)
>  				break;
> +
> +			/*
> +			 * wait 500us for LFPS detector to be disabled before sending ACK
> +			 */
> +			if (!enable)
> +				usleep_range(500, 1000);

Where does the magic 500us come from?  How can we "know" this is long
enough?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xhci: tegra: Delay for disabling LFPS detector
  2020-12-18 16:53 ` Greg KH
@ 2021-01-06  6:05   ` JC Kuo
  2021-01-07  9:53     ` Mathias Nyman
  0 siblings, 1 reply; 5+ messages in thread
From: JC Kuo @ 2021-01-06  6:05 UTC (permalink / raw)
  To: Greg KH
  Cc: mathias.nyman, thierry.reding, jonathanh, robh, linux-tegra,
	linux-usb, nkristam

On 12/19/20 12:53 AM, Greg KH wrote:
> On Sat, Dec 19, 2020 at 12:42:34AM +0800, JC Kuo wrote:
>> Occasionally, we are seeing some SuperSpeed devices resumes right after
>> being directed to U3. This commits add 500us delay to ensure LFPS
>> detector is disabled before sending ACK to firmware.
>>
>> [   16.099363] tegra-xusb 70090000.usb: entering ELPG
>> [   16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203
>> [   16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16
>> [   16.120789] tegra-xusb 70090000.usb: entering ELPG failed
>>
>> Signed-off-by: JC Kuo <jckuo@nvidia.com>
>> ---
>>  drivers/usb/host/xhci-tegra.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
>> index 934be1686352..20cdc11f7dc6 100644
>> --- a/drivers/usb/host/xhci-tegra.c
>> +++ b/drivers/usb/host/xhci-tegra.c
>> @@ -623,6 +623,12 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
>>  								     enable);
>>  			if (err < 0)
>>  				break;
>> +
>> +			/*
>> +			 * wait 500us for LFPS detector to be disabled before sending ACK
>> +			 */
>> +			if (!enable)
>> +				usleep_range(500, 1000);
> 
> Where does the magic 500us come from?  How can we "know" this is long
> enough?

Hi Greg,
The register write passes through a few flop stages of 32KHz clock domain. Our
ASIC designer reviewed RTL and suggests 500us delay. It has also been verified
thoroughly.

Thanks,
JC

> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xhci: tegra: Delay for disabling LFPS detector
  2021-01-06  6:05   ` JC Kuo
@ 2021-01-07  9:53     ` Mathias Nyman
  2021-01-08  6:32       ` JC Kuo
  0 siblings, 1 reply; 5+ messages in thread
From: Mathias Nyman @ 2021-01-07  9:53 UTC (permalink / raw)
  To: JC Kuo, Greg KH
  Cc: thierry.reding, jonathanh, robh, linux-tegra, linux-usb, nkristam

On 6.1.2021 8.05, JC Kuo wrote:
> On 12/19/20 12:53 AM, Greg KH wrote:
>> On Sat, Dec 19, 2020 at 12:42:34AM +0800, JC Kuo wrote:
>>> Occasionally, we are seeing some SuperSpeed devices resumes right after
>>> being directed to U3. This commits add 500us delay to ensure LFPS
>>> detector is disabled before sending ACK to firmware.
>>>
>>> [   16.099363] tegra-xusb 70090000.usb: entering ELPG
>>> [   16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203
>>> [   16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16
>>> [   16.120789] tegra-xusb 70090000.usb: entering ELPG failed
>>>
>>> Signed-off-by: JC Kuo <jckuo@nvidia.com>
>>> ---
>>>  drivers/usb/host/xhci-tegra.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
>>> index 934be1686352..20cdc11f7dc6 100644
>>> --- a/drivers/usb/host/xhci-tegra.c
>>> +++ b/drivers/usb/host/xhci-tegra.c
>>> @@ -623,6 +623,12 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
>>>  								     enable);
>>>  			if (err < 0)
>>>  				break;
>>> +
>>> +			/*
>>> +			 * wait 500us for LFPS detector to be disabled before sending ACK
>>> +			 */
>>> +			if (!enable)
>>> +				usleep_range(500, 1000);
>>
>> Where does the magic 500us come from?  How can we "know" this is long
>> enough?
> 
> Hi Greg,
> The register write passes through a few flop stages of 32KHz clock domain. Our
> ASIC designer reviewed RTL and suggests 500us delay. It has also been verified
> thoroughly.
> 

Could you add that comment to the commit message? I can pick it up then.
Should this go to stable as well?

Thanks
-Mathias

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xhci: tegra: Delay for disabling LFPS detector
  2021-01-07  9:53     ` Mathias Nyman
@ 2021-01-08  6:32       ` JC Kuo
  0 siblings, 0 replies; 5+ messages in thread
From: JC Kuo @ 2021-01-08  6:32 UTC (permalink / raw)
  To: Mathias Nyman, Greg KH
  Cc: thierry.reding, jonathanh, robh, linux-tegra, linux-usb, nkristam



On 1/7/21 5:53 PM, Mathias Nyman wrote:
> On 6.1.2021 8.05, JC Kuo wrote:
>> On 12/19/20 12:53 AM, Greg KH wrote:
>>> On Sat, Dec 19, 2020 at 12:42:34AM +0800, JC Kuo wrote:
>>>> Occasionally, we are seeing some SuperSpeed devices resumes right after
>>>> being directed to U3. This commits add 500us delay to ensure LFPS
>>>> detector is disabled before sending ACK to firmware.
>>>>
>>>> [   16.099363] tegra-xusb 70090000.usb: entering ELPG
>>>> [   16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203
>>>> [   16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16
>>>> [   16.120789] tegra-xusb 70090000.usb: entering ELPG failed
>>>>
>>>> Signed-off-by: JC Kuo <jckuo@nvidia.com>
>>>> ---
>>>>  drivers/usb/host/xhci-tegra.c | 6 ++++++
>>>>  1 file changed, 6 insertions(+)
>>>>
>>>> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
>>>> index 934be1686352..20cdc11f7dc6 100644
>>>> --- a/drivers/usb/host/xhci-tegra.c
>>>> +++ b/drivers/usb/host/xhci-tegra.c
>>>> @@ -623,6 +623,12 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
>>>>  								     enable);
>>>>  			if (err < 0)
>>>>  				break;
>>>> +
>>>> +			/*
>>>> +			 * wait 500us for LFPS detector to be disabled before sending ACK
>>>> +			 */
>>>> +			if (!enable)
>>>> +				usleep_range(500, 1000);
>>>
>>> Where does the magic 500us come from?  How can we "know" this is long
>>> enough?
>>
>> Hi Greg,
>> The register write passes through a few flop stages of 32KHz clock domain. Our
>> ASIC designer reviewed RTL and suggests 500us delay. It has also been verified
>> thoroughly.
>>
> 
> Could you add that comment to the commit message? I can pick it up then.
> Should this go to stable as well?
> 
Hi Mathias,
Yes, I will send v2 with the information in commit message.
Yes, this should go to stable as well.

Thanks,
JC

> Thanks
> -Mathias
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-08  6:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 16:42 [PATCH] xhci: tegra: Delay for disabling LFPS detector JC Kuo
2020-12-18 16:53 ` Greg KH
2021-01-06  6:05   ` JC Kuo
2021-01-07  9:53     ` Mathias Nyman
2021-01-08  6:32       ` JC Kuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).