diff mbox series

[v1,1/8] usb: phy: tegra: Add delay after power up

Message ID 20201215202113.30394-2-digetx@gmail.com
State Superseded
Headers show
Series Support Runtime PM and host mode by Tegra ChipIdea USB driver | expand

Commit Message

Dmitry Osipenko Dec. 15, 2020, 8:21 p.m. UTC
The PHY hardware needs the delay of 2ms after power up, otherwise initial
interrupt may be lost if USB controller is accessed before PHY is settled
down. Previously this issue was masked by implicit delays, but now it pops
up after squashing the older ehci-tegra driver into the ChipIdea driver.

Tested-by: Matt Merhar <mattmerhar@protonmail.com>
Tested-by: Nicolas Chauvet <kwizart@gmail.com>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/usb/phy/phy-tegra-usb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sergei Shtylyov Dec. 16, 2020, 8:51 a.m. UTC | #1
Hello!

On 15.12.2020 23:21, Dmitry Osipenko wrote:

> The PHY hardware needs the delay of 2ms after power up, otherwise initial
> interrupt may be lost if USB controller is accessed before PHY is settled
> down. Previously this issue was masked by implicit delays, but now it pops
> up after squashing the older ehci-tegra driver into the ChipIdea driver.
> 
> Tested-by: Matt Merhar <mattmerhar@protonmail.com>
> Tested-by: Nicolas Chauvet <kwizart@gmail.com>
> Tested-by: Peter Geis <pgwipeout@gmail.com>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>   drivers/usb/phy/phy-tegra-usb.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> index 03a333797382..cee9c9dbb775 100644
> --- a/drivers/usb/phy/phy-tegra-usb.c
> +++ b/drivers/usb/phy/phy-tegra-usb.c
> @@ -784,6 +784,9 @@ static int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
>   
>   	phy->powered_on = true;
>   
> +	/* let PHY to settle down */

    Let the PHY settle down.

> +	usleep_range(2000, 2500);
> +
>   	return 0;
>   }
>   

MBR, Sergei
Dmitry Osipenko Dec. 16, 2020, 9:09 a.m. UTC | #2
16.12.2020 11:51, Sergei Shtylyov пишет:
> Hello!
> 
> On 15.12.2020 23:21, Dmitry Osipenko wrote:
> 
>> The PHY hardware needs the delay of 2ms after power up, otherwise initial
>> interrupt may be lost if USB controller is accessed before PHY is settled
>> down. Previously this issue was masked by implicit delays, but now it
>> pops
>> up after squashing the older ehci-tegra driver into the ChipIdea driver.
>>
>> Tested-by: Matt Merhar <mattmerhar@protonmail.com>
>> Tested-by: Nicolas Chauvet <kwizart@gmail.com>
>> Tested-by: Peter Geis <pgwipeout@gmail.com>
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>>   drivers/usb/phy/phy-tegra-usb.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/usb/phy/phy-tegra-usb.c
>> b/drivers/usb/phy/phy-tegra-usb.c
>> index 03a333797382..cee9c9dbb775 100644
>> --- a/drivers/usb/phy/phy-tegra-usb.c
>> +++ b/drivers/usb/phy/phy-tegra-usb.c
>> @@ -784,6 +784,9 @@ static int tegra_usb_phy_power_on(struct
>> tegra_usb_phy *phy)
>>         phy->powered_on = true;
>>   +    /* let PHY to settle down */
> 
>    Let the PHY settle down.

Hi,

I'll improve the comments in v2, thanks.
diff mbox series

Patch

diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 03a333797382..cee9c9dbb775 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -784,6 +784,9 @@  static int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
 
 	phy->powered_on = true;
 
+	/* let PHY to settle down */
+	usleep_range(2000, 2500);
+
 	return 0;
 }