All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Support CMDLINE_EXTEND
@ 2019-07-24  5:33 ` Chris Packham
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Packham @ 2019-07-24  5:33 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, linux-kernel, Chris Packham

Device tree aware platforms can make use of CMDLINE_EXTEND to extend the
kernel command line provided by the bootloader. This is particularly
useful to set parameters for built-in modules that would otherwise be
done at module insertion. Add support for this in the powerpc
architecture.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 arch/powerpc/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d8dcd8820369..cd9b3974aa36 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -851,6 +851,11 @@ config CMDLINE
 	  some command-line options at build time by entering them here.  In
 	  most cases you will need to specify the root device here.
 
+choice
+	prompt "Kernel command line type" if CMDLINE != ""
+	default CMDLINE_FORCE
+	depends on CMDLINE_BOOL
+
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
 	depends on CMDLINE_BOOL
@@ -860,6 +865,13 @@ config CMDLINE_FORCE
 	  This is useful if you cannot or don't want to change the
 	  command-line options your boot loader passes to the kernel.
 
+config CMDLINE_EXTEND
+	bool "Extend bootloader kernel arguments"
+	help
+	  The command-line arguments provided by the boot loader will be
+	  appended to the default kernel command string.
+endchoice
+
 config EXTRA_TARGETS
 	string "Additional default image types"
 	help
-- 
2.22.0


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

* [PATCH] powerpc: Support CMDLINE_EXTEND
@ 2019-07-24  5:33 ` Chris Packham
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Packham @ 2019-07-24  5:33 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: Chris Packham, linuxppc-dev, linux-kernel

Device tree aware platforms can make use of CMDLINE_EXTEND to extend the
kernel command line provided by the bootloader. This is particularly
useful to set parameters for built-in modules that would otherwise be
done at module insertion. Add support for this in the powerpc
architecture.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 arch/powerpc/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d8dcd8820369..cd9b3974aa36 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -851,6 +851,11 @@ config CMDLINE
 	  some command-line options at build time by entering them here.  In
 	  most cases you will need to specify the root device here.
 
+choice
+	prompt "Kernel command line type" if CMDLINE != ""
+	default CMDLINE_FORCE
+	depends on CMDLINE_BOOL
+
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
 	depends on CMDLINE_BOOL
@@ -860,6 +865,13 @@ config CMDLINE_FORCE
 	  This is useful if you cannot or don't want to change the
 	  command-line options your boot loader passes to the kernel.
 
+config CMDLINE_EXTEND
+	bool "Extend bootloader kernel arguments"
+	help
+	  The command-line arguments provided by the boot loader will be
+	  appended to the default kernel command string.
+endchoice
+
 config EXTRA_TARGETS
 	string "Additional default image types"
 	help
-- 
2.22.0


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

* Re: [PATCH] powerpc: Support CMDLINE_EXTEND
  2019-07-24  5:33 ` Chris Packham
  (?)
@ 2019-07-30  7:02 ` Christophe Leroy
  2019-07-30 21:10   ` Chris Packham
  -1 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2019-07-30  7:02 UTC (permalink / raw)
  To: Chris Packham, benh, paulus, mpe; +Cc: linuxppc-dev, linux-kernel



Le 24/07/2019 à 07:33, Chris Packham a écrit :
> Device tree aware platforms can make use of CMDLINE_EXTEND to extend the
> kernel command line provided by the bootloader. This is particularly
> useful to set parameters for built-in modules that would otherwise be
> done at module insertion. Add support for this in the powerpc
> architecture.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>   arch/powerpc/Kconfig | 12 ++++++++++++

I think you also have to implement some stuff in early_cmdline_parse() 
in arch/powerpc/kernel/prom_init.c

Maybe look at https://patchwork.ozlabs.org/patch/1074126/

Christophe

>   1 file changed, 12 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index d8dcd8820369..cd9b3974aa36 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -851,6 +851,11 @@ config CMDLINE
>   	  some command-line options at build time by entering them here.  In
>   	  most cases you will need to specify the root device here.
>   
> +choice
> +	prompt "Kernel command line type" if CMDLINE != ""
> +	default CMDLINE_FORCE
> +	depends on CMDLINE_BOOL
> +
>   config CMDLINE_FORCE
>   	bool "Always use the default kernel command string"
>   	depends on CMDLINE_BOOL
> @@ -860,6 +865,13 @@ config CMDLINE_FORCE
>   	  This is useful if you cannot or don't want to change the
>   	  command-line options your boot loader passes to the kernel.
>   
> +config CMDLINE_EXTEND
> +	bool "Extend bootloader kernel arguments"
> +	help
> +	  The command-line arguments provided by the boot loader will be
> +	  appended to the default kernel command string.
> +endchoice
> +
>   config EXTRA_TARGETS
>   	string "Additional default image types"
>   	help
> 

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

* Re: [PATCH] powerpc: Support CMDLINE_EXTEND
  2019-07-30  7:02 ` Christophe Leroy
@ 2019-07-30 21:10   ` Chris Packham
  2019-07-31  7:23     ` Christophe Leroy
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Packham @ 2019-07-30 21:10 UTC (permalink / raw)
  To: christophe.leroy, paulus, mpe, benh; +Cc: linuxppc-dev, linux-kernel

Hi Christophe,

On Tue, 2019-07-30 at 09:02 +0200, Christophe Leroy wrote:
> 
> Le 24/07/2019 à 07:33, Chris Packham a écrit :
> > 
> > Device tree aware platforms can make use of CMDLINE_EXTEND to
> > extend the
> > kernel command line provided by the bootloader. This is
> > particularly
> > useful to set parameters for built-in modules that would otherwise
> > be
> > done at module insertion. Add support for this in the powerpc
> > architecture.
> > 
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > ---
> >   arch/powerpc/Kconfig | 12 ++++++++++++
> I think you also have to implement some stuff in
> early_cmdline_parse() 
> in arch/powerpc/kernel/prom_init.c

I my case I didn't need to since the generic code in drivers/of/fdt.c
did what I need. For early options or platforms that don't use a device
tree then I can see why I'd need the update to update to prom_init.

> 
> Maybe look at https://patchwork.ozlabs.org/patch/1074126/
> 

Do you mind if I take this and fold it into a v2 of my patch? Any
particular reason it didn't get picked up in April?

> Christophe
> 
> > 
> >   1 file changed, 12 insertions(+)
> > 
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index d8dcd8820369..cd9b3974aa36 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -851,6 +851,11 @@ config CMDLINE
> >   	  some command-line options at build time by entering
> > them here.  In
> >   	  most cases you will need to specify the root device
> > here.
> >   
> > +choice
> > +	prompt "Kernel command line type" if CMDLINE != ""
> > +	default CMDLINE_FORCE
> > +	depends on CMDLINE_BOOL
> > +
> >   config CMDLINE_FORCE
> >   	bool "Always use the default kernel command string"
> >   	depends on CMDLINE_BOOL
> > @@ -860,6 +865,13 @@ config CMDLINE_FORCE
> >   	  This is useful if you cannot or don't want to change
> > the
> >   	  command-line options your boot loader passes to the
> > kernel.
> >   
> > +config CMDLINE_EXTEND
> > +	bool "Extend bootloader kernel arguments"
> > +	help
> > +	  The command-line arguments provided by the boot loader
> > will be
> > +	  appended to the default kernel command string.
> > +endchoice
> > +
> >   config EXTRA_TARGETS
> >   	string "Additional default image types"
> >   	help
> > 

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

* Re: [PATCH] powerpc: Support CMDLINE_EXTEND
  2019-07-30 21:10   ` Chris Packham
@ 2019-07-31  7:23     ` Christophe Leroy
  2019-08-01  0:14       ` Chris Packham
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2019-07-31  7:23 UTC (permalink / raw)
  To: Chris Packham, paulus, mpe, benh; +Cc: linuxppc-dev, linux-kernel



Le 30/07/2019 à 23:10, Chris Packham a écrit :
> Hi Christophe,
> 
> On Tue, 2019-07-30 at 09:02 +0200, Christophe Leroy wrote:
>>
>> Le 24/07/2019 à 07:33, Chris Packham a écrit :
>>>
>>> Device tree aware platforms can make use of CMDLINE_EXTEND to
>>> extend the
>>> kernel command line provided by the bootloader. This is
>>> particularly
>>> useful to set parameters for built-in modules that would otherwise
>>> be
>>> done at module insertion. Add support for this in the powerpc
>>> architecture.
>>>
>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>> ---
>>>    arch/powerpc/Kconfig | 12 ++++++++++++
>> I think you also have to implement some stuff in
>> early_cmdline_parse()
>> in arch/powerpc/kernel/prom_init.c
> 
> I my case I didn't need to since the generic code in drivers/of/fdt.c
> did what I need. For early options or platforms that don't use a device
> tree then I can see why I'd need the update to update to prom_init.
> 
>>
>> Maybe look at https://patchwork.ozlabs.org/patch/1074126/
>>
> 
> Do you mind if I take this and fold it into a v2 of my patch? Any
> particular reason it didn't get picked up in April?

Sure, take it, I don't mind.

Two reasons it was not picked up in April I believe:
- It was part of a larger series 
(https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=100518) 
and was intended to challenge the series proposed by Daniel 
(https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=98106) 
but nothing happened.
- It was conflicting with the ongoing changes for implementing KASAN.

What you will have to do is to define prom_strlcat() in the same spirit 
as https://patchwork.ozlabs.org/patch/1091621/ by copying it from 
lib/string.c and I think you'll be able to drop prom_strlcpy() as that 
function what only used there.

Christophe

> 
>> Christophe
>>
>>>
>>>    1 file changed, 12 insertions(+)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index d8dcd8820369..cd9b3974aa36 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -851,6 +851,11 @@ config CMDLINE
>>>    	  some command-line options at build time by entering
>>> them here.  In
>>>    	  most cases you will need to specify the root device
>>> here.
>>>    
>>> +choice
>>> +	prompt "Kernel command line type" if CMDLINE != ""
>>> +	default CMDLINE_FORCE
>>> +	depends on CMDLINE_BOOL
>>> +
>>>    config CMDLINE_FORCE
>>>    	bool "Always use the default kernel command string"
>>>    	depends on CMDLINE_BOOL
>>> @@ -860,6 +865,13 @@ config CMDLINE_FORCE
>>>    	  This is useful if you cannot or don't want to change
>>> the
>>>    	  command-line options your boot loader passes to the
>>> kernel.
>>>    
>>> +config CMDLINE_EXTEND
>>> +	bool "Extend bootloader kernel arguments"
>>> +	help
>>> +	  The command-line arguments provided by the boot loader
>>> will be
>>> +	  appended to the default kernel command string.
>>> +endchoice
>>> +
>>>    config EXTRA_TARGETS
>>>    	string "Additional default image types"
>>>    	help

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

* Re: [PATCH] powerpc: Support CMDLINE_EXTEND
  2019-07-31  7:23     ` Christophe Leroy
@ 2019-08-01  0:14       ` Chris Packham
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Packham @ 2019-08-01  0:14 UTC (permalink / raw)
  To: christophe.leroy, paulus, mpe, benh; +Cc: linuxppc-dev, linux-kernel

On Wed, 2019-07-31 at 09:23 +0200, Christophe Leroy wrote:
> 
> Le 30/07/2019 à 23:10, Chris Packham a écrit :
> > 
> > Hi Christophe,
> > 
> > On Tue, 2019-07-30 at 09:02 +0200, Christophe Leroy wrote:
> > > 
> > > 
> > > Le 24/07/2019 à 07:33, Chris Packham a écrit :
> > > > 
> > > > 
> > > > Device tree aware platforms can make use of CMDLINE_EXTEND to
> > > > extend the
> > > > kernel command line provided by the bootloader. This is
> > > > particularly
> > > > useful to set parameters for built-in modules that would
> > > > otherwise
> > > > be
> > > > done at module insertion. Add support for this in the powerpc
> > > > architecture.
> > > > 
> > > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz
> > > > >
> > > > ---
> > > >    arch/powerpc/Kconfig | 12 ++++++++++++
> > > I think you also have to implement some stuff in
> > > early_cmdline_parse()
> > > in arch/powerpc/kernel/prom_init.c
> > I my case I didn't need to since the generic code
> > in drivers/of/fdt.c
> > did what I need. For early options or platforms that don't use a
> > device
> > tree then I can see why I'd need the update to update to prom_init.
> > 
> > > 
> > > 
> > > Maybe look at https://patchwork.ozlabs.org/patch/1074126/
> > > 
> > Do you mind if I take this and fold it into a v2 of my patch? Any
> > particular reason it didn't get picked up in April?
> Sure, take it, I don't mind.
> 
> Two reasons it was not picked up in April I believe:
> - It was part of a larger series 
> (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=10051
> 8) 
> and was intended to challenge the series proposed by Daniel 
> (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=98106
> ) 
> but nothing happened.
> - It was conflicting with the ongoing changes for implementing KASAN.
> 
> What you will have to do is to define prom_strlcat() in the same
> spirit 
> as https://patchwork.ozlabs.org/patch/1091621/ by copying it from 
> lib/string.c and 

Is it OK to use BUG_ON in prom_init? If I copy it verbatim then the
code from lib/string.c has a BUG_ON. I could probably change that to
if(x) return -1 if BUG_ON is not appropriate.

> I think you'll be able to drop prom_strlcpy() as that 
> function what only used there.

I think I need to keep prom_strlcpy to handle the CMDLINE_FORCE case.

> 
> Christophe
> 
> > 
> > 
> > > 
> > > Christophe
> > > 
> > > > 
> > > > 
> > > >    1 file changed, 12 insertions(+)
> > > > 
> > > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > > > index d8dcd8820369..cd9b3974aa36 100644
> > > > --- a/arch/powerpc/Kconfig
> > > > +++ b/arch/powerpc/Kconfig
> > > > @@ -851,6 +851,11 @@ config CMDLINE
> > > >    	  some command-line options at build time by
> > > > entering
> > > > them here.  In
> > > >    	  most cases you will need to specify the root
> > > > device
> > > > here.
> > > >    
> > > > +choice
> > > > +	prompt "Kernel command line type" if CMDLINE != ""
> > > > +	default CMDLINE_FORCE
> > > > +	depends on CMDLINE_BOOL
> > > > +
> > > >    config CMDLINE_FORCE
> > > >    	bool "Always use the default kernel command string"
> > > >    	depends on CMDLINE_BOOL
> > > > @@ -860,6 +865,13 @@ config CMDLINE_FORCE
> > > >    	  This is useful if you cannot or don't want to
> > > > change
> > > > the
> > > >    	  command-line options your boot loader passes to
> > > > the
> > > > kernel.
> > > >    
> > > > +config CMDLINE_EXTEND
> > > > +	bool "Extend bootloader kernel arguments"
> > > > +	help
> > > > +	  The command-line arguments provided by the boot
> > > > loader
> > > > will be
> > > > +	  appended to the default kernel command string.
> > > > +endchoice
> > > > +
> > > >    config EXTRA_TARGETS
> > > >    	string "Additional default image types"
> > > >    	help

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

end of thread, other threads:[~2019-08-01  0:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  5:33 [PATCH] powerpc: Support CMDLINE_EXTEND Chris Packham
2019-07-24  5:33 ` Chris Packham
2019-07-30  7:02 ` Christophe Leroy
2019-07-30 21:10   ` Chris Packham
2019-07-31  7:23     ` Christophe Leroy
2019-08-01  0:14       ` Chris Packham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.