linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Rework SCMI Clock driver clk_ops setup procedure
@ 2024-04-15 16:36 Cristian Marussi
  2024-04-15 16:36 ` [PATCH v3 1/5] clk: scmi: Allocate CLK operations dynamically Cristian Marussi
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Cristian Marussi @ 2024-04-15 16:36 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-clk
  Cc: sudeep.holla, james.quinlan, f.fainelli, vincent.guittot,
	peng.fan, michal.simek, quic_sibis, quic_nkela,
	souvik.chakravarty, mturquette, sboyd, Cristian Marussi

Hi,

a small series to review how the SCMI Clock driver chooses and sets up the
CLK operations to associate to a clock when registering with CLK framework.

SCMI clocks exposed by the platform sports a growing number of clock
properties since SCMI v3.2: discovered SCMI clocks could be restricted in
terms of capability to set state/rate/parent/duty_cycle and the platform
itself can have a varying support in terms of atomic support.

Knowing upfront which operations are NOT allowed on some clocks helps
avoiding needless message exchanges.

As a result, the SCMI Clock driver, when registering resources with the
CLK framework, aims to provide only the specific clk_ops as known to be
certainly supported by the specific SCMI clock resource.

Using static pre-compiled clk_ops structures to fulfill all the possible
(and possibly growing) combinations of clock features is cumbersome and
error-prone (there are 32 possible combinations as of now to account for
the above mentioned clock features variation).

This rework introduces a dynamic allocation mechanism to be able to
configure the required clk_ops at run-time when the SCMI clocks are
enumerated.

Only one single clk_ops is generated (per driver instance) for each of the
features combinations effectively found in the set of returned SCMI
resources.

Once this preliminary rework is done in 1/5, the following patches use this
new clk_ops schema to introduce a number of restricted clk_ops depending on
the specific retrieved SCMI clocks characteristics.

Based on v6.9-rc1

Thanks,
Cristian

v2 -> v3
- moving scmi_clk_ops_db from being global to a per-instance/per-probe
  structure to avoid sharing devm_ allocated clk_ops between different
  driver instances.
- using bits.h macros
- fixed a few dox comments
- explicit unit in atomic_threshold_us
- added a runtime size-check before accessing scmi_clk_ops_db using feats_key
- reworked scmi_clk_ops_alloc call to reduce nesting
- using transport_is_atomic instead of is_atomic to be clearer
- using SCMI_<feats>_SUPPORTED instead of SCMI<feats>_FORBIDDEN

v1 -> V2
- rebased on v6.9-rc1

Cristian Marussi (5):
  clk: scmi: Allocate CLK operations dynamically
  clk: scmi: Add support for state control restricted clocks
  clk: scmi: Add support for rate change restricted clocks
  clk: scmi: Add support for re-parenting restricted clocks
  clk: scmi: Add support for get/set duty_cycle operations

 drivers/clk/clk-scmi.c | 249 +++++++++++++++++++++++++++++++++--------
 1 file changed, 201 insertions(+), 48 deletions(-)

-- 
2.44.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-04-22 19:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 16:36 [PATCH v3 0/5] Rework SCMI Clock driver clk_ops setup procedure Cristian Marussi
2024-04-15 16:36 ` [PATCH v3 1/5] clk: scmi: Allocate CLK operations dynamically Cristian Marussi
2024-04-22 19:04   ` Stephen Boyd
2024-04-15 16:36 ` [PATCH v3 2/5] clk: scmi: Add support for state control restricted clocks Cristian Marussi
2024-04-22 19:04   ` Stephen Boyd
2024-04-15 16:36 ` [PATCH v3 3/5] clk: scmi: Add support for rate change " Cristian Marussi
2024-04-22 19:04   ` Stephen Boyd
2024-04-15 16:36 ` [PATCH v3 4/5] clk: scmi: Add support for re-parenting " Cristian Marussi
2024-04-22 19:04   ` Stephen Boyd
2024-04-15 16:36 ` [PATCH v3 5/5] clk: scmi: Add support for get/set duty_cycle operations Cristian Marussi
2024-04-22 19:03   ` Stephen Boyd
2024-04-20  2:08 ` [PATCH v3 0/5] Rework SCMI Clock driver clk_ops setup procedure Stephen Boyd
2024-04-21  9:31   ` Cristian Marussi
2024-04-22  8:06   ` Sudeep Holla
2024-04-22 19:00     ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).