Skip to content

Commit

Permalink
phy: lantiq: rcu-usb2: wait after clock enable
Browse files Browse the repository at this point in the history
commit 36acd5e upstream.

Commit 65dc2e7 ("usb: dwc2: Update Core Reset programming flow.")
revealed that the phy isn't ready immediately after enabling it's
clocks. The dwc2_check_core_version() fails and the dwc2 usb driver
errors out.

Add a short delay to let the phy get up and running. There isn't any
documentation how much time is required, the value was chosen based on
tests.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: <stable@vger.kernel.org> # v5.7+
Link: https://lore.kernel.org/r/20210107224901.2102479-1-dev@kresin.me
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
mkresin authored and gregkh committed Mar 4, 2021
1 parent b927c4f commit caefa14
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
Expand Up @@ -124,8 +124,16 @@ static int ltq_rcu_usb2_phy_power_on(struct phy *phy)
reset_control_deassert(priv->phy_reset);

ret = clk_prepare_enable(priv->phy_gate_clk);
if (ret)
if (ret) {
dev_err(dev, "failed to enable PHY gate\n");
return ret;
}

/*
* at least the xrx200 usb2 phy requires some extra time to be
* operational after enabling the clock
*/
usleep_range(100, 200);

return ret;
}
Expand Down

0 comments on commit caefa14

Please sign in to comment.