SHA256
1
0
forked from pool/u-boot
u-boot/0013-Disable-timer-check-in-file-loading.patch
Dirk Mueller f39b767ea5 Accepting request 1120007 from home:mbrugger:branches:hardware:boot
Fix boo#1216036. Tested on RPi4. Boot from USB and uSD fine.
For details see: https://lore.kernel.org/u-boot/20231023070216.394709-1-sjg@chromium.org/#t
* Patches added:
  0018-Revert-bootstd-Scan-all-bootdevs-in.patch
  0019-bootstd-Expand-boot-ordering-test-t.patch
  0020-bootstd-Correct-logic-for-single-uc.patch
  0021-bootstd-Scan-all-bootdevs-in-a-boot.patch

OBS-URL: https://build.opensuse.org/request/show/1120007
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=201
2023-10-26 06:37:38 +00:00

49 lines
1.8 KiB
Diff

From eb920203b4f5c1712524bf362991587ff24512d2 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Tue, 25 May 2021 06:45:01 +0000
Subject: [PATCH] Disable timer check in file loading
The u-boot efi console service registers a timer to poll the keyboard
input in every 50ns. In the efi block io service, this timer is
evaluated on each block read, and since the timer interval is much less
than the time needed to reading out a block (32kB) from the disk, the
keyboard polling is therefore in the wake of each block read.
Unfortunately USB keyboard spends too much time in polling. In my test
usb_kbd_poll_for_event costs 40ms in usb_kbd_testc() to test if a
character is in the queue. In combination with the number of blocks to
be read from the disk, the extra amound of time delayed could be around
30 seconds to load linux and initrd.
For that matters, the timer check is disabled in file loading to speed
it up. The consequence would be losing the keystroke during the time
file is loading, but that is acceptable IMHO.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
lib/efi_loader/efi_disk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index f0d76113b00..314af7e2022 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -19,6 +19,7 @@
#include <log.h>
#include <part.h>
#include <malloc.h>
+#include <watchdog.h>
struct efi_system_partition efi_system_partition = {
.uclass_id = UCLASS_INVALID,
@@ -142,8 +143,7 @@ static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this,
n = blk_dwrite(desc, lba, blocks, buffer);
}
- /* We don't do interrupts, so check for timers cooperatively */
- efi_timer_check();
+ schedule();
EFI_PRINT("n=%lx blocks=%x\n", n, blocks);