Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: shawn.lin@rock-chips.com, Manivannan Sadhasivam <mani@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Vinod Koul <vkoul@kernel.org>,
	linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-phy@lists.infradead.org, Heiko Stuebner <heiko@sntech.de>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: Re: [PATCH 0/5] Add calibration for Synopsys PCIe PHY and Controller
Date: Thu, 15 Jan 2026 08:41:14 +0800	[thread overview]
Message-ID: <354e3edb-ac42-4610-89ec-227fe07d4cf6@rock-chips.com> (raw)
In-Reply-To: <aWe5s5mqFt26lRGL@ryzen>


在 2026/01/14 星期三 23:43, Niklas Cassel 写道:
> On Wed, Dec 24, 2025 at 03:10:05PM +0800, Shawn Lin wrote:
>>
>> Currently, when pcie-dw-rockchip uses the Synopsys PHY, it relies on
>> the phy_init() callback of the phy-rockchip-snps-pcie3 driver to
>> perform calibration. This is incorrect because the controller is
>> still held in reset at that time, preventing the PHY from accurately
>> reflecting the actual PLL lock and calibration status.
> 
> Hello Shawn,
> 
> I can see that you move the calibration code from .phy_init() to
> .phy_calibrate().
> 
> And I understandthat the controller is still held in reset.
> 
> I understand that the the PHY calibration is supposed to be done
> when the controller is not held in reset, and that alone is
> enough to warrant a fix.

Sure.

> 
> The Synopsys Gen3 PHY is used in e.g. Rock5b, and link training
> currently works fine with this PHY, so what is the actual

It just happended to work as in most cases, the calibration finished
very quickly after controller is not held in reset.

> implications of performing the PHY calibration when the controller
> is held in reset?
> 
> Will it somehow it improve signal integrity?
> 

Performing the PHY calibration when the controller is held
in reset is the wrong way. If the refclk or PHY power supply isn't
ready, the bogus calibration still passes, then the system will get
stuck when accessing DBI. So performing the PHY calibration must be done
after controller quit the reset state.

> 
> Kind regards,
> Niklas
> 
>>
>> To fix this, this series:
>> 1. Calls phy_calibrate() in the pcie-dw-rockchip driver (if supported)
>>     after the controller is out of reset, ensuring the PHY can
>>     properly synchronize with the controller state.
>> 2. Adds the necessary calibration support in the Synopsys PHY driver
>>     to implement this callback.
> 


      reply	other threads:[~2026-01-15  1:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-24  7:10 [PATCH 0/5] Add calibration for Synopsys PCIe PHY and Controller Shawn Lin
2025-12-24  7:10 ` [PATCH 1/5] PCI: dw-rockchip: Add phy_calibrate() to check PHY lock status Shawn Lin
2026-01-13 14:34   ` Manivannan Sadhasivam
2025-12-24  7:10 ` [PATCH 2/5] phy: rockchip-snps-pcie3: Add phy_calibrate() support Shawn Lin
2025-12-24  7:10 ` [PATCH 3/5] phy: rockchip-snps-pcie3: Increase sram init timeout Shawn Lin
2026-01-14 13:29   ` Vinod Koul
2026-01-15  0:30     ` Shawn Lin
2025-12-24  7:10 ` [PATCH 4/5] phy: rockchip-snps-pcie3: Check more sram init status for RK3588 Shawn Lin
2025-12-24  7:10 ` [PATCH 5/5] phy: rockchip-snps-pcie3: Only check PHY1 status when using it Shawn Lin
2026-01-14 15:43 ` [PATCH 0/5] Add calibration for Synopsys PCIe PHY and Controller Niklas Cassel
2026-01-15  0:41   ` Shawn Lin [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=354e3edb-ac42-4610-89ec-227fe07d4cf6@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=vkoul@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox