From nobody Sun Nov 24 14:42:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+86611+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86611+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1644566731; cv=none; d=zohomail.com; s=zohoarc; b=UC7pAeUrOXL5jTwoqXfntvzhi54TKemK6XFhKWyxlGIuZqg58ZPJq7F0cvTPs/nKR4lZXamduveQi2JNhDEe3JCvJg6k7+dxdFTec5eCBeWTHm0tqDC6fxy+iv14uDMkz9hr/3Lg0NphFV/DJoNjyTywqdcoC5SWBvzyDGPbgT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644566731; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=V+1pBf2SCfe6J5uuHLX20eJ5avuZ15gx0ehmOTB8q9Y=; b=gTgE8BNlfXL85wyWntH6Eo/tWhaNLNRdvTFY0rRMg0qyGX8rFf70DJVKZESuuCpN9MoXBpUj4nxYRCYudbCKcu0fFrOXJPPJPq1QEQYlvI+rjMFjQ3Zi8fd2QgYYIVduK/m9ikJDEB+wCY4qVDKwGI6ZE8ACIyabAZVDdYmKhL8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86611+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1644566731506511.86100240056805; Fri, 11 Feb 2022 00:05:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6KMRYY1788612xGTYwB7trI4; Fri, 11 Feb 2022 00:05:30 -0800 X-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 X-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: [edk2-devel] [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> MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sean@starlabs.systems X-Gm-Message-State: 0Fyy7CSn123uFZiT4AKWLCCox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1644566730; bh=JTbfWFmG/9I7PAfz8wcFlCcmHcGURAzSFwOcwjtVssk=; h=Cc:Date:From:Reply-To:Subject:To; b=D4VPeJcWiCdKlhDc97Py6VGFeEh/LoGB7wdWVg3Npo40Z6JGTPaMEubZlj40Q7VAoJE +O+sy/b9knZJr9YQolqJCiX+SxBgY9z0yzKg6FacgUGhhQy5nR08OXRcQJbbI3AnNRraT jJNea0y8FGG4oLxeF3G4PS95d3Az90s7X5o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1644566733834100003 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Hao A Wu Reviewed-by: Ray Ni --- 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 ( // mWaitForValueTimeOut =3D KEYBOARD_BAT_TIMEOUT; =20 - Status =3D 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= ); =20 mWaitForValueTimeOut =3D KEYBOARD_WAITFORVALUE_TIMEOUT; =20 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 #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 --=20 2.32.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86611): https://edk2.groups.io/g/devel/message/86611 Mute This Topic: https://groups.io/mt/89066601/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-