mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] clk: ultrarisc: Register DP1000 clock provider earlier
@ 2026-10-14  3:20 Xincheng Ji
  2026-10-19 22:01 ` Brian Masney
  0 siblings, 1 reply; 2+ messages in thread
From: Xincheng Ji @ 2026-10-14  3:20 UTC (permalink / raw)
  To: Stephen Boyd, Brian Masney, Jerome Brunet
  Cc: Brian Masney, Bjorn Andersson, linux-clk, linux-kernel, Jia Wang,
	Xincheng Ji

From: Jia Wang <wangjia@ultrarisc.com>

The DP1000 PCIe and clock drivers both register at the device initcall
level. Since the PCIe driver is linked first, its probe runs before the
clock provider is available and defers.

sysfb_init() runs at the same initcall level before deferred probes are
retried. It claims the firmware framebuffer aperture, so the later PCIe
host probe cannot allocate the overlapping prefetchable window and the
GPU is not enumerated.

Use subsys_platform_driver() to register the clock provider at the
subsys_initcall level when built in so PCIe host probing completes before
sysfb_init(). The helper keeps the normal module init and exit paths when
the driver is built as a module.

Fixes: 3948a36be42b ("clk: ultrarisc: Add DP1000 clock driver")
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Signed-off-by: Xincheng Ji <jixincheng@ultrarisc.com>
---
This v2 uses subsys_platform_driver() from Brian Masney's helper series:
https://lore.kernel.org/linux-clk/20260908-subsys_initcall-v1-0-cbccf4cd4288@redhat.com/

The series has been applied to the qcom tree's for-next branch. This patch
is based on commit f5672a3dff0291d6a45eb0c258b9d2baeb4dc577 in that branch,
which already includes the required helpers.

The v1 implementation was validated on a DP1000 system with a PCIe GPU
across repeated cold boots. For v2, the UltraRISC clock driver objects
were cross-compiled for RISC-V with W=1 in both built-in and module
configurations. Hardware runtime testing has not been repeated for v2.
---
Changes in v2:
- Use subsys_platform_driver() instead of open-coded init and exit functions.
- Rebase onto qcom for-next, which contains the new helper.
- Link to v1: https://patch.msgid.link/20260820-ultrarisc-clock-fix-v1-1-f27c6a980b42@ultrarisc.com

To: Jia Wang <wangjia@ultrarisc.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney+clk@redhat.com>
To: Jerome Brunet <jbrunet+clk@baylibre.com>
Cc: Brian Masney <bmasney@redhat.com>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/clk/ultrarisc/clk-dp1000.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/ultrarisc/clk-dp1000.c b/drivers/clk/ultrarisc/clk-dp1000.c
index ffea77c4cca0..d7db55f7a31f 100644
--- a/drivers/clk/ultrarisc/clk-dp1000.c
+++ b/drivers/clk/ultrarisc/clk-dp1000.c
@@ -147,7 +147,13 @@ static struct platform_driver dp1000_clk_driver = {
 		.of_match_table = dp1000_clk_of_match,
 	},
 };
-module_platform_driver(dp1000_clk_driver);
+
+/*
+ * PCI host drivers are registered before sysfb_init() through link order.
+ * Register the clock provider earlier so the host controllers do not defer
+ * probing until after sysfb has claimed the firmware framebuffer aperture.
+ */
+subsys_platform_driver(dp1000_clk_driver);
 
 MODULE_IMPORT_NS("CLK_ULTRARISC");
 MODULE_DESCRIPTION("UltraRISC DP1000 clock controller");

---
base-commit: f5672a3dff0291d6a45eb0c258b9d2baeb4dc577
change-id: 20260820-ultrarisc-clock-fix-ae7a375294a7

Best regards,
--  
Xincheng Ji <jixincheng@ultrarisc.com>


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

* Re: [PATCH v2] clk: ultrarisc: Register DP1000 clock provider earlier
  2026-10-14  3:20 [PATCH v2] clk: ultrarisc: Register DP1000 clock provider earlier Xincheng Ji
@ 2026-10-19 22:01 ` Brian Masney
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2026-10-19 22:01 UTC (permalink / raw)
  To: Xincheng Ji
  Cc: Stephen Boyd, Brian Masney, Jerome Brunet, Bjorn Andersson,
	linux-clk, linux-kernel, Jia Wang

On Wed, Oct 14, 2026 at 11:20:12AM +0800, Xincheng Ji wrote:
> From: Jia Wang <wangjia@ultrarisc.com>
> 
> The DP1000 PCIe and clock drivers both register at the device initcall
> level. Since the PCIe driver is linked first, its probe runs before the
> clock provider is available and defers.
> 
> sysfb_init() runs at the same initcall level before deferred probes are
> retried. It claims the firmware framebuffer aperture, so the later PCIe
> host probe cannot allocate the overlapping prefetchable window and the
> GPU is not enumerated.
> 
> Use subsys_platform_driver() to register the clock provider at the
> subsys_initcall level when built in so PCIe host probing completes before
> sysfb_init(). The helper keeps the normal module init and exit paths when
> the driver is built as a module.
> 
> Fixes: 3948a36be42b ("clk: ultrarisc: Add DP1000 clock driver")
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
> Signed-off-by: Xincheng Ji <jixincheng@ultrarisc.com>

Reviewed-by: Brian Masney <bmasney@redhat.com>

So we are going to hold off on sending this in for v7.4, and I'll merge 
this into clk-next once rc1 comes out in a few weeks. My series for
subsys_platform_driver() was merged through the qcom clk tree, which is
in the clk-qcom branch. With the way we do branching the clk tree won't
stay bisectable if I merge this through clk-pile.

This shouldn't cause any issues other than a slower boot. If it's
causing other issues, then that's a separate issue that also needs to be
fixed.

Brian


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

end of thread, other threads:[~2026-10-19 22:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14  3:20 [PATCH v2] clk: ultrarisc: Register DP1000 clock provider earlier Xincheng Ji
2026-10-19 22:01 ` Brian Masney

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®