[SeaBIOS] [PATCH 8/9] acpi: skip kbd init if not present

Gerd Hoffmann posted 9 patches 5 years, 8 months ago
There is a newer version of this series
[SeaBIOS] [PATCH 8/9] acpi: skip kbd init if not present
Posted by Gerd Hoffmann 5 years, 8 months ago
Don't initialize the ps/2 keyboard in case the device is not
listed in the ACPi DSDT table.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/hw/ps2port.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/hw/ps2port.c b/src/hw/ps2port.c
index 2c334c06b7eb..c82521b42e16 100644
--- a/src/hw/ps2port.c
+++ b/src/hw/ps2port.c
@@ -542,6 +542,10 @@ ps2port_setup(void)
     ASSERT32FLAT();
     if (! CONFIG_PS2PORT)
         return;
+    if (acpi_dsdt_present_eisaid(0x0303) == 0) {
+        dprintf(1, "ACPI: no PS/2 keyboard present\n");
+        return;
+    }
     dprintf(3, "init ps2port\n");
 
     enable_hwirq(1, FUNC16(entry_09));
-- 
2.18.2
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH 8/9] acpi: skip kbd init if not present
Posted by Kevin O'Connor 5 years, 8 months ago
On Fri, Apr 03, 2020 at 10:31:20AM +0200, Gerd Hoffmann wrote:
> Don't initialize the ps/2 keyboard in case the device is not
> listed in the ACPi DSDT table.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  src/hw/ps2port.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/hw/ps2port.c b/src/hw/ps2port.c
> index 2c334c06b7eb..c82521b42e16 100644
> --- a/src/hw/ps2port.c
> +++ b/src/hw/ps2port.c
> @@ -542,6 +542,10 @@ ps2port_setup(void)
>      ASSERT32FLAT();
>      if (! CONFIG_PS2PORT)
>          return;
> +    if (acpi_dsdt_present_eisaid(0x0303) == 0) {
> +        dprintf(1, "ACPI: no PS/2 keyboard present\n");
> +        return;
> +    }

Unless I'm missing something, if the dsdt parser is enabled, but the
dsdt is not actually found, this would turn off the keyboard.  I think
it should only disable the keyboard detection if the dsdt is actually
found and doesn't contain a ps2 port entry.

-Kevin


>      dprintf(3, "init ps2port\n");
>  
>      enable_hwirq(1, FUNC16(entry_09));
> -- 
> 2.18.2
> _______________________________________________
> SeaBIOS mailing list -- seabios@seabios.org
> To unsubscribe send an email to seabios-leave@seabios.org
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH 8/9] acpi: skip kbd init if not present
Posted by Gerd Hoffmann 5 years, 8 months ago
On Mon, Apr 06, 2020 at 07:26:07PM -0400, Kevin O'Connor wrote:
> On Fri, Apr 03, 2020 at 10:31:20AM +0200, Gerd Hoffmann wrote:
> > Don't initialize the ps/2 keyboard in case the device is not
> > listed in the ACPi DSDT table.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  src/hw/ps2port.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/src/hw/ps2port.c b/src/hw/ps2port.c
> > index 2c334c06b7eb..c82521b42e16 100644
> > --- a/src/hw/ps2port.c
> > +++ b/src/hw/ps2port.c
> > @@ -542,6 +542,10 @@ ps2port_setup(void)
> >      ASSERT32FLAT();
> >      if (! CONFIG_PS2PORT)
> >          return;
> > +    if (acpi_dsdt_present_eisaid(0x0303) == 0) {
> > +        dprintf(1, "ACPI: no PS/2 keyboard present\n");
> > +        return;
> > +    }
> 
> Unless I'm missing something, if the dsdt parser is enabled, but the
> dsdt is not actually found, this would turn off the keyboard.

Correct, didn't consider that corner case.  Will fix.

take care,
  Gerd
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org