]>
Commit | Line | Data |
---|---|---|
27d6b7f2 SL |
1 | From b1b93ae6629c6f960829b1b7c9b87ab4cda72d3d Mon Sep 17 00:00:00 2001 |
2 | From: Jian-Hong Pan <jian-hong@endlessm.com> | |
3 | Date: Fri, 12 Apr 2019 16:01:53 +0800 | |
4 | Subject: x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T | |
5 | ||
6 | [ Upstream commit 0082517fa4bce073e7cf542633439f26538a14cc ] | |
7 | ||
8 | Upon reboot, the Acer TravelMate X514-51T laptop appears to complete the | |
9 | shutdown process, but then it hangs in BIOS POST with a black screen. | |
10 | ||
11 | The problem is intermittent - at some points it has appeared related to | |
12 | Secure Boot settings or different kernel builds, but ultimately we have | |
13 | not been able to identify the exact conditions that trigger the issue to | |
14 | come and go. | |
15 | ||
16 | Besides, the EFI mode cannot be disabled in the BIOS of this model. | |
17 | ||
18 | However, after extensive testing, we observe that using the EFI reboot | |
19 | method reliably avoids the issue in all cases. | |
20 | ||
21 | So add a boot time quirk to use EFI reboot on such systems. | |
22 | ||
23 | Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=203119 | |
24 | Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com> | |
25 | Signed-off-by: Daniel Drake <drake@endlessm.com> | |
26 | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> | |
27 | Cc: Borislav Petkov <bp@alien8.de> | |
28 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
29 | Cc: Matt Fleming <matt@codeblueprint.co.uk> | |
30 | Cc: Peter Zijlstra <peterz@infradead.org> | |
31 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
32 | Cc: linux-efi@vger.kernel.org | |
33 | Cc: linux@endlessm.com | |
34 | Link: http://lkml.kernel.org/r/20190412080152.3718-1-jian-hong@endlessm.com | |
35 | [ Fix !CONFIG_EFI build failure, clarify the code and the changelog a bit. ] | |
36 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
37 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
38 | --- | |
39 | arch/x86/kernel/reboot.c | 21 +++++++++++++++++++++ | |
40 | include/linux/efi.h | 7 ++++++- | |
41 | 2 files changed, 27 insertions(+), 1 deletion(-) | |
42 | ||
43 | diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c | |
44 | index 4a12362a194af..c55b11fe8e9f6 100644 | |
45 | --- a/arch/x86/kernel/reboot.c | |
46 | +++ b/arch/x86/kernel/reboot.c | |
47 | @@ -82,6 +82,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) | |
48 | return 0; | |
49 | } | |
50 | ||
51 | +/* | |
52 | + * Some machines don't handle the default ACPI reboot method and | |
53 | + * require the EFI reboot method: | |
54 | + */ | |
55 | +static int __init set_efi_reboot(const struct dmi_system_id *d) | |
56 | +{ | |
57 | + if (reboot_type != BOOT_EFI && !efi_runtime_disabled()) { | |
58 | + reboot_type = BOOT_EFI; | |
59 | + pr_info("%s series board detected. Selecting EFI-method for reboot.\n", d->ident); | |
60 | + } | |
61 | + return 0; | |
62 | +} | |
63 | + | |
64 | void __noreturn machine_real_restart(unsigned int type) | |
65 | { | |
66 | local_irq_disable(); | |
67 | @@ -167,6 +180,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |
68 | DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), | |
69 | }, | |
70 | }, | |
71 | + { /* Handle reboot issue on Acer TravelMate X514-51T */ | |
72 | + .callback = set_efi_reboot, | |
73 | + .ident = "Acer TravelMate X514-51T", | |
74 | + .matches = { | |
75 | + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | |
76 | + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"), | |
77 | + }, | |
78 | + }, | |
79 | ||
80 | /* Apple */ | |
81 | { /* Handle problems with rebooting on Apple MacBook5 */ | |
82 | diff --git a/include/linux/efi.h b/include/linux/efi.h | |
83 | index 80b1b8faf503f..e6711bf9f0d12 100644 | |
84 | --- a/include/linux/efi.h | |
85 | +++ b/include/linux/efi.h | |
86 | @@ -1433,7 +1433,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, | |
87 | struct screen_info *si, efi_guid_t *proto, | |
88 | unsigned long size); | |
89 | ||
90 | -bool efi_runtime_disabled(void); | |
91 | +#ifdef CONFIG_EFI | |
92 | +extern bool efi_runtime_disabled(void); | |
93 | +#else | |
94 | +static inline bool efi_runtime_disabled(void) { return true; } | |
95 | +#endif | |
96 | + | |
97 | extern void efi_call_virt_check_flags(unsigned long flags, const char *call); | |
98 | ||
99 | /* | |
100 | -- | |
101 | 2.20.1 | |
102 |