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

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