Skip to content

RFC clk: let clock claim resources

Jerome Brunet linux-clk 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5clk: actually call the clock init before any other callback of the clockdrivers/clk/clk.c+15 -110 replies
2/5clk: let init callback return an error codedrivers/clk/clk.c drivers/clk/meson/clk-mpll.c drivers/clk/meson/clk-phase.c +11 more+72 -350 replies
3/5clk: add terminate callback to clk_opsdrivers/clk/clk.c include/linux/clk-provider.h+9 -10 replies
4/5clk: add placeholder for clock internal datadrivers/clk/clk.c include/linux/clk-provider.h+15 -05 replies
5/5clk: meson: sclk-div: use runtime datadrivers/clk/meson/sclk-div.c drivers/clk/meson/sclk-div.h+49 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/5] clk: let clock claim resources

This patchset is a follow up on this pinky swear [0]. Its purpose is:
* Clarify the acceptable use of clk_ops init() callback
* Let the init() callback return an error code in case anything fail.
* Add the terminate() counter part of of init() to release the resources which may have been claimed in init()
* Add a per-clock placeholder for clock runtime data in the clock core. This may be useful to init() and save/restore_context()

It was initially suggested to rename these callbacks register/deregister(). But, 'register' is reserved word of C ... :P

In the end, after discussing with Mike, I decided to keep the name "init". It does not feel that important to change this. I really don't mind changing this if you feel differently and have a suggestion.

The last patch in this series is just an example of how the above can be used.

This is sent as an RFC to get the discussion going without bothering too many people.

In the final series, Patch 2 and 3 will probably be squashed and series sent to a wider audience.

[0]: https://lkml.kernel.org/r/CAEG3pNB-143Pr_xCTPj=tURhpiTiJqi61xfDGDVdU7zG5H-2tA@mail.gmail.com

Jerome Brunet (5):
clk: actually call the clock init before any other callback of the
clock
clk: let init callback return an error code
clk: add terminate callback to clk_ops
clk: add placeholder for clock internal data
clk: meson: sclk-div: use runtime data

 drivers/clk/clk.c                     | 51 ++++++++++++++-----
 drivers/clk/meson/clk-mpll.c          |  4 +-
 drivers/clk/meson/clk-phase.c         |  4 +-
 drivers/clk/meson/clk-pll.c           |  4 +-
 drivers/clk/meson/sclk-div.c          | 72 +++++++++++++++++++--------
 drivers/clk/meson/sclk-div.h          |  2 -
 drivers/clk/microchip/clk-core.c      |  8 ++-
 drivers/clk/mmp/clk-frac.c            |  4 +-
 drivers/clk/mmp/clk-mix.c             |  4 +-
 drivers/clk/qcom/clk-hfpll.c          |  6 ++-
 drivers/clk/rockchip/clk-pll.c        | 28 +++++++----
 drivers/clk/ti/clock.h                |  2 +-
 drivers/clk/ti/clockdomain.c          |  8 +--
 drivers/net/phy/mdio-mux-meson-g12a.c |  4 +-
 include/linux/clk-provider.h          | 15 ++++--
 15 files changed, 154 insertions(+), 62 deletions(-)
Signature · 1 line
2.21.0