Skip to contentSkip to conversation

Disable periodic tracking on Tegra234

PATCH Applied Wayne Chang 3 participants 6 messages May 19, 2025 – Jun 15, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Disable periodic tracking on Tegra234

Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode and disable periodic tracking on Tegra234

Haotien Hsu (1):
phy: tegra: xusb: Disable periodic tracking on Tegra234

Wayne Chang (1):
phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from
trk_hw_mode

 drivers/phy/tegra/xusb-tegra186.c | 16 +++++++++-------
 drivers/phy/tegra/xusb.h          |  1 +
 2 files changed, 10 insertions(+), 7 deletions(-)

base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21

Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

The logic that drives the pad calibration values resides in the controller reset domain and so the calibration values are only being captured when the controller is out of reset. However, by clearing the CYA_TRK_CODE_UPDATE_ON_IDLE bit, the calibration values can be set while the controller is in reset.

The CYA_TRK_CODE_UPDATE_ON_IDLE bit was previously cleared based on the trk_hw_mode flag, but this dependency is not necessary. Instead, introduce a new flag, trk_update_on_idle, to independently control this bit.

Fixes d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")

---
V1->V2: Rebased the commit

 drivers/phy/tegra/xusb-tegra186.c | 14 ++++++++------
 drivers/phy/tegra/xusb.h          |  1 +
 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/phy/tegra/xusb-tegra186.c +8 -6
index 23a23f2d64e5..683692f0ec3c 100644
@@ -648,14 +648,15 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
 		udelay(100);
 	}
 
-	if (padctl->soc->trk_hw_mode) {
-		value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
-		value |= USB2_TRK_HW_MODE;
+	value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+	if (padctl->soc->trk_update_on_idle)
 		value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE;
-		padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
-	} else {
+	if (padctl->soc->trk_hw_mode)
+		value |= USB2_TRK_HW_MODE;
+	padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2);
+
+	if (!padctl->soc->trk_hw_mode)
 		clk_disable_unprepare(priv->usb2_trk_clk);
-	}
 }
 
 static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl)
@@ -1711,6 +1712,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
 	.supports_gen2 = true,
 	.poll_trk_completed = true,
 	.trk_hw_mode = true,
+	.trk_update_on_idle = true,
 	.supports_lp_cfg_en = true,
 };
 EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc);
drivers/phy/tegra/xusb.h +1 -0
index 6e45d194c689..d2b5f9565132 100644
@@ -434,6 +434,7 @@ struct tegra_xusb_padctl_soc {
 	bool need_fake_usb3_port;
 	bool poll_trk_completed;
 	bool trk_hw_mode;
+	bool trk_update_on_idle;
 	bool supports_lp_cfg_en;
 };
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/2 phy: tegra: xusb: Disable periodic tracking on Tegra234

In reply to Wayne Chang

From: Haotien Hsu <[email protected]>

Periodic calibration updates (~10µs) may overlap with transfers when PCIe NVMe SSD, LPDDR, and USB2 devices operate simultaneously, causing crosstalk on Tegra234 devices. Hence disable periodic calibration updates and make this a one-time calibration.

Fixes d8163a32ca95 ("phy: tegra: xusb: Add Tegra234 support")

---
V1->V2: Rebased the commit

 drivers/phy/tegra/xusb-tegra186.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/tegra/xusb-tegra186.c +1 -1
index 683692f0ec3c..ba668c77457f 100644
@@ -1711,7 +1711,7 @@ const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = {
 	.num_supplies = ARRAY_SIZE(tegra194_xusb_padctl_supply_names),
 	.supports_gen2 = true,
 	.poll_trk_completed = true,
-	.trk_hw_mode = true,
+	.trk_hw_mode = false,
 	.trk_update_on_idle = true,
 	.supports_lp_cfg_en = true,
 };
Signature · 1 line
2.25.1
maintainer Reviewed-by Tested-by on the v2 series
#3 lore raw
In reply to Wayne Chang
Quoted 6 lines · Wayne Chang

Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode and disable periodic tracking on Tegra234

Haotien Hsu (1):
phy: tegra: xusb: Disable periodic tracking on Tegra234

Quoted 7 lines

Wayne Chang (1):
phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from
trk_hw_mode

  drivers/phy/tegra/xusb-tegra186.c | 16 +++++++++-------
  drivers/phy/tegra/xusb.h          |  1 +
  2 files changed, 10 insertions(+), 7 deletions(-)

For the series ...

Thanks!
Jon

Signature · 1 line
nvpublic
maintainer
#4 lore raw

Hi Vinod,

Quoted 17 lines · Jon Hunter
Quoted 6 lines · Wayne Chang

Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode and disable periodic tracking on Tegra234

Haotien Hsu (1):
   phy: tegra: xusb: Disable periodic tracking on Tegra234

Quoted 7 lines

Wayne Chang (1):
   phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

  drivers/phy/tegra/xusb-tegra186.c | 16 +++++++++------- drivers/phy/tegra/xusb.h          |  1 +

  2 files changed, 10 insertions(+), 7 deletions(-)
Quoted 4 lines

For the series ...

Can we get this into -next now?

Thanks!
Jon

Signature · 1 line
nvpublic
maintainer Applied
#5 lore raw
In reply to Wayne Chang
Quoted 11 lines · Wayne Chang

Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode and disable periodic tracking on Tegra234

Haotien Hsu (1):
phy: tegra: xusb: Disable periodic tracking on Tegra234

Wayne Chang (1):
phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from
trk_hw_mode

[...]

Applied, thanks!

[1/2] phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode

      commit: 24c63c590adca310e0df95c77cf7aa5552bc3fc5
[2/2] phy: tegra: xusb: Disable periodic tracking on Tegra234
      commit: 7be54870e9bf5ed0b4fe2a23b41a630527882de5

Best regards,

Signature · 1 line
~Vinod