From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.ixn.mail.zen.net.uk (smarthost01b.ixn.mail.zen.net.uk [212.23.1.21]) by mx.groups.io with SMTP id smtpd.web09.4756.1644566728582791870 for ; Fri, 11 Feb 2022 00:05:29 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.21, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=sean-StarBook.lan) by smarthost01b.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nIQvk-0001A3-37; Fri, 11 Feb 2022 08:05:24 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Matt DeVillier , Hao A Wu , Ray Ni , Sean Rhodes Subject: [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal Date: Fri, 11 Feb 2022 08:05:21 +0000 Message-Id: <793abb11501c3fe8d4b8c82267cb9a30bcfa9c3a.1644566720.git.sean@starlabs.systems> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier Recent model Chromebooks only return ACK, but not BAT_SUCCESS, which causes hanging and failed ps2k init. To mitigate this, make the absence of BAT_SUCCESS reply non-fatal, and reduce the no-reply timeout from 4s to 1s. Tested on google/dracia and purism/librem_14 Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Matt DeVillier Signed-off-by: Sean Rhodes --- MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 6 +----- MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModul= ePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c index 77dc226222..6c71355edd 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c @@ -1733,11 +1733,7 @@ InitKeyboard ( //=0D mWaitForValueTimeOut =3D KEYBOARD_BAT_TIMEOUT;=0D =0D - Status =3D KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_= BAT_SUCCESS);=0D - if (EFI_ERROR (Status)) {=0D - KeyboardError (ConsoleIn, L"Keyboard self test failed!\n\r");=0D - goto Done;=0D - }=0D + KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_BAT_SUCCESS= );=0D =0D mWaitForValueTimeOut =3D KEYBOARD_WAITFORVALUE_TIMEOUT;=0D =0D diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h b/MdeModuleP= kg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h index ca1dd9b2c2..38df3e092d 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h @@ -157,7 +157,7 @@ InstallPs2KeyboardDriver ( #define KEYBOARD_MAX_TRY 256 // 256=0D #define KEYBOARD_TIMEOUT 65536 // 0.07s=0D #define KEYBOARD_WAITFORVALUE_TIMEOUT 1000000 // 1s=0D -#define KEYBOARD_BAT_TIMEOUT 4000000 // 4s=0D +#define KEYBOARD_BAT_TIMEOUT 1000000 // 1s=0D #define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s=0D #define SCANCODE_EXTENDED0 0xE0=0D #define SCANCODE_EXTENDED1 0xE1=0D --=20 2.32.0