lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9f1d69ebe1ddce5dfc170e986c9213f2.sboyd@kernel.org>
Date: Fri, 20 Dec 2024 16:12:03 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Jerome Brunet <jbrunet@...libre.com>, Kevin Hilman <khilman@...libre.com>, Martin Blumenstingl <martin.blumenstingl@...glemail.com>, Michael Turquette <mturquette@...libre.com>, Neil Armstrong <neil.armstrong@...aro.org>
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, linux-amlogic@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org, Jerome Brunet <jbrunet@...libre.com>
Subject: Re: [PATCH 2/3] clk: amlogic: drop clk_regmap tables

Quoting Jerome Brunet (2024-12-20 09:17:43)
> Remove the big clk_regmap tables that are used to populate the regmap
> field of clk_regmap clocks at runtime. Instead of using tables, use devres
> to allow the clocks to get the necessary regmap.
> 
> A simpler solution would have been to use dev_get_regmap() but this would
> not work with syscon based controllers.

Why not have two init functions, one that uses the syscon approach from
the parent device? Is the typical path to not use a syscon anyway?

> 
> This rework save a bit memory and the result is less of a maintenance
> burden.
> 
> Unfortunately meson8b is left out for now since it is an early clock
> driver that does not have proper device support for now.

We should add a clk_hw_get_of_node() function that returns
hw->core->of_node. Then there can be a similar function that looks at
the of_node of a clk registered with of_clk_hw_register() and tries to
find the regmap either with
syscon_node_to_regmap(clk_hw_get_of_node(hw)) or on the parent of the
node for the clk.

TL;DR: Don't use devres.

> 
> Signed-off-by: Jerome Brunet <jbrunet@...libre.com>
> ---
>  drivers/clk/meson/a1-peripherals.c | 165 +-------------
>  drivers/clk/meson/a1-pll.c         |  18 +-
>  drivers/clk/meson/axg-aoclk.c      |  22 --
>  drivers/clk/meson/axg-audio.c      | 435 +------------------------------------
>  drivers/clk/meson/axg.c            | 131 -----------
>  drivers/clk/meson/c3-peripherals.c | 212 +-----------------
>  drivers/clk/meson/c3-pll.c         |  34 +--
>  drivers/clk/meson/clk-cpu-dyndiv.c |   1 +
>  drivers/clk/meson/clk-dualdiv.c    |   2 +
>  drivers/clk/meson/clk-mpll.c       |   6 +
>  drivers/clk/meson/clk-phase.c      |  11 +
>  drivers/clk/meson/clk-pll.c        |   7 +
>  drivers/clk/meson/clk-regmap.c     |  88 ++++++++
>  drivers/clk/meson/clk-regmap.h     |   7 +
>  drivers/clk/meson/g12a-aoclk.c     |  34 ---
>  drivers/clk/meson/g12a.c           | 261 ----------------------
>  drivers/clk/meson/gxbb-aoclk.c     |  19 --
>  drivers/clk/meson/gxbb.c           | 393 ---------------------------------
>  drivers/clk/meson/meson-aoclk.c    |   7 +-
>  drivers/clk/meson/meson-aoclk.h    |   2 -
>  drivers/clk/meson/meson-eeclk.c    |   6 +-
>  drivers/clk/meson/meson-eeclk.h    |   2 -
>  drivers/clk/meson/meson8-ddr.c     |  11 +-
>  drivers/clk/meson/s4-peripherals.c | 231 +-------------------
>  drivers/clk/meson/s4-pll.c         |  33 +--
>  drivers/clk/meson/sclk-div.c       |   5 +
>  drivers/clk/meson/vclk.c           |   2 +
>  drivers/clk/meson/vid-pll-div.c    |   1 +
>  28 files changed, 165 insertions(+), 1981 deletions(-)

It would be more focused if you split the patch into two. One that
installs the init clk_op and implements the logic to hook up the regmap
and one that removes the arrays that are no longer used.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ