From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Sun, 2 Jun 2019 19:12:17 +0000 (+0200)
Subject: efi_loader: check timer events in Stall()
X-Git-Tag: v2025.01-rc5-pxa1908~2944^2~9
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=22f23db428b8ee14ff04a9128431e719ef2a387c;p=u-boot.git

efi_loader: check timer events in Stall()

During a call to Stall() we should periodically check for timer events.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 027bd6d4d3..fed8d47ade 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1947,8 +1947,14 @@ out:
  */
 static efi_status_t EFIAPI efi_stall(unsigned long microseconds)
 {
+	u64 end_tick;
+
 	EFI_ENTRY("%ld", microseconds);
-	udelay(microseconds);
+
+	end_tick = get_ticks() + usec_to_tick(microseconds);
+	while (get_ticks() < end_tick)
+		efi_timer_check();
+
 	return EFI_EXIT(EFI_SUCCESS);
 }