linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Naveen N Rao <naveen@kernel.org>,
	linuxppc-dev@lists.ozlabs.org
Cc: Masahiro Yamada <masahiroy@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc: unify two CONFIG_POWERPC64_CPU entries in the same choice block
Date: Mon, 09 Jun 2025 10:59:12 +1000	[thread overview]
Message-ID: <875xh5wx0f.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20250607102005.1965409-1-masahiroy@kernel.org>

Masahiro Yamada <masahiroy@kernel.org> writes:
> There are two CONFIG_POWERPC64_CPU entries in the "CPU selection"
> choice block.
>
> I guess the intent is to display a different prompt depending on
> CPU_LITTLE_ENDIAN: "Generic (POWER5 and PowerPC 970 and above)" for big
> endian, and "Generic (POWER8 and above)" for little endian.

Yeah.

> I stumbled on this tricky use case, and worked around it on Kconfig with
> commit 4d46b5b623e0 ("kconfig: fix infinite loop in sym_calc_choice()").
> However, I doubt that supporting multiple entries with the same symbol
> in a choice block is worth the complexity - this is the only such case
> in the kernel tree.
>
> This commit merges the two entries. Once this cleanup is accepted in
> the powerpc subsystem, I will proceed to refactor the Kconfig parser.

OK. Sorry for the trouble.

It could be split into two symbols to keep the separate prompts, but it's
probably not worth the trouble.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers

> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 613b383ed8b3..7b527d18aa5e 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -122,16 +122,11 @@ choice
>  	  If unsure, select Generic.
>  
>  config POWERPC64_CPU
> -	bool "Generic (POWER5 and PowerPC 970 and above)"
> -	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
> +	bool "Generic 64 bits powerpc"
> +	depends on PPC_BOOK3S_64
> +	select ARCH_HAS_FAST_MULTIPLIER if CPU_LITTLE_ENDIAN
>  	select PPC_64S_HASH_MMU
> -
> -config POWERPC64_CPU
> -	bool "Generic (POWER8 and above)"
> -	depends on PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN
> -	select ARCH_HAS_FAST_MULTIPLIER
> -	select PPC_64S_HASH_MMU
> -	select PPC_HAS_LBARX_LHARX
> +	select PPC_HAS_LBARX_LHARX if CPU_LITTLE_ENDIAN
>  
>  config POWERPC_CPU
>  	bool "Generic 32 bits powerpc"
> -- 
> 2.43.0


  parent reply	other threads:[~2025-06-09  0:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-07 10:13 [PATCH] powerpc: unify two CONFIG_POWERPC64_CPU entries in the same choice block Masahiro Yamada
2025-06-07 11:47 ` Christophe Leroy
2025-06-09  0:59 ` Michael Ellerman [this message]
2025-06-09  4:31   ` Masahiro Yamada
2025-08-28  6:33 ` Madhavan Srinivasan

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=875xh5wx0f.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=masahiroy@kernel.org \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.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).