LGTM

On Sun, Apr 23, 2023 at 3:39 PM Riku Viitanen via Grub-devel
<grub-devel@gnu.org> wrote:
>
> This fixes GRUB on Coreboot on HP EliteBooks by implementing
> a 200ms timeout. GRUB used to hang. See: 
> https://ticket.coreboot.org/issues/141
> ---
>  grub-core/term/at_keyboard.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
> index 597111077..28d1d0a77 100644
> --- a/grub-core/term/at_keyboard.c
> +++ b/grub-core/term/at_keyboard.c
> @@ -42,7 +42,16 @@ keyboard_controller_wait_until_ready (void)
>  {
>    /* 50 us would be enough but our current time resolution is 1ms.  */
>    grub_millisleep (1);
> -  while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)));
> +
> +  unsigned i = 200;
> +  while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) {
> +    grub_millisleep (1);
> +
> +    /* Timeout */
> +    if (! i--) {
> +      break;
> +    }
> +  }
>  }
>
>  static grub_uint8_t
> --
> 2.40.0
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'phcoder' Serbinenko

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to