Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI/pwrctrl: tc9563: Enable 8 GT/s equalization fine-tuning
@ 2026-11-19 11:27 Abhishek Kumar
  2026-11-19 11:32 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Abhishek Kumar @ 2026-11-19 11:27 UTC (permalink / raw)
  To: Bartosz Golaszewski, Manivannan Sadhasivam, Bjorn Helgaas
  Cc: linux-pci, krishna.chundru, Abhishek Kumar

On some boots, links on the PCIe switch report a continuous flood of
correctable AER errors (RxErr, BadTLP and Replay Timer Timeout) at
8 GT/s. This happens because the 8 GT/s equalization fine-tuning
setting is never programmed: max_num_of_fine_tuning_iterations_at_8gt
in K_EQUTUNING_033_028 resets to 0, so equalization only selects a
preset and never fine-tunes the transmitter coefficients for the
channel, leaving the link with marginal signal quality.

Fix this by programming one fine-tuning iteration on the upstream port
and downstream ports 1 and 2 at power-on, so that 8 GT/s equalization
adapts the transmitter coefficients to the channel. With this setting
the links no longer report any AER errors.

Signed-off-by: Abhishek Kumar <abhishek.kumar15@oss.qualcomm.com>
---
 drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
index 4091a2f30aa7..d27b009430f1 100644
--- a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
+++ b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
@@ -29,6 +29,9 @@
 #define TC9563_PORT_L0S_DELAY		0x82496c
 #define TC9563_PORT_L1_DELAY		0x824970
 
+#define TC9563_K_EQUTUNING_033_028	0x824a10
+#define TC9563_EQ_FINE_TUNING_ITER	1
+
 #define TC9563_EMBEDDED_ETH_DELAY	0x8200d8
 #define TC9563_ETH_L1_DELAY_MASK	GENMASK(27, 18)
 #define TC9563_ETH_L1_DELAY_VALUE(x)	FIELD_PREP(TC9563_ETH_L1_DELAY_MASK, x)
@@ -346,6 +349,20 @@ static int tc9563_pwrctrl_set_nfts(struct tc9563_pwrctrl *tc9563,
 				      ARRAY_SIZE(nfts_seq));
 }
 
+static int tc9563_pwrctrl_set_eq_fine_tuning(struct tc9563_pwrctrl *tc9563)
+{
+	int ret;
+
+	ret = regmap_write(tc9563->regmap, TC9563_PORT_SELECT,
+			   BIT(TC9563_USP) | BIT(TC9563_DSP1) |
+			   BIT(TC9563_DSP2));
+	if (ret)
+		return ret;
+
+	return regmap_write(tc9563->regmap, TC9563_K_EQUTUNING_033_028,
+			    TC9563_EQ_FINE_TUNING_ITER);
+}
+
 static int tc9563_pwrctrl_assert_deassert_reset(struct tc9563_pwrctrl *tc9563,
 						bool deassert)
 {
@@ -557,6 +574,12 @@ static int tc9563_pwrctrl_power_on(struct pci_pwrctrl *pwrctrl)
 	if (ret)
 		goto power_off;
 
+	ret = tc9563_pwrctrl_set_eq_fine_tuning(tc9563);
+	if (ret) {
+		dev_err(dev, "Failed to enable 8 GT/s EQ fine-tuning\n");
+		goto power_off;
+	}
+
 	for (i = 0; i < TC9563_MAX; i++) {
 		cfg = &tc9563->cfg[i];
 		ret = tc9563_pwrctrl_disable_port(tc9563, i);

---
base-commit: e8017d29067fd1310a65c3494ce1a1b492adbac6
change-id: 20261119-tc9563_fine_tune-1fee86f2e4a3

Best regards,
--  
Abhishek Kumar <abhishek.kumar15@oss.qualcomm.com>


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

end of thread, other threads:[~2026-11-19 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 11:27 [PATCH] PCI/pwrctrl: tc9563: Enable 8 GT/s equalization fine-tuning Abhishek Kumar
2026-11-19 11:32 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox