mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI: rockchip-host: Enable async probe by default
@ 2026-11-03  6:07 Igor Velkov via B4 Relay
  2026-11-07 17:06 ` Manivannan Sadhasivam
  2026-11-09 20:22 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-11-03  6:07 UTC (permalink / raw)
  To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Heiko Stuebner
  Cc: Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel, Igor Velkov

From: Igor Velkov <iav@iav.lv>

The probe waits for the link to come up, and with an empty slot it
holds the deferred-probe worker for about 0.7 s. On ROCK Pi 4 with
UHS-I enabled for the SD card, the I/O-domain driver then binds only
after the card has switched to 1.8 V, and tuning fails ("All phases
bad!").

Probe asynchronously, as commit c0e1eb441b1d ("PCI: qcom: Enable async
probe by default") does for the Qualcomm host driver. This does not
order the I/O domain before dw_mmc in general; an explicit dependency
was proposed in [1] and not merged.

Link: https://lore.kernel.org/all/20230904115816.1237684-1-s.hauer@pengutronix.de/ [1]
Signed-off-by: Igor Velkov <iav@iav.lv>
---
Tested on v7.3.1 with the Armbian rockchip64 config (PCIE_ROCKCHIP_HOST=y):
- ROCK Pi 4A, empty slot, UHS-I DT change posted separately: SDR104 on
  3 of 3 cold boots; without this patch tuning fails.
- Kobol Helios64, JMB585 in the slot: link, SATA and disk reads OK
  over 3 cold boots and a reboot.
---
 drivers/pci/controller/pcie-rockchip-host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c
index 5b071bdc4f90..1e1556e436b8 100644
--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -1027,6 +1027,7 @@ static struct platform_driver rockchip_pcie_driver = {
 		.name = "rockchip-pcie",
 		.of_match_table = rockchip_pcie_of_match,
 		.pm = &rockchip_pcie_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.probe = rockchip_pcie_probe,
 	.remove = rockchip_pcie_remove,

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-rockchip-pcie-async-42c1c3863617

Best regards,
-- 
Igor Velkov <iav@iav.lv>



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

* Re: [PATCH] PCI: rockchip-host: Enable async probe by default
  2026-11-03  6:07 [PATCH] PCI: rockchip-host: Enable async probe by default Igor Velkov via B4 Relay
@ 2026-11-07 17:06 ` Manivannan Sadhasivam
  2026-11-09 20:22 ` Bjorn Helgaas
  1 sibling, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-07 17:06 UTC (permalink / raw)
  To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Bjorn Helgaas, Heiko Stuebner, Igor Velkov
  Cc: Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel, linux-kernel


On Tue, 03 Nov 2026 06:07:35 +0000, Igor Velkov wrote:
> The probe waits for the link to come up, and with an empty slot it
> holds the deferred-probe worker for about 0.7 s. On ROCK Pi 4 with
> UHS-I enabled for the SD card, the I/O-domain driver then binds only
> after the card has switched to 1.8 V, and tuning fails ("All phases
> bad!").
> 
> Probe asynchronously, as commit c0e1eb441b1d ("PCI: qcom: Enable async
> probe by default") does for the Qualcomm host driver. This does not
> order the I/O domain before dw_mmc in general; an explicit dependency
> was proposed in [1] and not merged.
> 
> [...]

Applied, thanks!

[1/1] PCI: rockchip-host: Enable async probe by default
      commit: abc53e14b57aa29fb0ec822a2a9eb5b279cd05b0

Best regards,
-- 
மணிவண்ணன் சதாசிவம்



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

* Re: [PATCH] PCI: rockchip-host: Enable async probe by default
  2026-11-03  6:07 [PATCH] PCI: rockchip-host: Enable async probe by default Igor Velkov via B4 Relay
  2026-11-07 17:06 ` Manivannan Sadhasivam
@ 2026-11-09 20:22 ` Bjorn Helgaas
  2026-11-09 20:47   ` Igor Velkov
  1 sibling, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2026-11-09 20:22 UTC (permalink / raw)
  To: Igor Velkov
  Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Heiko Stuebner,
	Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel

On Tue, Nov 03, 2026 at 06:07:35AM +0000, Igor Velkov wrote:
> The probe waits for the link to come up, and with an empty slot it
> holds the deferred-probe worker for about 0.7 s. On ROCK Pi 4 with
> UHS-I enabled for the SD card, the I/O-domain driver then binds only
> after the card has switched to 1.8 V, and tuning fails ("All phases
> bad!").

I don't know what the SD card has to do with PCIe.  Seems like there's
some SD issue, and making PCIe async happens to avoid it?  Sounds
fragile to me.

Other changes like c0e1eb441b1d justify it by allowing other drivers
to load in parallel to reduce boot time, which is a good reason.  But
apparently here it makes a functional difference as well, which feels
sketchy.  E.g., what other drivers need to use async probe to avoid
similar issues?

> Probe asynchronously, as commit c0e1eb441b1d ("PCI: qcom: Enable async
> probe by default") does for the Qualcomm host driver. This does not
> order the I/O domain before dw_mmc in general; an explicit dependency
> was proposed in [1] and not merged.
> 
> Link: https://lore.kernel.org/all/20230904115816.1237684-1-s.hauer@pengutronix.de/ [1]
> Signed-off-by: Igor Velkov <iav@iav.lv>
> ---
> Tested on v7.3.1 with the Armbian rockchip64 config (PCIE_ROCKCHIP_HOST=y):
> - ROCK Pi 4A, empty slot, UHS-I DT change posted separately: SDR104 on
>   3 of 3 cold boots; without this patch tuning fails.
> - Kobol Helios64, JMB585 in the slot: link, SATA and disk reads OK
>   over 3 cold boots and a reboot.
> ---
>  drivers/pci/controller/pcie-rockchip-host.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c
> index 5b071bdc4f90..1e1556e436b8 100644
> --- a/drivers/pci/controller/pcie-rockchip-host.c
> +++ b/drivers/pci/controller/pcie-rockchip-host.c
> @@ -1027,6 +1027,7 @@ static struct platform_driver rockchip_pcie_driver = {
>  		.name = "rockchip-pcie",
>  		.of_match_table = rockchip_pcie_of_match,
>  		.pm = &rockchip_pcie_pm_ops,
> +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
>  	},
>  	.probe = rockchip_pcie_probe,
>  	.remove = rockchip_pcie_remove,
> 
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20261103-rockchip-pcie-async-42c1c3863617
> 
> Best regards,
> -- 
> Igor Velkov <iav@iav.lv>
> 

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

* Re: [PATCH] PCI: rockchip-host: Enable async probe by default
  2026-11-09 20:22 ` Bjorn Helgaas
@ 2026-11-09 20:47   ` Igor Velkov
  2026-11-09 20:59     ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Igor Velkov @ 2026-11-09 20:47 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Heiko Stuebner,
	Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel, Igor Velkov

On Mon, Nov 09, 2026 at 02:22:02PM -0600, Bjorn Helgaas wrote:
> I don't know what the SD card has to do with PCIe.  Seems like there's
> some SD issue, and making PCIe async happens to avoid it?  Sounds
> fragile to me.
>
> Other changes like c0e1eb441b1d justify it by allowing other drivers
> to load in parallel to reduce boot time, which is a good reason.  But
> apparently here it makes a functional difference as well, which feels
> sketchy.  E.g., what other drivers need to use async probe to avoid
> similar issues?

You're right that the real problem is ordering: nothing makes dw_mmc wait
for the RK3399 io-domain driver, which sets the 1.8 V level of the SD
pins. [1] tried to add that dependency and was not merged. Async probe
only stops this driver from holding the deferred-probe worker for ~0.7 s;
any other slow probe in that window breaks UHS the same way.

Is there a way to express this dependency that you would accept?

[1] https://lore.kernel.org/all/20230904115816.1237684-1-s.hauer@pengutronix.de/

--
Igor Velkov

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

* Re: [PATCH] PCI: rockchip-host: Enable async probe by default
  2026-11-09 20:47   ` Igor Velkov
@ 2026-11-09 20:59     ` Bjorn Helgaas
  2026-11-09 21:07       ` Igor Velkov
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2026-11-09 20:59 UTC (permalink / raw)
  To: Igor Velkov
  Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Heiko Stuebner,
	Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel

On Mon, Nov 09, 2026 at 10:47:39PM +0200, Igor Velkov wrote:
> On Mon, Nov 09, 2026 at 02:22:02PM -0600, Bjorn Helgaas wrote:
> > I don't know what the SD card has to do with PCIe.  Seems like there's
> > some SD issue, and making PCIe async happens to avoid it?  Sounds
> > fragile to me.
> >
> > Other changes like c0e1eb441b1d justify it by allowing other drivers
> > to load in parallel to reduce boot time, which is a good reason.  But
> > apparently here it makes a functional difference as well, which feels
> > sketchy.  E.g., what other drivers need to use async probe to avoid
> > similar issues?
> 
> You're right that the real problem is ordering: nothing makes dw_mmc wait
> for the RK3399 io-domain driver, which sets the 1.8 V level of the SD
> pins. [1] tried to add that dependency and was not merged. Async probe
> only stops this driver from holding the deferred-probe worker for ~0.7 s;
> any other slow probe in that window breaks UHS the same way.
> 
> Is there a way to express this dependency that you would accept?
> 
> [1] https://lore.kernel.org/all/20230904115816.1237684-1-s.hauer@pengutronix.de/

Mani's already applied it, so I think it's fine.  I'm just trying to
understand the commit message and figure out what the merge commit log
and the eventual pull request should say.  It sounds like "this makes
SD cards work better" is somehow part of it, but it just feels kind of
hand-wavey.

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

* Re: [PATCH] PCI: rockchip-host: Enable async probe by default
  2026-11-09 20:59     ` Bjorn Helgaas
@ 2026-11-09 21:07       ` Igor Velkov
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Velkov @ 2026-11-09 21:07 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Heiko Stuebner,
	Rob Herring, linux-pci, linux-rockchip, linux-arm-kernel,
	linux-kernel, Igor Velkov

On Mon, Nov 09, 2026 at 02:59:11PM -0600, Bjorn Helgaas wrote:
> Mani's already applied it, so I think it's fine.  I'm just trying to
> understand the commit message and figure out what the merge commit log
> and the eventual pull request should say.  It sounds like "this makes
> SD cards work better" is somehow part of it, but it just feels kind of
> hand-wavey.

For the merge log, maybe: "Probe rockchip-host asynchronously so link
training on an empty slot doesn't stall other drivers' probes for
~0.7 s". The SD card is just where we noticed the stall.

--
Igor Velkov

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

end of thread, other threads:[~2026-11-09 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  6:07 [PATCH] PCI: rockchip-host: Enable async probe by default Igor Velkov via B4 Relay
2026-11-07 17:06 ` Manivannan Sadhasivam
2026-11-09 20:22 ` Bjorn Helgaas
2026-11-09 20:47   ` Igor Velkov
2026-11-09 20:59     ` Bjorn Helgaas
2026-11-09 21:07       ` Igor Velkov

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

all inboxes | Powered by JetHome®