[v2,0/8] Rewrite clk parent handling
mbox series

Message ID 20190226223429.193873-1-sboyd@kernel.org
Headers show
Series
  • Rewrite clk parent handling
Related show

Message

Stephen Boyd Feb. 26, 2019, 10:34 p.m. UTC
There are a couple warts with clk parent handling in the common clk
framework. This patch series addresses one of those warts, parent-child
linkages. We use strings for all parent-child linkages, and this leads
to poorly written code that extracts clk names from struct clk pointers
and makes clk provider drivers use clk consumer APIs. 

Also, clkdev.c has a collection of DT parsing logic in it that is only
used when the common clk framework is present but we want to use that
same logic for describing parent-child linkages of clk providers via DT.
This code should all be moved into the common clk framework and used
from there as well as from clkdev.c, so this series changes the way
clkdev interacts with the clk framework by having clkdev get struct
clk_hw pointers out of DT clk specifiers and then convert those into clk
pointers with clk_hw_create_clk(). Splitting the API this way lets us
get struct clk_hw pointers for clk providers and skip the struct clk
pointer creation phase that we don't need to do when describing
parent-child linkages.

And finally, we have a few patches in here that lay the groundwork for
supporting device links in the common clk framework. We do that by
pushing the consuming device pointer through to the clk pointer creation
in clk_hw_create_clk(). This wasn't always easy to do when we had
__clk_create_clk() called from multiple places, some being deep in the
clk registration path. This series simplifies that logic so that we can
always attach a consumer device to a clk that we create in one place,
instead of making that linkage in multiple places near where we create
struct clk pointers.

I plan to at least merge the early patches in this series into clk-next
so we can clear the way for the later patches. I don't think anything is
too controversial until we get to the new way of specifying parents
at the end and of course, the sdm845 patch is incomplete so it's not
going to be merged.

Changes from v1:
 * Dropped new get_parent_hw, we'll pick it up in a later series
 * Rebased to v5.0-rc6 to avoid conflicts with clk-fixes
 * Renamed 'fallback' to 'name' and 'name' to 'fw_name' in parent map
 * Made sure that clk_hw_get_parent_by_index() never sees an error pointer
   so that we don't mistakenly try to defer an error pointer
 * Fixed index passing mistake on of_clk_get_hw_from_clkspec()
 * Copy over all the data from parent maps and free it correctly too

Miquel Raynal (1):
  clk: core: clarify the check for runtime PM

Stephen Boyd (7):
  clk: Combine __clk_get() and __clk_create_clk()
  clk: Introduce of_clk_get_hw_from_clkspec()
  clk: Inform the core about consumer devices
  clk: Move of_clk_*() APIs into clk.c from clkdev.c
  clk: Allow parents to be specified without string names
  clk: qcom: gcc-sdm845: Migrate to DT parent mapping
  arm64: dts: qcom: Specify XO clk as input to GCC node

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Chen-Yu Tsai <wens@csie.org>

 arch/arm64/boot/dts/qcom/sdm845.dtsi |   2 +
 drivers/clk/clk.c                    | 512 +++++++++++++++++++++------
 drivers/clk/clk.h                    |  23 +-
 drivers/clk/clkdev.c                 | 120 +------
 drivers/clk/qcom/gcc-sdm845.c        | 180 +++++-----
 include/linux/clk-provider.h         |  19 +
 6 files changed, 532 insertions(+), 324 deletions(-)


base-commit: d13937116f1e82bf508a6325111b322c30c85eb9

Comments

Stephen Boyd March 2, 2019, 12:45 a.m. UTC | #1
Quoting Stephen Boyd (2019-02-26 14:34:21)
> 
> I plan to at least merge the early patches in this series into clk-next
> so we can clear the way for the later patches. I don't think anything is
> too controversial until we get to the new way of specifying parents
> at the end and of course, the sdm845 patch is incomplete so it's not
> going to be merged.

I've pushed the first 5 to clk-next.