* [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
@ 2021-03-08 23:53 ` Daniel Walker
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Walker @ 2021-03-08 23:53 UTC (permalink / raw)
To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, Rob Herring,
Frank Rowand
Cc: xe-linux-external, Ruslan Ruslichenko, devicetree, linux-kernel
It looks like there's some seepage of cmdline stuff into
the generic device tree code. This conflicts with the
generic cmdline implementation so I remove it in the case
when that's enabled.
Cc: xe-linux-external@cisco.com
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
drivers/of/fdt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..e25240d84632 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -25,6 +25,7 @@
#include <linux/serial_core.h>
#include <linux/sysfs.h>
#include <linux/random.h>
+#include <linux/cmdline.h>
#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
#include <asm/page.h>
@@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
/* Retrieve command line */
p = of_get_flat_dt_prop(node, "bootargs", &l);
+
+#ifdef CONFIG_GENERIC_CMDLINE
+ /*
+ * The builtin command line will be added here, or it can override
+ * with the DT bootargs.
+ */
+ cmdline_add_builtin(data,
+ (l > 0 ? p : NULL), /* This is sanity checking */
+ COMMAND_LINE_SIZE);
+#else
if (p != NULL && l > 0)
strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
@@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif /* CONFIG_CMDLINE */
+#endif /* CONFIG_GENERIC_CMDLINE */
pr_debug("Command line is: %s\n", (char *)data);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
@ 2021-03-08 23:53 ` Daniel Walker
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Walker @ 2021-03-08 23:53 UTC (permalink / raw)
To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, Rob Herring,
Frank Rowand
Cc: devicetree, Ruslan Ruslichenko, linux-kernel, xe-linux-external
It looks like there's some seepage of cmdline stuff into
the generic device tree code. This conflicts with the
generic cmdline implementation so I remove it in the case
when that's enabled.
Cc: xe-linux-external@cisco.com
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
drivers/of/fdt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..e25240d84632 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -25,6 +25,7 @@
#include <linux/serial_core.h>
#include <linux/sysfs.h>
#include <linux/random.h>
+#include <linux/cmdline.h>
#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
#include <asm/page.h>
@@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
/* Retrieve command line */
p = of_get_flat_dt_prop(node, "bootargs", &l);
+
+#ifdef CONFIG_GENERIC_CMDLINE
+ /*
+ * The builtin command line will be added here, or it can override
+ * with the DT bootargs.
+ */
+ cmdline_add_builtin(data,
+ (l > 0 ? p : NULL), /* This is sanity checking */
+ COMMAND_LINE_SIZE);
+#else
if (p != NULL && l > 0)
strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
@@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif /* CONFIG_CMDLINE */
+#endif /* CONFIG_GENERIC_CMDLINE */
pr_debug("Command line is: %s\n", (char *)data);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
2021-03-09 0:02 ` Daniel Walker
@ 2021-03-09 7:36 ` Christophe Leroy
-1 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2021-03-09 7:36 UTC (permalink / raw)
To: Daniel Walker, Will Deacon, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, xe-linux-external,
Rob Herring, Frank Rowand
Cc: Ruslan Ruslichenko, devicetree, linux-kernel
Le 09/03/2021 à 01:02, Daniel Walker a écrit :
> It looks like there's some seepage of cmdline stuff into
> the generic device tree code. This conflicts with the
> generic cmdline implementation so I remove it in the case
> when that's enabled.
>
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
> drivers/of/fdt.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index feb0f2d67fc5..e25240d84632 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -25,6 +25,7 @@
> #include <linux/serial_core.h>
> #include <linux/sysfs.h>
> #include <linux/random.h>
> +#include <linux/cmdline.h>
>
> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> #include <asm/page.h>
> @@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>
> /* Retrieve command line */
> p = of_get_flat_dt_prop(node, "bootargs", &l);
> +
> +#ifdef CONFIG_GENERIC_CMDLINE
> + /*
> + * The builtin command line will be added here, or it can override
> + * with the DT bootargs.
> + */
> + cmdline_add_builtin(data,
> + (l > 0 ? p : NULL), /* This is sanity checking */
> + COMMAND_LINE_SIZE);
I don't think the comment is needed.
Without the comment, it should fit on a single line, would be better for readability and grepability.
> +#else
> if (p != NULL && l > 0)
> strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
>
> @@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> #endif
> #endif /* CONFIG_CMDLINE */
> +#endif /* CONFIG_GENERIC_CMDLINE */
>
> pr_debug("Command line is: %s\n", (char *)data);
>
>
Christophe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
@ 2021-03-09 7:36 ` Christophe Leroy
0 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2021-03-09 7:36 UTC (permalink / raw)
To: Daniel Walker, Will Deacon, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, xe-linux-external,
Rob Herring, Frank Rowand
Cc: devicetree, Ruslan Ruslichenko, linux-kernel
Le 09/03/2021 à 01:02, Daniel Walker a écrit :
> It looks like there's some seepage of cmdline stuff into
> the generic device tree code. This conflicts with the
> generic cmdline implementation so I remove it in the case
> when that's enabled.
>
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
> drivers/of/fdt.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index feb0f2d67fc5..e25240d84632 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -25,6 +25,7 @@
> #include <linux/serial_core.h>
> #include <linux/sysfs.h>
> #include <linux/random.h>
> +#include <linux/cmdline.h>
>
> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> #include <asm/page.h>
> @@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
>
> /* Retrieve command line */
> p = of_get_flat_dt_prop(node, "bootargs", &l);
> +
> +#ifdef CONFIG_GENERIC_CMDLINE
> + /*
> + * The builtin command line will be added here, or it can override
> + * with the DT bootargs.
> + */
> + cmdline_add_builtin(data,
> + (l > 0 ? p : NULL), /* This is sanity checking */
> + COMMAND_LINE_SIZE);
I don't think the comment is needed.
Without the comment, it should fit on a single line, would be better for readability and grepability.
> +#else
> if (p != NULL && l > 0)
> strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
>
> @@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
> strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
> #endif
> #endif /* CONFIG_CMDLINE */
> +#endif /* CONFIG_GENERIC_CMDLINE */
>
> pr_debug("Command line is: %s\n", (char *)data);
>
>
Christophe
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
@ 2021-03-09 0:02 ` Daniel Walker
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Walker @ 2021-03-09 0:02 UTC (permalink / raw)
To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, xe-linux-external,
Rob Herring, Frank Rowand
Cc: Ruslan Ruslichenko, devicetree, linux-kernel
It looks like there's some seepage of cmdline stuff into
the generic device tree code. This conflicts with the
generic cmdline implementation so I remove it in the case
when that's enabled.
Cc: xe-linux-external@cisco.com
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
drivers/of/fdt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..e25240d84632 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -25,6 +25,7 @@
#include <linux/serial_core.h>
#include <linux/sysfs.h>
#include <linux/random.h>
+#include <linux/cmdline.h>
#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
#include <asm/page.h>
@@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
/* Retrieve command line */
p = of_get_flat_dt_prop(node, "bootargs", &l);
+
+#ifdef CONFIG_GENERIC_CMDLINE
+ /*
+ * The builtin command line will be added here, or it can override
+ * with the DT bootargs.
+ */
+ cmdline_add_builtin(data,
+ (l > 0 ? p : NULL), /* This is sanity checking */
+ COMMAND_LINE_SIZE);
+#else
if (p != NULL && l > 0)
strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
@@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif /* CONFIG_CMDLINE */
+#endif /* CONFIG_GENERIC_CMDLINE */
pr_debug("Command line is: %s\n", (char *)data);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section
@ 2021-03-09 0:02 ` Daniel Walker
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Walker @ 2021-03-09 0:02 UTC (permalink / raw)
To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
Andrew Morton, x86, linux-mips, linuxppc-dev, xe-linux-external,
Rob Herring, Frank Rowand
Cc: devicetree, Ruslan Ruslichenko, linux-kernel
It looks like there's some seepage of cmdline stuff into
the generic device tree code. This conflicts with the
generic cmdline implementation so I remove it in the case
when that's enabled.
Cc: xe-linux-external@cisco.com
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
drivers/of/fdt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..e25240d84632 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -25,6 +25,7 @@
#include <linux/serial_core.h>
#include <linux/sysfs.h>
#include <linux/random.h>
+#include <linux/cmdline.h>
#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
#include <asm/page.h>
@@ -1050,6 +1051,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
/* Retrieve command line */
p = of_get_flat_dt_prop(node, "bootargs", &l);
+
+#ifdef CONFIG_GENERIC_CMDLINE
+ /*
+ * The builtin command line will be added here, or it can override
+ * with the DT bootargs.
+ */
+ cmdline_add_builtin(data,
+ (l > 0 ? p : NULL), /* This is sanity checking */
+ COMMAND_LINE_SIZE);
+#else
if (p != NULL && l > 0)
strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
@@ -1070,6 +1081,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif /* CONFIG_CMDLINE */
+#endif /* CONFIG_GENERIC_CMDLINE */
pr_debug("Command line is: %s\n", (char *)data);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-09 7:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 23:53 [PATCH v2 2/7] CMDLINE: drivers: of: ifdef out cmdline section Daniel Walker
2021-03-08 23:53 ` Daniel Walker
2021-03-09 0:02 Daniel Walker
2021-03-09 0:02 ` Daniel Walker
2021-03-09 7:36 ` Christophe Leroy
2021-03-09 7:36 ` Christophe Leroy
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.