From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by mx.groups.io with SMTP id smtpd.web09.3400.1647469706448347881 for ; Wed, 16 Mar 2022 15:28:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@starlabs-systems.20210112.gappssmtp.com header.s=20210112 header.b=0ff8U8Ei; spf=pass (domain: starlabs.systems, ip: 209.85.219.182, mailfrom: sean@starlabs.systems) Received: by mail-yb1-f182.google.com with SMTP id v130so6964370ybe.13 for ; Wed, 16 Mar 2022 15:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RUDAhRq5reL5P7ljAcG7//zJ7Io3ioyGXTdT7tBfd5I=; b=0ff8U8EiimBkjJccsdyrAX6hollcPIA/ZLptLo2FaHPsWdGhh5t8Wtflrr8VATtrvj das0s4NHln1LImD1NfBrcobphfTnhxa8nOG+IAJEZ9aQVGfwn2Fe6vJ1vquS3HOaW4Wa S4Kpa5E64daPU7Lhc9Nb4ZeGQB+ySmq7q0V94jK909XSQWMmx1hLE5wogUuYvotQwnru nsK6Ah2EDiBel9zyvXvfZ75VPre6R3L6e9AJIrzco3I27if4dBkdAJLixrrHF3a/v6pR V2VzVoy/9iaDZm85OjHMqWGUDfuOVJ1HHgevsl+uyDfxUhFnSvfB3Jq+snGgDrNShiE0 ad3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RUDAhRq5reL5P7ljAcG7//zJ7Io3ioyGXTdT7tBfd5I=; b=7dH+QCfZXDwfOHW42V1ra5Or9VM3jHo+dE855vLAWP78GPpgxw+EFIL+LMG0h8TGn8 QWbqRI4VamrCZtElRTjpcyLgaLPsZTcqaFeUrHN2I8fW95LsSzUqk2i9I6iZOQ506x+n P4GCWspNILi1xCT6uFymr+rCdBcW2bM1agCfjkMusBxNq47xIujdTG/xrL6is/0A+lLz KSOyETn1IEEyCbUB7IwU+AUy1FHLE4E0D5QQJwAT3Iy9U/R4vQpb4YmNmw7fO8JB/N2U PyBaBbwwg5qX0exExCsF7BMW1kYvP+BQBfdNGR/giIhE/Jd1OVyz8UUrVdaqrk138vTb LchQ== X-Gm-Message-State: AOAM532cqkB0DjmvkEY6ppqb1FEDi7lsNQhQFACvvdW7XmdLbS1bPFOu weZh4gjfqIlJOJ0P/wQIOtoVpWmSQ/LICHQ/j6x5 X-Google-Smtp-Source: ABdhPJyqLHAE05UEBdSaDzK53MfX58Xv+rb6TO/I7OuYt6DVvKzmaJvEQQcvq3XKCYfMjsUGZUOQFCagUwDTN0OOw/I= X-Received: by 2002:a25:42d6:0:b0:633:9e95:4316 with SMTP id p205-20020a2542d6000000b006339e954316mr1213505yba.415.1647469705535; Wed, 16 Mar 2022 15:28:25 -0700 (PDT) MIME-Version: 1.0 References: <793abb11501c3fe8d4b8c82267cb9a30bcfa9c3a.1644566720.git.sean@starlabs.systems> In-Reply-To: From: "Sean Rhodes" Date: Wed, 16 Mar 2022 22:28:14 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal To: "Wu, Hao A" Cc: "devel@edk2.groups.io" , "Ni, Ray" , "Dong, Guo" , Matt DeVillier Content-Type: multipart/alternative; boundary="00000000000093b9ae05da5d6ec6" --00000000000093b9ae05da5d6ec6 Content-Type: text/plain; charset="UTF-8" Hi Ray Would you be able to review please? :) Thanks Sean On Fri, 18 Feb 2022 at 02:16, Wu, Hao A wrote: > Acked-by: Hao A Wu > I recommend to get Ray's input for this patch before merging. > > Best Regards, > Hao Wu > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Sean > > Rhodes > > Sent: Friday, February 11, 2022 4:05 PM > > To: devel@edk2.groups.io > > Cc: Dong, Guo ; Matt DeVillier > > ; Wu, Hao A ; Ni, Ray > > ; Rhodes, Sean > > Subject: [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after > > BAT non-fatal > > > > 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/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 > > > > > > > > -=-=-=-=-=-= > > 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/1768737 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com] > > -=-=-=-=-=-= > > > > --00000000000093b9ae05da5d6ec6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ray

Would you be able to review please= ? :)

Thanks

Sean


On Fri, 18 Feb 20= 22 at 02:16, Wu, Hao A <hao.a.wu@i= ntel.com> wrote:
Acked-by: Hao A Wu <hao.a.wu@intel.com>
I recommend to get Ray's input for this patch before merging.

Best Regards,
Hao Wu

> -----Original Message-----
> From: devel@= edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean
> Rhodes
> Sent: Friday, February 11, 2022 4:05 PM
> To: devel@ed= k2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Matt DeVillier
> <matt= .devillier@gmail.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray
> <ray.ni@intel= .com>; Rhodes, Sean <sean@starlabs.systems>
> Subject: [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS aft= er
> BAT non-fatal
>
> 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 <r= ay.ni@intel.com>
> Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
>=C2=A0 MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 6 +----- >=C2=A0 MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h=C2=A0 =C2=A0| = 2 +-
>=C2=A0 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 (
>=C2=A0 =C2=A0 =C2=A0 //
>
>=C2=A0 =C2=A0 =C2=A0 mWaitForValueTimeOut =3D KEYBOARD_BAT_TIMEOUT;
>
>
>
> -=C2=A0 =C2=A0 Status =3D KeyboardWaitForValue (ConsoleIn,
> KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
>
> -=C2=A0 =C2=A0 if (EFI_ERROR (Status)) {
>
> -=C2=A0 =C2=A0 =C2=A0 KeyboardError (ConsoleIn, L"Keyboard self t= est failed!\n\r");
>
> -=C2=A0 =C2=A0 =C2=A0 goto Done;
>
> -=C2=A0 =C2=A0 }
>
> +=C2=A0 =C2=A0 KeyboardWaitForValue (ConsoleIn,
> KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
>
>
>
>=C2=A0 =C2=A0 =C2=A0 mWaitForValueTimeOut =3D KEYBOARD_WAITFORVALUE_TIM= EOUT;
>
>
>
> 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 (
>=C2=A0 #define KEYBOARD_MAX_TRY=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0256=C2=A0 =C2=A0 =C2=A0// 256
>
>=C2=A0 #define KEYBOARD_TIMEOUT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A065536=C2=A0 =C2=A0// 0.07s
>
>=C2=A0 #define KEYBOARD_WAITFORVALUE_TIMEOUT=C2=A0 =C2=A0 1000000 // 1s=
>
> -#define KEYBOARD_BAT_TIMEOUT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A04000000 // 4s
>
> +#define KEYBOARD_BAT_TIMEOUT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A01000000 // 1s
>
>=C2=A0 #define KEYBOARD_TIMER_INTERVAL=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 200000=C2=A0 // 0.02s
>
>=C2=A0 #define SCANCODE_EXTENDED0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A00xE0
>
>=C2=A0 #define SCANCODE_EXTENDED1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A00xE1
>
> --
> 2.32.0
>
>
>
> -=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/1768737=
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com]=
> -=3D-=3D-=3D-=3D-=3D-=3D
>

--00000000000093b9ae05da5d6ec6--