From: Conor Dooley <conor@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Conor Dooley <conor.dooley@microchip.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
linux-kernel@vger.kernel.org,
Daire McNamara <daire.mcnamara@microchip.com>,
pierre-henry.moussay@microchip.com,
valentina.fernandezalanis@microchip.com,
Michael Turquette <mturquette@baylibre.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Jassi Brar <jassisinghbrar@gmail.com>, Lee Jones <lee@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 08/11] clk: move meson clk-regmap implementation to common code
Date: Thu, 20 Feb 2025 15:29:10 +0000 [thread overview]
Message-ID: <20250220-iciness-mobilize-94a027ff52ce@spud> (raw)
In-Reply-To: <20250121-cheddar-kissing-bea27c6f2726@spud>
[-- Attachment #1: Type: text/plain, Size: 4217 bytes --]
On Tue, Jan 21, 2025 at 05:38:53PM +0000, Conor Dooley wrote:
> Hey Stephen,
>
> Any thoughts on the example I gave below?
I'll give you a few more days to comment, and then I'll just send a
fresh revision, implemented as below. The links seem to have expired in
a rebase along the way, so I've provided some fresh links.
Cheers,
Conor.
>
> On Fri, Dec 06, 2024 at 01:56:08PM +0000, Conor Dooley wrote:
> > On Tue, Dec 03, 2024 at 02:50:31PM -0800, Stephen Boyd wrote:
> > > Quoting Conor Dooley (2024-11-28 02:36:16)
> > > > On Thu, Nov 14, 2024 at 05:29:54PM -0800, Stephen Boyd wrote:
> > > > > Quoting Conor Dooley (2024-11-06 04:56:25)
> > > > > > My use case doesn't
> > > > > > actually need the registration code changes either as, currently, only reg
> > > > > > gets set at runtime, but leaving that out is a level of incomplete I'd not
> > > > > > let myself away with.
> > > > > > Obviously shoving the extra members into the clk structs has the downside
> > > > > > of taking up a pointer and a offset worth of memory for each clock of
> > > > > > that type registered, but it is substantially easier to support devices
> > > > > > with multiple regmaps that way. Probably moot though since the approach you
> > > > > > suggested in the thread linked above that implements a clk_hw_get_regmap()
> > > > > > has to store a pointer to the regmap's identifier which would take up an
> > > > > > identical amount of memory.
> > > > >
> > > > > We don't need to store the regmap identifier in the struct clk. We can
> > > > > store it in the 'struct clk_init_data' with some new field, and only do
> > > > > that when/if we actually need to. We would need to pass the init data to
> > > > > the clk_ops::init() callback though. We currently knock that out during
> > > > > registration so that clk_hw->init is NULL. Probably we can just set that
> > > > > to NULL after the init routine runs in __clk_core_init().
> > > > >
> > > > > Long story short, don't add something to 'struct clk_core', 'struct
> > > > > clk', or 'struct clk_hw' for these details. We can have a 'struct
> > > > > clk_regmap_hw' that everyone else can build upon:
> > > > >
> > > > > struct clk_regmap_hw {
> > > > > struct regmap *regmap;
> > > > > struct clk_hw hw;
> > > > > };
> > > >
> > > > What's the point of this? I don't understand why you want to do this over
> > > > what clk_divider et al already do, where clk_hw and the iomem pointer
> > > > are in the struct itself.
> > >
> > > Can you give an example? I don't understand what you're suggesting. I
> > > prefer a struct clk_regmap_hw like above so that the existing struct
> > > clk_hw in the kernel aren't increased by a pointer. SoC drivers can use
> > > the same struct as a replacement for their struct clk_hw member today.
> >
> > Best example I guess is to link what I did? This one is the core
> > changes:
> > https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/?h=syscon-rework-2&id=35904222355e971c24b3eb9b9fad3dd0c38d1393
https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/?h=syscon-rework-2&id=435c8eb223ee804297a0491fae2b00d3d5a9c773
> > clk-gate has my original hack that I did while trying to figure out
> > what you wanted, clk-divider-regmap is a 99% copy of clk-divider with
> > the types, function names and readl()/writel() implementations modified.
> > Before your last set of comments I was doing something identical to the
> > clk-gate change for clk-divider also.
> > Here's the changes required to my driver to make it work with the
> > updated:
> > https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/?h=syscon-rework-2&id=ea40211fe20f8bc6ef0320b93e1baa5b3f244601
https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/?h=syscon-rework-2&id=f55e907e93c55c943725dd62c2fc7dc76cdbd8d5
> > It's pretty much a drop in replacement, other than the additional
> > complexity in probe.
> >
> > Hopefully that either gets my point across or lets you spot why I don't
> > understand the benefit of a wrapper around clk_hw.
> >
> > Cheers,
> > Conor.
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-02-20 15:29 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 10:47 [PATCH v1 00/11] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
2024-10-02 10:47 ` [PATCH v1 01/11] dt-bindings: mailbox: mpfs: fix reg properties Conor Dooley
2024-10-02 23:13 ` Rob Herring (Arm)
2024-10-02 10:48 ` [PATCH v1 02/11] mailbox: mpfs: support new, syscon based, devicetree configuration Conor Dooley
2024-10-02 10:48 ` [PATCH v1 03/11] dt-bindings: mfd: syscon document the non simple-mfd syscon on PolarFire SoC Conor Dooley
2024-10-02 23:28 ` Rob Herring (Arm)
2024-10-09 16:12 ` (subset) " Lee Jones
2024-10-02 10:48 ` [PATCH v1 04/11] dt-bindings: soc: microchip: document the two simple-mfd syscons " Conor Dooley
2024-10-02 23:28 ` Rob Herring
2024-10-02 10:48 ` [PATCH v1 05/11] soc: microchip: add mfd drivers for two syscon regions " Conor Dooley
2024-10-02 10:48 ` [PATCH v1 06/11] reset: mpfs: add non-auxiliary bus probing Conor Dooley
2024-10-02 11:59 ` Philipp Zabel
2024-10-02 10:48 ` [PATCH v1 07/11] dt-bindings: clk: microchip: mpfs: remove first reg region Conor Dooley
2024-10-02 23:36 ` Rob Herring (Arm)
2024-10-02 10:48 ` [PATCH v1 08/11] clk: move meson clk-regmap implementation to common code Conor Dooley
2024-10-02 11:20 ` Neil Armstrong
2024-10-02 13:21 ` Jerome Brunet
2024-10-03 11:33 ` Conor Dooley
2024-11-06 12:56 ` Conor Dooley
2024-11-15 1:29 ` Stephen Boyd
2024-11-28 10:36 ` Conor Dooley
2024-12-03 22:50 ` Stephen Boyd
2024-12-06 13:56 ` Conor Dooley
2025-01-21 17:38 ` Conor Dooley
2025-02-20 15:29 ` Conor Dooley [this message]
2024-10-02 10:48 ` [PATCH v1 09/11] clk: microchip: mpfs: use regmap clock types Conor Dooley
2024-10-02 10:48 ` [PATCH v1 10/11] riscv: dts: microchip: fix mailbox description Conor Dooley
2024-10-14 15:41 ` Conor Dooley
2024-10-02 10:48 ` [PATCH v1 11/11] riscv: dts: microchip: convert clock and reset to use syscon Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250220-iciness-mobilize-94a027ff52ce@spud \
--to=conor@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pierre-henry.moussay@microchip.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=valentina.fernandezalanis@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).