]> www.infradead.org Git - users/jedix/linux-maple.git/commit
clk: rockchip: rk3588: make gate linked clocks critical
authorSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 3 Apr 2023 19:32:49 +0000 (21:32 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 17 Apr 2023 22:54:04 +0000 (00:54 +0200)
commit64042c28c3bb6729df8e2fda89bc7ebbe3790907
tree11619a8ad625a5ed5f70d76aa1cf6ab7993d800b
parent933bf364e152cd60902cf9585c2ba310d593e69f
clk: rockchip: rk3588: make gate linked clocks critical

RK3588 has a couple of hardware blocks called Native Interface Unit
(NIU) that gate the clocks to devices behind them. Effectively this
means that some clocks require two parent clocks being enabled.
Downstream implemented this by using a separate clock driver
("clk-link") for them, which enables the second clock using PM
framework.

In the upstream kernel we are currently missing support for the second
parent. The information about it is in the GATE_LINK() macro as
linkname, but that is not used. Thus the second parent clock is not
properly enabled. So far this did not really matter, since these clocks
are mostly required for the more advanced IP blocks, that are not yet
supported upstream. As this is about to change we need a fix. There
are three options available:

1. Properly implement support for having two parent clocks in the
   clock framework.
2. Mark the affected clocks CLK_IGNORE_UNUSED, so that they are not
   disabled. This wastes some power, but keeps the hack contained
   within the clock driver. Going from this to the first solution
   is easy once that has been implemented.
3. Enabling the extra clock in the consumer driver. This leaks some
   implementation details into DT.

This patch implements the second option as an intermediate solution
until the first one is available. I used an alias for CLK_IS_CRITICAL,
so that it's easy to see which clocks are not really critical once
the clock framework supports a better way to implement this.

Tested-by: Vincent Legoll <vincent.legoll@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230403193250.108693-2-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/clk-rk3588.c