linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency
@ 2025-04-07 17:22 Andy Shevchenko
  2025-04-09 10:23 ` Ingo Molnar
  2025-04-09 11:44 ` [tip: x86/urgent] x86/early_printk: Use 'mmio32' for consistency, fix comments tip-bot2 for Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2025-04-07 17:22 UTC (permalink / raw)
  To: linux-doc, linux-kernel
  Cc: Jonathan Corbet, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Andy Shevchenko

First of all, using 'mmio' prevents proper implementation of 8-bit accessors.
Second, it's simply inconsistent with uart8250 set of options. Rename it to
'mmio32'. While at it, remove rather misleading comment in the documentation.
From now on mmio32 is self-explanatory and pciserial supports not only 32-bit
MMIO accessors.

Fixes: 3181424aeac2 ("x86/early_printk: Add support for MMIO-based UARTs")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 5 +----
 arch/x86/kernel/early_printk.c                  | 6 +++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 76e538c77e31..d9fd26b95b34 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1407,18 +1407,15 @@
 			earlyprintk=serial[,0x...[,baudrate]]
 			earlyprintk=ttySn[,baudrate]
 			earlyprintk=dbgp[debugController#]
+			earlyprintk=mmio32,membase[,{nocfg|baudrate}]
 			earlyprintk=pciserial[,force],bus:device.function[,{nocfg|baudrate}]
 			earlyprintk=xdbc[xhciController#]
 			earlyprintk=bios
-			earlyprintk=mmio,membase[,{nocfg|baudrate}]
 
 			earlyprintk is useful when the kernel crashes before
 			the normal console is initialized. It is not enabled by
 			default because it has some cosmetic problems.
 
-			Only 32-bit memory addresses are supported for "mmio"
-			and "pciserial" devices.
-
 			Use "nocfg" to skip UART configuration, assume
 			BIOS/firmware has configured UART correctly.
 
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index b70e6e99fb17..dc053641698c 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -424,10 +424,10 @@ static int __init setup_early_printk(char *buf)
 	keep = (strstr(buf, "keep") != NULL);
 
 	while (*buf != '\0') {
-		if (!strncmp(buf, "mmio", 4)) {
-			early_mmio_serial_init(buf + 4);
+		if (!strncmp(buf, "mmio32", 6)) {
+			buf += 6;
+			early_mmio_serial_init(buf);
 			early_console_register(&early_serial_console, keep);
-			buf += 4;
 		}
 		if (!strncmp(buf, "serial", 6)) {
 			buf += 6;
-- 
2.47.2


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

* Re: [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency
@ 2025-04-08 20:46 dmkhn
  0 siblings, 0 replies; 4+ messages in thread
From: dmkhn @ 2025-04-08 20:46 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-doc, linux-kernel, Jonathan Corbet, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin

On Mon, Apr 07, 2025 at 08:22:14PM +0300, Andy Shevchenko wrote:
> First of all, using 'mmio' prevents proper implementation of 8-bit accessors.
> Second, it's simply inconsistent with uart8250 set of options. Rename it to
> 'mmio32'. While at it, remove rather misleading comment in the documentation.
> >From now on mmio32 is self-explanatory and pciserial supports not only 32-bit
> MMIO accessors.
> 
> Fixes: 3181424aeac2 ("x86/early_printk: Add support for MMIO-based UARTs")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Denis Mukhin <dmukhin@ford.com>

> ---
>  Documentation/admin-guide/kernel-parameters.txt | 5 +----
>  arch/x86/kernel/early_printk.c                  | 6 +++---
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 76e538c77e31..d9fd26b95b34 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -1407,18 +1407,15 @@
>  			earlyprintk=serial[,0x...[,baudrate]]
>  			earlyprintk=ttySn[,baudrate]
>  			earlyprintk=dbgp[debugController#]
> +			earlyprintk=mmio32,membase[,{nocfg|baudrate}]
>  			earlyprintk=pciserial[,force],bus:device.function[,{nocfg|baudrate}]
>  			earlyprintk=xdbc[xhciController#]
>  			earlyprintk=bios
> -			earlyprintk=mmio,membase[,{nocfg|baudrate}]
>  
>  			earlyprintk is useful when the kernel crashes before
>  			the normal console is initialized. It is not enabled by
>  			default because it has some cosmetic problems.
>  
> -			Only 32-bit memory addresses are supported for "mmio"
> -			and "pciserial" devices.
> -
>  			Use "nocfg" to skip UART configuration, assume
>  			BIOS/firmware has configured UART correctly.
>  
> diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
> index b70e6e99fb17..dc053641698c 100644
> --- a/arch/x86/kernel/early_printk.c
> +++ b/arch/x86/kernel/early_printk.c
> @@ -424,10 +424,10 @@ static int __init setup_early_printk(char *buf)
>  	keep = (strstr(buf, "keep") != NULL);
>  
>  	while (*buf != '\0') {
> -		if (!strncmp(buf, "mmio", 4)) {
> -			early_mmio_serial_init(buf + 4);
> +		if (!strncmp(buf, "mmio32", 6)) {
> +			buf += 6;
> +			early_mmio_serial_init(buf);
>  			early_console_register(&early_serial_console, keep);
> -			buf += 4;
>  		}
>  		if (!strncmp(buf, "serial", 6)) {
>  			buf += 6;
> -- 
> 2.47.2
> 


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

* Re: [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency
  2025-04-07 17:22 [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency Andy Shevchenko
@ 2025-04-09 10:23 ` Ingo Molnar
  2025-04-09 11:44 ` [tip: x86/urgent] x86/early_printk: Use 'mmio32' for consistency, fix comments tip-bot2 for Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2025-04-09 10:23 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-doc, linux-kernel, Jonathan Corbet, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin


* Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> First of all, using 'mmio' prevents proper implementation of 8-bit accessors.
> Second, it's simply inconsistent with uart8250 set of options. Rename it to
> 'mmio32'. While at it, remove rather misleading comment in the documentation.
> From now on mmio32 is self-explanatory and pciserial supports not only 32-bit
> MMIO accessors.
> 
> Fixes: 3181424aeac2 ("x86/early_printk: Add support for MMIO-based UARTs")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 5 +----
>  arch/x86/kernel/early_printk.c                  | 6 +++---
>  2 files changed, 4 insertions(+), 7 deletions(-)

Thank you for taking care of this, I've queued these fixes in tip:x86/urgent.

	Ingo

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

* [tip: x86/urgent] x86/early_printk: Use 'mmio32' for consistency, fix comments
  2025-04-07 17:22 [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency Andy Shevchenko
  2025-04-09 10:23 ` Ingo Molnar
@ 2025-04-09 11:44 ` tip-bot2 for Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Andy Shevchenko @ 2025-04-09 11:44 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Andy Shevchenko, Ingo Molnar, Denis Mukhin, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     996457176bb7c64b3d30996592c754205ec4d3ea
Gitweb:        https://git.kernel.org/tip/996457176bb7c64b3d30996592c754205ec4d3ea
Author:        Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate:    Mon, 07 Apr 2025 20:22:14 +03:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 09 Apr 2025 12:27:08 +02:00

x86/early_printk: Use 'mmio32' for consistency, fix comments

First of all, using 'mmio' prevents proper implementation of 8-bit accessors.
Second, it's simply inconsistent with uart8250 set of options. Rename it to
'mmio32'. While at it, remove rather misleading comment in the documentation.
>From now on mmio32 is self-explanatory and pciserial supports not only 32-bit
MMIO accessors.

Also, while at it, fix the comment for the "pciserial" case. The comment
seems to be a copy'n'paste error when mentioning "serial" instead of
"pciserial" (with double quotes). Fix this.

With that, move it upper, so we don't calculate 'buf' twice.

Fixes: 3181424aeac2 ("x86/early_printk: Add support for MMIO-based UARTs")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Denis Mukhin <dmukhin@ford.com>
Link: https://lore.kernel.org/r/20250407172214.792745-1-andriy.shevchenko@linux.intel.com
---
 Documentation/admin-guide/kernel-parameters.txt |  5 +----
 arch/x86/kernel/early_printk.c                  | 10 +++++-----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 76e538c..d9fd26b 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1407,18 +1407,15 @@
 			earlyprintk=serial[,0x...[,baudrate]]
 			earlyprintk=ttySn[,baudrate]
 			earlyprintk=dbgp[debugController#]
+			earlyprintk=mmio32,membase[,{nocfg|baudrate}]
 			earlyprintk=pciserial[,force],bus:device.function[,{nocfg|baudrate}]
 			earlyprintk=xdbc[xhciController#]
 			earlyprintk=bios
-			earlyprintk=mmio,membase[,{nocfg|baudrate}]
 
 			earlyprintk is useful when the kernel crashes before
 			the normal console is initialized. It is not enabled by
 			default because it has some cosmetic problems.
 
-			Only 32-bit memory addresses are supported for "mmio"
-			and "pciserial" devices.
-
 			Use "nocfg" to skip UART configuration, assume
 			BIOS/firmware has configured UART correctly.
 
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 611f27e..3aad78b 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -389,10 +389,10 @@ static int __init setup_early_printk(char *buf)
 	keep = (strstr(buf, "keep") != NULL);
 
 	while (*buf != '\0') {
-		if (!strncmp(buf, "mmio", 4)) {
-			early_mmio_serial_init(buf + 4);
+		if (!strncmp(buf, "mmio32", 6)) {
+			buf += 6;
+			early_mmio_serial_init(buf);
 			early_console_register(&early_serial_console, keep);
-			buf += 4;
 		}
 		if (!strncmp(buf, "serial", 6)) {
 			buf += 6;
@@ -407,9 +407,9 @@ static int __init setup_early_printk(char *buf)
 		}
 #ifdef CONFIG_PCI
 		if (!strncmp(buf, "pciserial", 9)) {
-			early_pci_serial_init(buf + 9);
+			buf += 9; /* Keep from match the above "pciserial" */
+			early_pci_serial_init(buf);
 			early_console_register(&early_serial_console, keep);
-			buf += 9; /* Keep from match the above "serial" */
 		}
 #endif
 		if (!strncmp(buf, "vga", 3) &&

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

end of thread, other threads:[~2025-04-09 11:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 17:22 [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency Andy Shevchenko
2025-04-09 10:23 ` Ingo Molnar
2025-04-09 11:44 ` [tip: x86/urgent] x86/early_printk: Use 'mmio32' for consistency, fix comments tip-bot2 for Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2025-04-08 20:46 [PATCH v1 1/1] x86/early_printk: Use 'mmio32' for consistency dmkhn

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