public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates
       [not found] <1772698011-145625-1-git-send-email-shawn.lin@rock-chips.com>
@ 2026-03-06 10:52 ` Heiko Stuebner
  2026-03-06 12:05   ` Shawn Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Stuebner @ 2026-03-06 10:52 UTC (permalink / raw)
  To: Stephen Boyd, Shawn Lin; +Cc: linux-rockchip, linux-clk, Shawn Lin

Hi Shawn,

Am Donnerstag, 5. März 2026, 09:06:51 Mitteleuropäische Normalzeit schrieb 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().

This would also break compatiblity with old devicetrees.

The devicetree used by the kernel can also be embedded for example
in an already installed u-boot and handed to the kernel from there.
You cannot expect board devicetrees and the kernel image to be updated
in lockstep.

We also sort of guarantee this backwards compatiblity - old DTB with
newer kernel.

The solution is to add a CLK_IGNORE_UNUSED flag (but not CLK_IS_CRITICAL)
to the newly added gate.

This lets the clock stay and keeps the original behavious on old DTBs,
but also allows the PCIe driver in newer kernels to turn off the clock
if it wants to.

Thanks
Heiko




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

* Re: [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates
  2026-03-06 10:52 ` [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates Heiko Stuebner
@ 2026-03-06 12:05   ` Shawn Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Lin @ 2026-03-06 12:05 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: shawn.lin, linux-rockchip, linux-clk, Stephen Boyd

Hi Heiko,

在 2026/03/06 星期五 18:52, Heiko Stuebner 写道:
> Hi Shawn,
> 
> Am Donnerstag, 5. März 2026, 09:06:51 Mitteleuropäische Normalzeit schrieb 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().
> 
> This would also break compatiblity with old devicetrees.
> 
> The devicetree used by the kernel can also be embedded for example
> in an already installed u-boot and handed to the kernel from there.
> You cannot expect board devicetrees and the kernel image to be updated
> in lockstep.

Indeed.

> 
> We also sort of guarantee this backwards compatiblity - old DTB with
> newer kernel.
> 
> The solution is to add a CLK_IGNORE_UNUSED flag (but not CLK_IS_CRITICAL)
> to the newly added gate.
> 

Thanks, will improve it.

> This lets the clock stay and keeps the original behavious on old DTBs,
> but also allows the PCIe driver in newer kernels to turn off the clock
> if it wants to.
> 
> Thanks
> Heiko
> 
> 
> 
> 

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

end of thread, other threads:[~2026-03-06 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1772698011-145625-1-git-send-email-shawn.lin@rock-chips.com>
2026-03-06 10:52 ` [PATCH] clk: rockchip: rk3568: Add PCIe pipe clock gates Heiko Stuebner
2026-03-06 12:05   ` Shawn Lin

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