Skip to contentSkip to conversation

term/serial: Continue processing SPCR table even if revision is < 2

PATCH In review Glenn Washburn 3 participants 4 messages Jul 26, 2023 – Aug 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 term/serial: Continue processing SPCR table even if revision is < 2

According to commit 0231d00082 ("ACPI: SPCR: Make SPCR available to x86") to the Linux kernel, "On x86, many systems have a valid SPCR table but the table version is not 2 so the table version check must be a warning."

---
 grub-core/term/ns8250-spcr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
grub-core/term/ns8250-spcr.c +3 -1
index d101bffb512d..d52b52c26561 100644
@@ -18,6 +18,7 @@
 
 #if !defined(GRUB_MACHINE_IEEE1275) && !defined(GRUB_MACHINE_QEMU)
 
+#include <grub/misc.h>
 #include <grub/serial.h>
 #include <grub/ns8250.h>
 #include <grub/types.h>
@@ -34,7 +35,8 @@ grub_ns8250_spcr_init (void)
   if (spcr == NULL)
     return NULL;
   if (spcr->hdr.revision < 2)
-    return NULL;
+    grub_dprintf ("serial", "SPCR table revision %d < 2, continuing anyway\n",
+		  (int) spcr->hdr.revision);
   if (spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550 &&
       spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550X)
     return NULL;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 7 lines · Glenn Washburn

According to commit 0231d00082 ("ACPI: SPCR: Make SPCR available to x86")
to the Linux kernel, "On x86, many systems have a valid SPCR table but the
table version is not 2 so the table version check must be a warning."

Note: We should also start using the new UART clock field when available (rev 3 or later) and precise baud rate (rev 4)

Cheers,
Ben.

Quoted 28 lines

---
 grub-core/term/ns8250-spcr.c | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
grub-core/term/ns8250- renamed from grub-core/term/ns8250-spcr.c +0 -0

spcr.c
index d101bffb512d..d52b52c26561 100644

grub-core/term/ns8250-spcr.c +0 -0
@@ -18,6 +18,7 @@


 #if !defined(GRUB_MACHINE_IEEE1275) && !defined(GRUB_MACHINE_QEMU)
+#include <grub/misc.h>
 #include <grub/serial.h>
 #include <grub/ns8250.h>
 #include <grub/types.h>

grub-core/term/ns8250-spcr.c +2 -1
@@ -34,7 +35,8 @@ grub_ns8250_spcr_init (void)
    if (spcr == NULL)
      return NULL;
    if (spcr->hdr.revision < 2)
-    return NULL;
+    grub_dprintf ("serial", "SPCR table revision %d < 2, continuing
 anyway\n",
+                 (int) spcr->hdr.revision);

   if (spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550 && spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550X) return NULL;

Reviewed-by
#2 lore raw
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 7 lines · Glenn Washburn

According to commit 0231d00082 ("ACPI: SPCR: Make SPCR available to x86")
to the Linux kernel, "On x86, many systems have a valid SPCR table but the
table version is not 2 so the table version check must be a warning."

Quoted 2 lines

Note: We should also start using the new UART clock field when available (rev 3 or later) and precise baud rate (rev 4)

I think these should not be big changes. If you could make patches soon then I would be willing include them in the upcoming GRUB release.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw
Quoted 12 lines · Daniel Kiper
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 7 lines · Glenn Washburn

According to commit 0231d00082 ("ACPI: SPCR: Make SPCR available to x86")
to the Linux kernel, "On x86, many systems have a valid SPCR table but the
table version is not 2 so the table version check must be a warning."

Quoted 7 lines
Quoted 2 lines

Note: We should also start using the new UART clock field when available (rev 3 or later) and precise baud rate (rev 4)

I think these should not be big changes. If you could make patches soon then I would be willing include them in the upcoming GRUB release.

I would be but I lack a firmware providing that information to test with...

Anybody has that ?

Cheers,
Ben.

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel