Blame SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch

a85e8e
From d4c213d4c71336cefdc0419de510ac19665b5d32 Mon Sep 17 00:00:00 2001
a85e8e
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
a85e8e
Date: Fri, 15 Aug 2014 11:29:22 -0400
a85e8e
Subject: [PATCH 144/260] Fix exit back to EFI firmware
a85e8e
a85e8e
Arm/AArch64 machines set up a timer event which is not getting
a85e8e
canceled when returning to firmware. This is because grub_exit()
a85e8e
calls grub_efi_fini() instead of grub_machine_fini(). The latter
a85e8e
will shutdown the timer (and other machine-specific things) as
a85e8e
well as make the call to grub_efi_fini().
a85e8e
---
a85e8e
 grub-core/kern/arm/efi/init.c | 2 +-
a85e8e
 grub-core/kern/efi/efi.c      | 3 ++-
a85e8e
 2 files changed, 3 insertions(+), 2 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c
a85e8e
index 0c17d8390..06df60e2f 100644
a85e8e
--- a/grub-core/kern/arm/efi/init.c
a85e8e
+++ b/grub-core/kern/arm/efi/init.c
a85e8e
@@ -67,7 +67,7 @@ grub_machine_fini (int flags)
a85e8e
 
a85e8e
   b = grub_efi_system_table->boot_services;
a85e8e
 
a85e8e
-  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0);
a85e8e
+  efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0);
a85e8e
   efi_call_1 (b->close_event, tmr_evt);
a85e8e
 
a85e8e
   grub_efi_fini ();
a85e8e
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
a85e8e
index 1a8dba531..d99a6fbdf 100644
a85e8e
--- a/grub-core/kern/efi/efi.c
a85e8e
+++ b/grub-core/kern/efi/efi.c
a85e8e
@@ -27,6 +27,7 @@
a85e8e
 #include <grub/term.h>
a85e8e
 #include <grub/kernel.h>
a85e8e
 #include <grub/mm.h>
a85e8e
+#include <grub/loader.h>
a85e8e
 
a85e8e
 /* The handle of GRUB itself. Filled in by the startup code.  */
a85e8e
 grub_efi_handle_t grub_efi_image_handle;
a85e8e
@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle)
a85e8e
 void
a85e8e
 grub_exit (void)
a85e8e
 {
a85e8e
-  grub_efi_fini ();
a85e8e
+  grub_machine_fini (GRUB_LOADER_FLAG_NORETURN);
a85e8e
   efi_call_4 (grub_efi_system_table->boot_services->exit,
a85e8e
               grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0);
a85e8e
   for (;;) ;
a85e8e
-- 
a85e8e
2.13.0
a85e8e