All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Abhishek Kumar <abhishek.kumar15@oss.qualcomm.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, krishna.chundru@oss.qualcomm.com
Subject: Re: [PATCH] PCI/pwrctrl: tc9563: Enable 8 GT/s equalization fine-tuning
Date: Fri, 20 Nov 2026 10:55:49 -0600	[thread overview]
Message-ID: <20261120165549.GA888766@bhelgaas> (raw)
In-Reply-To: <20261119-tc9563_fine_tune-v1-1-b83c74bf1e94@oss.qualcomm.com>

On Thu, Nov 19, 2026 at 04:57:12PM +0530, Abhishek Kumar wrote:
> 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>

Applied to pci/pwrctrl for v7.5, thank you!

I added "Toshiba TC9563" to the commit log because this applies to
only this device, not PCIe switches in general.

> ---
>  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>
> 

      parent reply	other threads:[~2026-11-20 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2026-11-19 13:12 ` Bartosz Golaszewski
2026-11-20 16:55 ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120165549.GA888766@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=abhishek.kumar15@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=brgl@kernel.org \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mani@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.