All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates
@ 2026-03-05  8:06 Shawn Lin
  2026-03-06 10:52   ` Heiko Stuebner
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Lin @ 2026-03-05  8:06 UTC (permalink / raw)
  To: Stephen Boyd, heiko; +Cc: linux-rockchip, linux-clk, Shawn Lin

The PCIe pipe clocks are currently left as orphan clocks and remain
enabled indefinitely, which is suboptimal. Add the missing clock gates
so the PCIe driver can explicitly manage them when not in use.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---
Hi Heiko,

This patch should be considered only after David's patch[1] is merged,
otherwise it breaks PCIe on RK3566/RK3568 due to clk_disable_unused().

[1] https://lore.kernel.org/linux-rockchip/d981fa84-bd05-ac9d-98ca-89ee47177829@rock-chips.com/T/#ma251be8ca9642eb3f2ffbe6494c905c805418b34

 drivers/clk/rockchip/clk-rk3568.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/rockchip/clk-rk3568.c b/drivers/clk/rockchip/clk-rk3568.c
index 74eabf9..9556ddf 100644
--- a/drivers/clk/rockchip/clk-rk3568.c
+++ b/drivers/clk/rockchip/clk-rk3568.c
@@ -827,6 +827,8 @@ static struct rockchip_clk_branch rk3568_clk_branches[] __initdata = {
 			RK3568_CLKGATE_CON(12), 3, GFLAGS),
 	GATE(CLK_PCIE20_AUX_NDFT, "clk_pcie20_aux_ndft", "xin24m", 0,
 			RK3568_CLKGATE_CON(12), 4, GFLAGS),
+	GATE(CLK_PCIE20_PIPE_DFT, "clk_pcie20_pipe_dft", "aclk_pipe", 0,
+			RK3568_CLKGATE_CON(12), 5, GFLAGS),
 	GATE(ACLK_PCIE30X1_MST, "aclk_pcie30x1_mst", "aclk_pipe", 0,
 			RK3568_CLKGATE_CON(12), 8, GFLAGS),
 	GATE(ACLK_PCIE30X1_SLV, "aclk_pcie30x1_slv", "aclk_pipe", 0,
@@ -837,6 +839,8 @@ static struct rockchip_clk_branch rk3568_clk_branches[] __initdata = {
 			RK3568_CLKGATE_CON(12), 11, GFLAGS),
 	GATE(CLK_PCIE30X1_AUX_NDFT, "clk_pcie30x1_aux_ndft", "xin24m", 0,
 			RK3568_CLKGATE_CON(12), 12, GFLAGS),
+	GATE(CLK_PCIE30X1_PIPE_DFT, "clk_pcie30x1_pipe_dft", "aclk_pipe", 0,
+			RK3568_CLKGATE_CON(12), 13, GFLAGS),
 	GATE(ACLK_PCIE30X2_MST, "aclk_pcie30x2_mst", "aclk_pipe", 0,
 			RK3568_CLKGATE_CON(13), 0, GFLAGS),
 	GATE(ACLK_PCIE30X2_SLV, "aclk_pcie30x2_slv", "aclk_pipe", 0,
@@ -847,6 +851,8 @@ static struct rockchip_clk_branch rk3568_clk_branches[] __initdata = {
 			RK3568_CLKGATE_CON(13), 3, GFLAGS),
 	GATE(CLK_PCIE30X2_AUX_NDFT, "clk_pcie30x2_aux_ndft", "xin24m", 0,
 			RK3568_CLKGATE_CON(13), 4, GFLAGS),
+	GATE(CLK_PCIE30X2_PIPE_DFT, "clk_pcie30x2_pipe_dft", "aclk_pipe", 0,
+			RK3568_CLKGATE_CON(13), 5, GFLAGS),
 	GATE(ACLK_SATA0, "aclk_sata0", "aclk_pipe", 0,
 			RK3568_CLKGATE_CON(11), 0, GFLAGS),
 	GATE(CLK_SATA0_PMALIVE, "clk_sata0_pmalive", "gpll_20m", 0,
-- 
2.7.4


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link()
@ 2026-05-28 12:15 Alexander Shiyan
  2026-05-28 12:15 ` [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates Alexander Shiyan
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Shiyan @ 2026-05-28 12:15 UTC (permalink / raw)
  To: barebox; +Cc: Miaoqian Lin, Heiko Stuebner, Alexander Shiyan

From: Miaoqian Lin <linmq006@gmail.com>

Replace NULL check with IS_ERR_OR_NULL() check after calling
rockchip_clk_register_gate_link() since this function
returns error pointers (ERR_PTR).

Fixes: c62fa612cfa6 ("clk: rockchip: implement linked gate clock support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://patch.msgid.link/20250805030358.3665878-1-linmq006@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 drivers/clk/rockchip/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index 987c3bc518..d01574c60b 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -566,7 +566,7 @@ void rockchip_clk_register_late_branches(struct device *dev,
 			break;
 		}
 
-		if (!pdev)
+		if (IS_ERR_OR_NULL(pdev))
 			dev_err(dev, "failed to register device for clock %s\n", list->name);
 	}
 }
-- 
2.52.0




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

end of thread, other threads:[~2026-05-29 11:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05  8:06 [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates Shawn Lin
2026-03-06 10:52 ` Heiko Stuebner
2026-03-06 10:52   ` Heiko Stuebner
2026-03-06 12:05   ` Shawn Lin
2026-03-06 12:05     ` Shawn Lin
  -- strict thread matches above, loose matches on Subject: below --
2026-05-28 12:15 [PATCH] clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link() Alexander Shiyan
2026-05-28 12:15 ` [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates Alexander Shiyan
2026-05-29 11:43   ` Sascha Hauer
2026-05-29 11:43   ` Sascha Hauer

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.