[PATCH] phy: phy-google-usb: reset USB3 PHY before init

André Draszik andre.draszik at linaro.org
Thu Nov 19 02:47:07 PST 2026


google_usb3_phy_init() assumes that the PHY is in reset and that the
Type-C Assist (TCA) block is in its power-on state. Neither is the
case when the driver probes for the first time on Pixel 10, where the
boot loader has used USB before: the PHY is out of reset and
operational (lane0 phystatus is low right away, whereas it takes about
12ms for a PHY that really was in reset), and the TCA has been
switched to USB already (TCA_TCPC reads 0x1).

When the PHY is initialised in that state, the soft reset of the DWC3
controller hangs in about one out of four boots on blazer (Pixel 10
Pro, 12 of 50 boots), with DCTL.CSFTRST still set seconds later:

    dwc3-google c400000.usb: DWC3 controller soft reset failed.
    dwc3-google c400000.usb: error -ETIMEDOUT: failed to initialize core

In addition, google_usb3_phy_power_on() waits for the TCA to report
that the transition to 'no connection' has completed. The TCA starts
that transition by itself after a power-on reset (TCA_TCPC resets to a
request for it). Without a power-on reset there is no such transition,
and the wait only succeeds as long as the event is still pending from
earlier. Just asserting the PHY resets before initialising the PHY is
therefore not enough: the event was gone in 8 of 32 boots then, and
powering on the PHY failed with "PoR->NC transition timeout".

So, before initialising the PHY:
* assert its resets and drop the reference clock request, which is the
  state google_usb3_phy_exit() leaves the PHY in
* clear the TCA's events and request the transition to 'no
  connection', so that google_usb3_phy_power_on() waits for a
  transition that this initialisation has caused

The resets are kept asserted for 1ms. That is the duration that has
been tested, not a documented requirement.

With this, USB came up in 20 of 20 boots on blazer, and in 25 of 25
re-probes of the controller (unbind and bind of dwc3-google).

Fixes: 8c2b331e6327 ("phy: Add USB3 PHY support to Google Tensor SoC USB PHY driver")
Signed-off-by: André Draszik <andre.draszik at linaro.org>
---
For now, I've not added stable@ as the phy driver only exists since
7.4-rc1. If this patch isn't applied before 7.4 comes out, it'll need
the tag.
---
 drivers/phy/phy-google-usb.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/phy/phy-google-usb.c b/drivers/phy/phy-google-usb.c
index 2acdb2b0e534..4d70b2f1cfe3 100644
--- a/drivers/phy/phy-google-usb.c
+++ b/drivers/phy/phy-google-usb.c
@@ -8,6 +8,7 @@
 #include <linux/bitfield.h>
 #include <linux/cleanup.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
@@ -366,6 +367,25 @@ static int google_usb3_phy_init(struct phy *_phy)
 		return 0;
 	}
 
+	/*
+	 * The PHY might be running already, e.g. because the boot loader has
+	 * used USB. Start from the state google_usb3_phy_exit() leaves it in.
+	 */
+	ret = reset_control_bulk_assert(inst->num_rsts, inst->rsts);
+	if (ret)
+		return ret;
+	set_pmgt_ref_clk_req_n(gphy, false);
+	usleep_range(1000, 2000);
+
+	/*
+	 * Request the transition to 'no connection' the TCA does by itself
+	 * after a power-on reset, and clear the events of what happened
+	 * before: google_usb3_phy_power_on() waits for it to complete.
+	 */
+	reg = readl(gphy->usb3_tca_base + TCA_INTR_STS_OFFSET);
+	writel(reg, gphy->usb3_tca_base + TCA_INTR_STS_OFFSET);
+	writel(TCA_TCPC_VALID, gphy->usb3_tca_base + TCA_TCPC_OFFSET);
+
 	reg = readl(gphy->usb3_tca_base + TCA_CTRLSYNCMODE_CFG1_OFFSET);
 	reg &= ~TCA_CTRLSYNCMODE_CFG1_XA_TIMEOUT_VAL;
 	reg |= FIELD_PREP(TCA_CTRLSYNCMODE_CFG1_XA_TIMEOUT_VAL,

---
base-commit: 749a4de370409464cf8501ec5b2451df45c84eb4
change-id: 20261119-lga-usbphy-init-a624836eff26

Best regards,
-- 
André Draszik <andre.draszik at linaro.org>




More information about the linux-phy mailing list