* [PATCH] clk: ultrarisc: Register DP1000 clock provider earlier
@ 2026-08-20 2:50 Jia Wang
2026-08-24 16:37 ` Brian Masney
0 siblings, 1 reply; 2+ messages in thread
From: Jia Wang @ 2026-08-20 2:50 UTC (permalink / raw)
To: Stephen Boyd, Brian Masney, Jerome Brunet
Cc: Brian Masney, linux-clk, linux-kernel, Jia Wang
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.
Register the clock provider with subsys_initcall() when built in so PCIe
host probing completes before sysfb_init(). Keep module builds using the
normal module init and exit paths.
Fixes: 3948a36be42b ("clk: ultrarisc: Add DP1000 clock driver")
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
Register the built-in DP1000 clock provider earlier so the PCIe host can
complete resource allocation before sysfb claims the firmware framebuffer
aperture.
This patch is based on the clk-next branch.
Validated on a DP1000 system with a PCIe GPU across repeated cold boots.
---
drivers/clk/ultrarisc/clk-dp1000.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/ultrarisc/clk-dp1000.c b/drivers/clk/ultrarisc/clk-dp1000.c
index ffea77c4cca0..8073e179c67a 100644
--- a/drivers/clk/ultrarisc/clk-dp1000.c
+++ b/drivers/clk/ultrarisc/clk-dp1000.c
@@ -3,6 +3,7 @@
* Copyright (C) 2026 UltraRISC Technology (Shanghai) Co., Ltd.
*/
+#include <linux/init.h>
#include <linux/module.h>
#include <dt-bindings/clock/ultrarisc,dp1000-clk.h>
@@ -147,7 +148,23 @@ 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.
+ */
+static int __init dp1000_clk_init(void)
+{
+ return platform_driver_register(&dp1000_clk_driver);
+}
+subsys_initcall(dp1000_clk_init);
+
+static void __exit dp1000_clk_exit(void)
+{
+ platform_driver_unregister(&dp1000_clk_driver);
+}
+module_exit(dp1000_clk_exit);
MODULE_IMPORT_NS("CLK_ULTRARISC");
MODULE_DESCRIPTION("UltraRISC DP1000 clock controller");
---
base-commit: ef96a64997e62fc5cc91fb3bc7a3fc1046fef259
change-id: 20260820-ultrarisc-clock-fix-ae7a375294a7
Best regards,
--
Jia Wang <wangjia@ultrarisc.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: ultrarisc: Register DP1000 clock provider earlier
2026-08-20 2:50 [PATCH] clk: ultrarisc: Register DP1000 clock provider earlier Jia Wang
@ 2026-08-24 16:37 ` Brian Masney
0 siblings, 0 replies; 2+ messages in thread
From: Brian Masney @ 2026-08-24 16:37 UTC (permalink / raw)
To: Jia Wang
Cc: Stephen Boyd, Brian Masney, Jerome Brunet, linux-clk, linux-kernel
On Thu, Aug 20, 2026 at 10:50:47AM +0800, Jia Wang wrote:
> 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.
>
> Register the clock provider with subsys_initcall() when built in so PCIe
> host probing completes before sysfb_init(). Keep module builds using the
> normal module init and exit paths.
>
> Fixes: 3948a36be42b ("clk: ultrarisc: Add DP1000 clock driver")
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
I see this same pattern is also used by lots of qcom gcc drivers, 4
Renesas drivers, and a few other drivers.
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-24 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-20 2:50 [PATCH] clk: ultrarisc: Register DP1000 clock provider earlier Jia Wang
2026-08-24 16:37 ` 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®