]> www.infradead.org Git - nvme.git/commitdiff
x86/early_printk: Use 'mmio32' for consistency, fix comments
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 7 Apr 2025 17:22:14 +0000 (20:22 +0300)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 Apr 2025 10:27:08 +0000 (12:27 +0200)
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
arch/x86/kernel/early_printk.c

index 76e538c77e31615c9cd6a650bb8a72ead14b8008..d9fd26b95b340909101b80ab4b22a6bbd3d20ab6 100644 (file)
                        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.
 
index 611f27e3890c2852cece31a9e948e7212c4e10fe..3aad78bfcb267feaec3a080c2b69955a4282c507 100644 (file)
@@ -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) &&