public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jian-Hong Pan <jian-hong@endlessm.com>,
	Daniel Drake <drake@endlessm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-efi@vger.kernel.org, linux@endlessm.com,
	Ingo Molnar <mingo@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.9 12/25] x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T
Date: Tue,  7 May 2019 01:41:09 -0400	[thread overview]
Message-ID: <20190507054123.32514-12-sashal@kernel.org> (raw)
In-Reply-To: <20190507054123.32514-1-sashal@kernel.org>

From: Jian-Hong Pan <jian-hong@endlessm.com>

[ Upstream commit 0082517fa4bce073e7cf542633439f26538a14cc ]

Upon reboot, the Acer TravelMate X514-51T laptop appears to complete the
shutdown process, but then it hangs in BIOS POST with a black screen.

The problem is intermittent - at some points it has appeared related to
Secure Boot settings or different kernel builds, but ultimately we have
not been able to identify the exact conditions that trigger the issue to
come and go.

Besides, the EFI mode cannot be disabled in the BIOS of this model.

However, after extensive testing, we observe that using the EFI reboot
method reliably avoids the issue in all cases.

So add a boot time quirk to use EFI reboot on such systems.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=203119
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Cc: linux@endlessm.com
Link: http://lkml.kernel.org/r/20190412080152.3718-1-jian-hong@endlessm.com
[ Fix !CONFIG_EFI build failure, clarify the code and the changelog a bit. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kernel/reboot.c | 21 +++++++++++++++++++++
 include/linux/efi.h      |  7 ++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 4a12362a194a..c55b11fe8e9f 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -82,6 +82,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
 	return 0;
 }
 
+/*
+ * Some machines don't handle the default ACPI reboot method and
+ * require the EFI reboot method:
+ */
+static int __init set_efi_reboot(const struct dmi_system_id *d)
+{
+	if (reboot_type != BOOT_EFI && !efi_runtime_disabled()) {
+		reboot_type = BOOT_EFI;
+		pr_info("%s series board detected. Selecting EFI-method for reboot.\n", d->ident);
+	}
+	return 0;
+}
+
 void __noreturn machine_real_restart(unsigned int type)
 {
 	local_irq_disable();
@@ -167,6 +180,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
 		},
 	},
+	{	/* Handle reboot issue on Acer TravelMate X514-51T */
+		.callback = set_efi_reboot,
+		.ident = "Acer TravelMate X514-51T",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
+		},
+	},
 
 	/* Apple */
 	{	/* Handle problems with rebooting on Apple MacBook5 */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 80b1b8faf503..e6711bf9f0d1 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1433,7 +1433,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg,
 			   struct screen_info *si, efi_guid_t *proto,
 			   unsigned long size);
 
-bool efi_runtime_disabled(void);
+#ifdef CONFIG_EFI
+extern bool efi_runtime_disabled(void);
+#else
+static inline bool efi_runtime_disabled(void) { return true; }
+#endif
+
 extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
 
 /*
-- 
2.20.1


  parent reply	other threads:[~2019-05-07  5:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  5:40 [PATCH AUTOSEL 4.9 01/25] iio: adc: xilinx: fix potential use-after-free on remove Sasha Levin
2019-05-07  5:40 ` [PATCH AUTOSEL 4.9 02/25] libnvdimm/namespace: Fix a potential NULL pointer dereference Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 03/25] HID: input: add mapping for Expose/Overview key Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 04/25] HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 05/25] HID: input: add mapping for "Toggle Display" key Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 06/25] libnvdimm/btt: Fix a kmemdup failure check Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 07/25] s390/dasd: Fix capacity calculation for large volumes Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 08/25] mac80211: fix unaligned access in mesh table hash function Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 09/25] Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 10/25] s390/3270: fix lockdep false positive on view->lock Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 11/25] mISDN: Check address length before reading address family Sasha Levin
2019-05-07  5:41 ` Sasha Levin [this message]
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 13/25] KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 14/25] tools lib traceevent: Fix missing equality check for strcmp Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 15/25] init: initialize jump labels before command line option parsing Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 16/25] selftests: netfilter: check icmp pkttoobig errors are set as related Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 17/25] ipvs: do not schedule icmp errors from tunnels Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 18/25] MIPS: perf: ath79: Fix perfcount IRQ assignment Sasha Levin
2019-06-06 21:28   ` Petr Štetiar
2019-06-09 10:05     ` Greg KH
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 19/25] s390: ctcm: fix ctcm_new_device error return code Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 20/25] drm/sun4i: Set device driver data at bind time for use in unbind Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 21/25] selftests/net: correct the return value for run_netsocktests Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 22/25] gpu: ipu-v3: dp: fix CSC handling Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 23/25] spi: Micrel eth switch: declare missing of table Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 24/25] spi: ST ST95HF NFC: " Sasha Levin
2019-05-07  5:41 ` [PATCH AUTOSEL 4.9 25/25] Input: synaptics-rmi4 - fix possible double free Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190507054123.32514-12-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bp@alien8.de \
    --cc=drake@endlessm.com \
    --cc=jian-hong@endlessm.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox