efi: Ensure efivars is loaded on EFI systems (Closes: #703363)

[x86] Use a platform device to trigger loading of efivars
[ia64] Change EFI_VARS from module to built-in

svn path=/dists/sid/linux/; revision=19916
This commit is contained in:
Ben Hutchings 2013-03-19 01:03:35 +00:00
parent 3d8c03a2f0
commit 0a773fbe09
4 changed files with 61 additions and 1 deletions

3
debian/changelog vendored
View File

@ -65,6 +65,9 @@ linux (3.2.40-1) UNRELEASED; urgency=low
* udeb: Add hid-topseed to input-modules (Closes: #702611)
* [x86] drm/i915: Unconditionally initialise the interrupt workers,
thanks to Bjørn Mork (Closes: #692607)
* efi: Ensure efivars is loaded on EFI systems (Closes: #703363)
- [x86] Use a platform device to trigger loading of efivars
- [ia64] Change EFI_VARS from module to built-in
-- Ben Hutchings <ben@decadent.org.uk> Wed, 27 Feb 2013 03:48:30 +0000

View File

@ -131,7 +131,7 @@ CONFIG_IPMI_POWEROFF=m
##
## file: drivers/firmware/Kconfig
##
CONFIG_EFI_VARS=m
CONFIG_EFI_VARS=y
CONFIG_DMIID=y
##

View File

@ -0,0 +1,56 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: x86/efi: Autoload efivars
Date: Mon, 18 Mar 2013 22:59:14 +0000
Bug-Debian: http://bugs.debian.org/703363
efivars is generally useful to have on EFI systems, and in some cases
it may be impossible to load it after a kernel upgrade in order to
complete a boot loader update. At the same time we don't want to
waste memory on non-EFI systems by making it built-in.
Instead, give it a module alias as if it's a platform driver, and
register a corresponding platform device whenever EFI runtime services
are available. This should trigger udev to load it.
---
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -38,6 +38,7 @@
#include <linux/io.h>
#include <linux/reboot.h>
#include <linux/bcd.h>
+#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/efi.h>
@@ -612,6 +613,20 @@ void __init efi_init(void)
#endif
}
+#ifdef CONFIG_EFI_VARS_MODULE
+static int __init efi_load_efivars(void)
+{
+ struct platform_device *pdev;
+
+ if (!efi_enabled(EFI_RUNTIME_SERVICES))
+ return 0;
+
+ pdev = platform_device_register_simple("efivars", 0, NULL, 0);
+ return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
+}
+device_initcall(efi_load_efivars);
+#endif
+
void __init efi_set_executable(efi_memory_desc_t *md, bool executable)
{
u64 addr, npages;
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -89,6 +89,7 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@
MODULE_DESCRIPTION("sysfs interface to EFI Variables");
MODULE_LICENSE("GPL");
MODULE_VERSION(EFIVARS_VERSION);
+MODULE_ALIAS("platform:efivars");
#define DUMP_NAME_LEN 52

View File

@ -615,3 +615,4 @@ debian/x86-efi-avoid-abi-change-in-3.2.38.patch
features/x86/efi-stub/0019-x86-efi-Fix-processor-specific-memcpy-build-error.patch
debian/pps-avoid-abi-change-in-3.2.40.patch
bugfix/x86/drm-i915-Unconditionally-initialise-the-interrupt-wo.patch
debian/efi-autoload-efivars.patch