mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Brian Masney <bmasney@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	Hal Feng <hal.feng@starfivetech.com>
Subject: Re: [PATCH v1 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code
Date: Mon, 16 Nov 2026 12:01:09 +0100	[thread overview]
Message-ID: <1jqzgl2g7e.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <ZQ4PR01MB1202C1DD9DE098DB4674A940F27C2@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>

On lun. 16 nov. 2026 at 08:01, Changhuang Liang <changhuang.liang@starfivetech.com> wrote:

> Hi, Jerome
>
>> > jh7110_reset_controller_register() is only tied to the JH7110 system
>> > clock driver by its location. Its logic is generic: hand the CRG
>> > register base to the reset driver through an auxiliary device.
>> >
>> > Move it to clk-starfive-jh71x0.c as jh71x0_reset_controller_register()
>> > so that the clock drivers of other StarFive SoCs can reuse it, and
>> > make
>> > CLK_STARFIVE_JH71X0 select AUXILIARY_BUS accordingly.
>> >
>> > While at it, replace the open-coded auxiliary device allocation, init,
>> > add and release handling with devm_auxiliary_device_create(), which
>> > already implements all of it. The register base is now passed to the
>> > reset driver as platform data of the auxiliary device, so struct
>> > jh71x0_reset_adev and the embedded auxiliary device go away.
>> >
>> > The auxiliary device ID is dropped: every CRG already uses a distinct
>> > auxiliary device name, so the ID is not needed to keep the device
>> > names unique, and it is always 0 now.
>> >
>> > Since the helper now lives in clk-starfive-jh71x0.c, the auxiliary
>> > device names are prefixed with "clk_starfive_jh71x0" instead of
>> > "clk_starfive_jh7110_sys". Update the auxiliary_device_id table of the
>> > JH7110 reset driver in the same patch to keep the tree bisectable.
>> >
>> > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
>> > ---
>> >  drivers/clk/starfive/Kconfig                  |  2 +-
>> >  .../clk/starfive/clk-starfive-jh7110-aon.c    |  2 +-
>> >  .../clk/starfive/clk-starfive-jh7110-isp.c    |  2 +-
>> >  .../clk/starfive/clk-starfive-jh7110-stg.c    |  2 +-
>> >  .../clk/starfive/clk-starfive-jh7110-sys.c    | 59 +------------------
>> >  .../clk/starfive/clk-starfive-jh7110-vout.c   |  2 +-
>> >  drivers/clk/starfive/clk-starfive-jh7110.h    |  4 --
>> >  drivers/clk/starfive/clk-starfive-jh71x0.c    | 24 ++++++++
>> >  drivers/clk/starfive/clk-starfive-jh71x0.h    |  2 +
>> >  .../reset/starfive/reset-starfive-jh7110.c    | 19 +++---
>> >  include/soc/starfive/reset-starfive-jh71x0.h  | 10 ++--
>> >  11 files changed, 45 insertions(+), 83 deletions(-)
>> >
>> > diff --git a/drivers/clk/starfive/Kconfig
>> > b/drivers/clk/starfive/Kconfig index bd29358ffeec..51716655554f 100644
>> > --- a/drivers/clk/starfive/Kconfig
>> > +++ b/drivers/clk/starfive/Kconfig
>> > @@ -2,6 +2,7 @@
>> >
>> >  config CLK_STARFIVE_JH71X0
>> >  	bool
>> > +	select AUXILIARY_BUS
>> >
>> >  config CLK_STARFIVE_JH7100
>> >  	bool "StarFive JH7100 clock support"
>> > @@ -32,7 +33,6 @@ config CLK_STARFIVE_JH7110_PLL  config
>> > CLK_STARFIVE_JH7110_SYS
>> >  	bool "StarFive JH7110 system clock support"
>> >  	depends on ARCH_STARFIVE || COMPILE_TEST
>> > -	select AUXILIARY_BUS
>> >  	select CLK_STARFIVE_JH71X0
>> >  	select RESET_STARFIVE_JH7110 if RESET_CONTROLLER
>> 
>> You've switched to imply for the new controller you are introducing later in
>> this series.
>> You should probably be consistent and align this one too. Not in this change
>> though, it would be unrelated.
>
> I'm not going to put this suggestion into the current series for now. I plan to send it 
> as a separate patch later. Do you think that's okay?

Ok

>
>> 
>> This change otherwise looks good to me. It requires Philipp's opinion as it is
>> touching reset too.
>> 
>> --
>> Jerome
>
> Best Regards,
> Changhuang
>

-- 
Jerome

  reply	other threads:[~2026-11-16 11:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 10:27 [PATCH v1 0/6] Add System-0 CRG for JHB100 SoC Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 1/6] clk: starfive: jh7110-sys: Fix memory leak in reset controller register Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code Changhuang Liang
2026-11-15 14:18   ` Jerome Brunet
2026-11-16  8:01     ` Changhuang Liang
2026-11-16 11:01       ` Jerome Brunet [this message]
2026-10-13 10:27 ` [PATCH v1 3/6] clk: starfive: jh71x0: Add generic CRG probe helper Changhuang Liang
2026-11-15 14:18   ` Jerome Brunet
2026-10-13 10:27 ` [PATCH v1 4/6] clk: starfive: Add JHB100 System-0 clock generator driver Changhuang Liang
2026-11-15 14:18   ` Jerome Brunet
2026-11-16  2:09     ` Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 5/6] reset: starfive: jh71x0: Support discontiguous reset IDs Changhuang Liang
2026-11-15 14:18   ` Jerome Brunet
2026-10-13 10:27 ` [PATCH v1 6/6] reset: starfive: Add StarFive JHB100 System-0 reset driver Changhuang Liang
2026-11-15 14:18   ` Jerome Brunet

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=1jqzgl2g7e.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=bmasney@redhat.com \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=hal.feng@starfivetech.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=kernel@esmil.dk \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /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

all inboxes | Powered by JetHome®