From: Michael Chang <mchang@suse.com>
To: u-boot@lists.denx.de, Alexander Graf <agraf@csgraf.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Matthias Brugger <mbrugger@suse.com>
Subject: [PATCH] Disable timer check in file loading
Date: Thu, 8 Jul 2021 16:22:50 +0800 [thread overview]
Message-ID: <20210708082250.11833-1-mchang@suse.com> (raw)
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.
Downstream bug reference:
https://bugzilla.suse.com/show_bug.cgi?id=1171222
Signed-off-by: Michael Chang <mchang@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 307d5d759b..d090110b06 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -15,6 +15,7 @@
#include <log.h>
#include <part.h>
#include <malloc.h>
+#include <watchdog.h>
struct efi_system_partition efi_system_partition;
@@ -103,8 +104,7 @@ static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this,
else
n = blk_dwrite(desc, lba, blocks, buffer);
- /* We don't do interrupts, so check for timers cooperatively */
- efi_timer_check();
+ WATCHDOG_RESET();
EFI_PRINT("n=%lx blocks=%x\n", n, blocks);
--
2.26.2
next reply other threads:[~2021-07-08 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 8:22 Michael Chang [this message]
2021-07-15 14:51 ` [PATCH] Disable timer check in file loading Heinrich Schuchardt
2021-07-16 5:15 ` Michael Chang
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-all 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=20210708082250.11833-1-mchang@suse.com \
--to=mchang@suse.com \
--cc=agraf@csgraf.de \
--cc=mbrugger@suse.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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