linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
@ 2022-05-05 12:51 Michael Ellerman
  2022-05-05 12:51 ` [PATCH 2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Ellerman @ 2022-05-05 12:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
related config symbols.

Add matching symbols for powerpc, which are enabled by default but
depend on our architecture specific PAGE_SIZE symbols.

This allows generic/driver code to express dependencies on the PAGE_SIZE
without needing to refer to architecture specific config symbols.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/Kconfig | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 145af02df3dc..02994361cc7a 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -759,6 +759,22 @@ config PPC_256K_PAGES
 
 endchoice
 
+config PAGE_SIZE_4KB
+	def_bool y
+	depends on PPC_4K_PAGES
+
+config PAGE_SIZE_16KB
+	def_bool y
+	depends on PPC_16K_PAGES
+
+config PAGE_SIZE_64KB
+	def_bool y
+	depends on PPC_64K_PAGES
+
+config PAGE_SIZE_256KB
+	def_bool y
+	depends on PPC_256K_PAGES
+
 config PPC_PAGE_SHIFT
 	int
 	default 18 if PPC_256K_PAGES
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols
  2022-05-05 12:51 [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Michael Ellerman
@ 2022-05-05 12:51 ` Michael Ellerman
  2022-05-18  9:41 ` [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Christophe Leroy
  2022-05-24 11:09 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2022-05-05 12:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

In the previous commit powerpc added PAGE_SIZE related config symbols
using the generic names.

So there's no need to refer to them in the definition of
PAGE_SIZE_LESS_THAN_64KB etc, the negative dependency on the generic
symbol is sufficient (in this case !PAGE_SIZE_64KB).

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/Kconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 31c4fdc4a4ba..d235c9089d17 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1007,12 +1007,10 @@ config PAGE_SIZE_LESS_THAN_64KB
 	depends on !IA64_PAGE_SIZE_64KB
 	depends on !PAGE_SIZE_64KB
 	depends on !PARISC_PAGE_SIZE_64KB
-	depends on !PPC_64K_PAGES
 	depends on PAGE_SIZE_LESS_THAN_256KB
 
 config PAGE_SIZE_LESS_THAN_256KB
 	def_bool y
-	depends on !PPC_256K_PAGES
 	depends on !PAGE_SIZE_256KB
 
 # This allows to use a set of generic functions to determine mmap base
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
  2022-05-05 12:51 [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Michael Ellerman
  2022-05-05 12:51 ` [PATCH 2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols Michael Ellerman
@ 2022-05-18  9:41 ` Christophe Leroy
  2022-05-18 13:00   ` Michael Ellerman
  2022-05-24 11:09 ` Michael Ellerman
  2 siblings, 1 reply; 7+ messages in thread
From: Christophe Leroy @ 2022-05-18  9:41 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: linux-kernel



Le 05/05/2022 à 14:51, Michael Ellerman a écrit :
> Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
> related config symbols.
> 
> Add matching symbols for powerpc, which are enabled by default but
> depend on our architecture specific PAGE_SIZE symbols.
> 
> This allows generic/driver code to express dependencies on the PAGE_SIZE
> without needing to refer to architecture specific config symbols.

I guess next step should be to get rid of powerpc specific symbols and 
use generic symbols instead.

We have (only) 111 occurences of it.


> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>   arch/powerpc/Kconfig | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 145af02df3dc..02994361cc7a 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -759,6 +759,22 @@ config PPC_256K_PAGES
>   
>   endchoice
>   
> +config PAGE_SIZE_4KB
> +	def_bool y
> +	depends on PPC_4K_PAGES
> +
> +config PAGE_SIZE_16KB
> +	def_bool y
> +	depends on PPC_16K_PAGES
> +
> +config PAGE_SIZE_64KB
> +	def_bool y
> +	depends on PPC_64K_PAGES
> +
> +config PAGE_SIZE_256KB
> +	def_bool y
> +	depends on PPC_256K_PAGES
> +
>   config PPC_PAGE_SHIFT
>   	int
>   	default 18 if PPC_256K_PAGES

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
  2022-05-18  9:41 ` [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Christophe Leroy
@ 2022-05-18 13:00   ` Michael Ellerman
  2022-05-18 13:21     ` Arnd Bergmann
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2022-05-18 13:00 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev; +Cc: linux-kernel

Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 05/05/2022 à 14:51, Michael Ellerman a écrit :
>> Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
>> related config symbols.
>> 
>> Add matching symbols for powerpc, which are enabled by default but
>> depend on our architecture specific PAGE_SIZE symbols.
>> 
>> This allows generic/driver code to express dependencies on the PAGE_SIZE
>> without needing to refer to architecture specific config symbols.
>
> I guess next step should be to get rid of powerpc specific symbols and 
> use generic symbols instead.
>
> We have (only) 111 occurences of it.

I thought about doing that, but it's quite a bit of churn. Maybe it's
worth it though to avoid confusion between the two symbols.

There's probably some that could be converted to IS_ENABLED() at the
same time, especially in hash_utils.c.

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
  2022-05-18 13:00   ` Michael Ellerman
@ 2022-05-18 13:21     ` Arnd Bergmann
  2022-05-18 13:27       ` Christophe Leroy
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2022-05-18 13:21 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Christophe Leroy, linuxppc-dev, linux-kernel

On Wed, May 18, 2022 at 2:00 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> > Le 05/05/2022 à 14:51, Michael Ellerman a écrit :
> >> Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
> >> related config symbols.
> >>
> >> Add matching symbols for powerpc, which are enabled by default but
> >> depend on our architecture specific PAGE_SIZE symbols.
> >>
> >> This allows generic/driver code to express dependencies on the PAGE_SIZE
> >> without needing to refer to architecture specific config symbols.
> >
> > I guess next step should be to get rid of powerpc specific symbols and
> > use generic symbols instead.
> >
> > We have (only) 111 occurences of it.
>
> I thought about doing that, but it's quite a bit of churn. Maybe it's
> worth it though to avoid confusion between the two symbols.

I have actually done this at some point, but for some reason never sent it out,
see my old patch at:

https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=randconfig-5.15-next&id=184c7273ee367fda3626e35f0079f181075690c8

Feel free to take ideas or the entire patch from that.

      Arnd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
  2022-05-18 13:21     ` Arnd Bergmann
@ 2022-05-18 13:27       ` Christophe Leroy
  0 siblings, 0 replies; 7+ messages in thread
From: Christophe Leroy @ 2022-05-18 13:27 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Ellerman; +Cc: linuxppc-dev, linux-kernel



Le 18/05/2022 à 15:21, Arnd Bergmann a écrit :
> On Wed, May 18, 2022 at 2:00 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>>> Le 05/05/2022 à 14:51, Michael Ellerman a écrit :
>>>> Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
>>>> related config symbols.
>>>>
>>>> Add matching symbols for powerpc, which are enabled by default but
>>>> depend on our architecture specific PAGE_SIZE symbols.
>>>>
>>>> This allows generic/driver code to express dependencies on the PAGE_SIZE
>>>> without needing to refer to architecture specific config symbols.
>>>
>>> I guess next step should be to get rid of powerpc specific symbols and
>>> use generic symbols instead.
>>>
>>> We have (only) 111 occurences of it.
>>
>> I thought about doing that, but it's quite a bit of churn. Maybe it's
>> worth it though to avoid confusion between the two symbols.
> 
> I have actually done this at some point, but for some reason never sent it out,
> see my old patch at:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=randconfig-5.15-next&id=184c7273ee367fda3626e35f0079f181075690c8
> 
> Feel free to take ideas or the entire patch from that.
> 


Well, at this point I was just talking about renaming the 
CONFIG_PPC_xxK_PAGES symbols to the generic naming while still keeping 
them in powerpc Kconfig.

You are going one step further by making it a generic arch symbol, 
that's also a good idea and can be done more or less independantly.

Christophe

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols
  2022-05-05 12:51 [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Michael Ellerman
  2022-05-05 12:51 ` [PATCH 2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols Michael Ellerman
  2022-05-18  9:41 ` [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Christophe Leroy
@ 2022-05-24 11:09 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: linux-kernel

On Thu, 5 May 2022 22:51:22 +1000, Michael Ellerman wrote:
> Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE
> related config symbols.
> 
> Add matching symbols for powerpc, which are enabled by default but
> depend on our architecture specific PAGE_SIZE symbols.
> 
> This allows generic/driver code to express dependencies on the PAGE_SIZE
> without needing to refer to architecture specific config symbols.
> 
> [...]

Applied to powerpc/next.

[1/2] powerpc: Add generic PAGE_SIZE config symbols
      https://git.kernel.org/powerpc/c/d036dc79cccd748e2a101c80c31efada7be8bb7c
[2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols
      https://git.kernel.org/powerpc/c/aa06530a535ffe8ba8b68054003b6fb262a8ec6f

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-24 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 12:51 [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Michael Ellerman
2022-05-05 12:51 ` [PATCH 2/2] arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols Michael Ellerman
2022-05-18  9:41 ` [PATCH 1/2] powerpc: Add generic PAGE_SIZE config symbols Christophe Leroy
2022-05-18 13:00   ` Michael Ellerman
2022-05-18 13:21     ` Arnd Bergmann
2022-05-18 13:27       ` Christophe Leroy
2022-05-24 11:09 ` Michael Ellerman

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).