public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sean Rhodes" <sean@starlabs.systems>
To: devel@edk2.groups.io
Cc: guo.dong@intel.com, Matt DeVillier <matt.devillier@gmail.com>,
	Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Sean Rhodes <sean@starlabs.systems>
Subject: [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal
Date: Fri, 11 Feb 2022 08:05:21 +0000	[thread overview]
Message-ID: <793abb11501c3fe8d4b8c82267cb9a30bcfa9c3a.1644566720.git.sean@starlabs.systems> (raw)

From: Matt DeVillier <matt.devillier@gmail.com>

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 <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 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/MdeModulePkg/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 (
     //
     mWaitForValueTimeOut = KEYBOARD_BAT_TIMEOUT;
 
-    Status = KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
-    if (EFI_ERROR (Status)) {
-      KeyboardError (ConsoleIn, L"Keyboard self test failed!\n\r");
-      goto Done;
-    }
+    KeyboardWaitForValue (ConsoleIn, KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
 
     mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
 
diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h b/MdeModulePkg/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
 #define KEYBOARD_TIMEOUT                 65536   // 0.07s
 #define KEYBOARD_WAITFORVALUE_TIMEOUT    1000000 // 1s
-#define KEYBOARD_BAT_TIMEOUT             4000000 // 4s
+#define KEYBOARD_BAT_TIMEOUT             1000000 // 1s
 #define KEYBOARD_TIMER_INTERVAL          200000  // 0.02s
 #define SCANCODE_EXTENDED0               0xE0
 #define SCANCODE_EXTENDED1               0xE1
-- 
2.32.0


             reply	other threads:[~2022-02-11  8:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11  8:05 Sean Rhodes [this message]
2022-02-18  2:16 ` [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal Wu, Hao A
2022-03-16 22:28   ` Sean Rhodes
2022-05-17 12:10     ` Sheng Lean Tan
2022-10-10  7:36       ` Sheng Lean Tan
2022-10-10  8:29 ` Ni, Ray
2022-10-11  8:50   ` Sheng Lean Tan
2022-10-25  2:48     ` Sheng Lean Tan
2022-10-25  6:04       ` Ni, Ray
2022-10-25  7:25         ` Sean Rhodes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=793abb11501c3fe8d4b8c82267cb9a30bcfa9c3a.1644566720.git.sean@starlabs.systems \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox