linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 1/5] clk: sunxi-ng: Remove duplicate ARCH_SUNXI dependencies
Date: Sat, 3 Dec 2022 13:57:13 +0000	[thread overview]
Message-ID: <20221203135713.0591b0b7@slackpad.lan> (raw)
In-Reply-To: <b7774c58-ccf8-4204-2e7e-6841fd13002d@sholland.org>

On Fri, 2 Dec 2022 19:52:41 -0600
Samuel Holland <samuel@sholland.org> wrote:

Hi Samuel,

> On 12/2/22 18:14, Andre Przywara wrote:
> > On Sat, 26 Nov 2022 13:13:15 -0600
> > Samuel Holland <samuel@sholland.org> wrote:
> > 
> > Hi,
> > 
> > thanks for addressing this!
> >   
> >> SUNXI_CCU already depends on ARCH_SUNXI, so adding the dependency to
> >> individual SoC drivers is redundant.
> >>
> >> Signed-off-by: Samuel Holland <samuel@sholland.org>
> >> ---
> >>
> >>  drivers/clk/sunxi-ng/Kconfig | 43 ++++++++++++++++++------------------
> >>  1 file changed, 21 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
> >> index 461537679c04..64cfa022e320 100644
> >> --- a/drivers/clk/sunxi-ng/Kconfig
> >> +++ b/drivers/clk/sunxi-ng/Kconfig
> >> @@ -14,43 +14,43 @@ config SUNIV_F1C100S_CCU
> >>  
> >>  config SUN20I_D1_CCU
> >>  	tristate "Support for the Allwinner D1 CCU"
> >> -	default RISCV && ARCH_SUNXI
> >> -	depends on (RISCV && ARCH_SUNXI) || COMPILE_TEST
> >> +	default RISCV
> >> +	depends on RISCV || COMPILE_TEST  
> > 
> > I agree on the "depends" part: Indeed the guard symbol already covers
> > that, so it's redundant.
> > However I am not so sure about the "default" part: When ARCH_SUNXI is
> > deselected, but COMPILE_TEST in enabled, we default to every CCU driver
> > being built-in. I am not sure this is the intention, or at least
> > expected when doing compile testing?  
> 
> SUNXI_CCU, which these depend on, is still "default ARCH_SUNXI", so if
> you have ARCH_SUNXI disabled, you only get any drivers if you manually
> enable SUNXI_CCU. I mentioned this in the patch 2 description, but maybe
> I should move that comment here.

Yeah, I read this later on, I guess it's fine then.

> 
> >>  
> >>  config SUN20I_D1_R_CCU
> >>  	tristate "Support for the Allwinner D1 PRCM CCU"
> >> -	default RISCV && ARCH_SUNXI
> >> -	depends on (RISCV && ARCH_SUNXI) || COMPILE_TEST
> >> +	default RISCV
> >> +	depends on RISCV || COMPILE_TEST
> >>  
> >>  config SUN50I_A64_CCU
> >>  	tristate "Support for the Allwinner A64 CCU"
> >> -	default ARM64 && ARCH_SUNXI
> >> -	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
> >> +	default ARM64
> >> +	depends on ARM64 || COMPILE_TEST  
> > 
> > I wonder if this "depends" line was always wrong and should be fixed:
> > We can compile a 32-bit ARM kernel and run it on an A64. Granted this
> > requires a special bootloader or a hacked U-Boot (tried that), and
> > reveals some other issues with the decompressor, but technically there
> > is no 64-bit dependency in here.
> > The same goes for all the other ARM64 CCUs: Cortex-A53s can run AArch32
> > in all exception levels.  
> 
> I was trying to simplify things by hiding irrelevant options, and you
> bring up an edge case of an edge case. :) I am okay with relaxing the
> dependency, though I would want to leave them disabled by default for
> 32-bit kernels (excluding them from the change in patch 2).

Yes, definitely, that was the idea.

And sorry for being a nuisance, but I think this "depends on ARCH_SUNXI"
here is and was always misplaced. In contrast to things like "depends
on PCI" or "depends on GPIOLIB", there is no real dependency on
ARCH_SUNXI or even ARM/RISCV here, it's more a "only useful on
ARCH_SUNXI".
And this ARM vs ARM64 was just another rationale for not being
overzealous with the dependency.

But I see that this is an orthogonal discussion to this patch, so this
should not block it. I will meditate over both patches again, since I
have the gut feeling that the end result is fine.

Cheers,
Andre

> 
> > So shall we just completely remove the "depends" line for those, and
> > let SUNXI_CCU do that job? Or use use !RISCV || COMPILE_TEST?  
> 
> That, or we could add MACH_SUN8I to the condition. I don't have a strong
> opinion.
> 
> Regards,
> Samuel
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-03 13:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 19:13 [PATCH 0/5] clk: sunxi-ng: Allwinner R528/T113 clock support Samuel Holland
2022-11-26 19:13 ` [PATCH 1/5] clk: sunxi-ng: Remove duplicate ARCH_SUNXI dependencies Samuel Holland
2022-12-03  0:14   ` Andre Przywara
2022-12-03  1:52     ` Samuel Holland
2022-12-03 13:57       ` Andre Przywara [this message]
2022-12-05 20:19   ` Jernej Škrabec
2022-11-26 19:13 ` [PATCH 2/5] clk: sunxi-ng: Move SoC driver conditions to dependencies Samuel Holland
2022-12-05 20:16   ` Jernej Škrabec
2022-11-26 19:13 ` [PATCH 3/5] clk: sunxi-ng: d1: Allow building for R528/T113 Samuel Holland
2022-12-03  0:15   ` Andre Przywara
2022-12-05 20:14   ` Jernej Škrabec
2022-11-26 19:13 ` [PATCH 4/5] clk: sunxi-ng: d1: Mark cpux clock as critical Samuel Holland
2022-12-03  0:22   ` Andre Przywara
2022-12-05 20:13   ` Jernej Škrabec
2022-11-26 19:13 ` [PATCH 5/5] clk: sunxi-ng: d1: Add CAN bus gates and resets Samuel Holland
2022-11-27 20:51   ` Krzysztof Kozlowski
2022-12-03  0:40   ` Andre Przywara

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=20221203135713.0591b0b7@slackpad.lan \
    --to=andre.przywara@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=sboyd@kernel.org \
    --cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).