Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3344120yba; Mon, 6 May 2019 22:54:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqJ8iVRUTOdSyqGmpfyRlxUsuWt326dutiopyzd7IZOBpbrSJhrCN+V04jIXXYZhiMcE2N X-Received: by 2002:a17:902:54f:: with SMTP id 73mr33559081plf.140.1557208484688; Mon, 06 May 2019 22:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557208484; cv=none; d=google.com; s=arc-20160816; b=KYmu8OTmKf5BKyzKGcaeGQKJxJJ/YSuw2X1+HAG8C251l+DUpJOgIP5gvPpmNrm8nT qsESqswFtJx9nHe/Eu1fDGvqmjw53h15ribQaqpPPkF11aqIrYdltIpRFzJWnli6Y5NQ W7MfcPWLSnL8XixRfUxQ/wFZW1derj2x4EPJunroN+Gjip+9EFO9psNSqo8kAzfODHGE kqfo2qlSoSwT5gWjkDoc/ZHbDtmFOpCegjI7HMbxHAzng1G4pniU6LU4oG4wYr8ZKAJT 7m+yHdmRaAtfZCiSLGU1Wkh3ThnCO2X1FxGHdePw3dEGVBLptNS8zZGIksO5GijtlKrk 91rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H5DDVQ4VhNMHHkxTsOQ53PFxCJrGeY54PpJUohjS1o4=; b=FrY/Hu9hYOUjMtgiOtNNwm2UK6OGXvNvbQEr08GMolkxaJ8cx0M7RKSXlnmdhWGiBZ jb3H9p6jQ44M1bK52r0qK2xjnXgsDkWbzkecKilHiOptti6RFn9YFQEQKTdcBmWcuXFw m+Xv6aiHRBeGBAkEYTqX/ROh7ljmoIw6sdw2GOpkxkRVA9Ozzh/OxPD1Mpyu7fFJF3Y8 fVkbOStlG8Rpgm2DsVMNbif4RVs/BwePWJJVAlbjPT1k1W279pCFAqFzBrbx3Lo/q4VL 1qlmmxrGN8hFZld8I+1lLVK/EjAiKilyqBC08wywzmhzotspj2KDwRRF0iUby0cFKz6b HXFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z+cBOhAy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si17651230pfn.31.2019.05.06.22.54.29; Mon, 06 May 2019 22:54:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z+cBOhAy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728942AbfEGFx0 (ORCPT + 99 others); Tue, 7 May 2019 01:53:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:58626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbfEGFjA (ORCPT ); Tue, 7 May 2019 01:39:00 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5806020675; Tue, 7 May 2019 05:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207538; bh=prF2+gzSL6pxxVsXtk5gbC5lgyW15N7BbcAWOLNLIG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z+cBOhAywL2742FYff0RQQquCwudtqWLrmMLa0K4A/sOXQMAMRvqP/sYgpoRMRpm2 yo467TeyrpLwzaQVJoDUUiI7dRzlIirwpP/IrgV8mLCtA7jqkZ10yhGklgLPSDLt+d +LAszKYc/Y87IA8wZrEFHca5VubsroPWzoPmrLig= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jian-Hong Pan , Daniel Drake , Ard Biesheuvel , Borislav Petkov , Linus Torvalds , Matt Fleming , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, linux@endlessm.com, Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL 4.14 17/95] x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T Date: Tue, 7 May 2019 01:37:06 -0400 Message-Id: <20190507053826.31622-17-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian-Hong Pan [ 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 Signed-off-by: Daniel Drake Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Zijlstra Cc: Thomas Gleixner 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 Signed-off-by: Sasha Levin --- 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 2126b9d27c34..c663d5fcff2e 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -81,6 +81,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(); @@ -166,6 +179,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = { 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 b68b7d199fee..2dab158b74c4 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1518,7 +1518,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); enum efi_secureboot_mode { -- 2.20.1