Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2948680yba; Tue, 16 Apr 2019 01:08:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwnp3bAfv2z1aexJvL8C1sWVM42Cipp6Viz5RyVmeie7ojCg63qKWsTz3/Wz3kemxRORqh X-Received: by 2002:a17:902:7841:: with SMTP id e1mr79653764pln.303.1555402112268; Tue, 16 Apr 2019 01:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555402112; cv=none; d=google.com; s=arc-20160816; b=MDy516zn/lF48lZWrF9GeMPRyCXfw9uL8aITGK1cSuAJpUM0BrWrI9AvmNGFLqwGEh gpyZqW+N37O8I6AE1liMNDpjjVW34HfWeu0ewNkyAomO2gUbvwFiEaxbcn66A0zVEVKP Gswe8iDAZ1zYFGf5qO58sPHnfm90xxCDCymiLAnV618c6o3lxSAAlmlJLV2bRi3uZH9A uC3wIXQE2TGivd86tbipTaL082LKHfRsVDpxVinA6BduHPpX+qHntHRC7Wf/SUtKjx4f R5DcKF0OASCTEJCp1Vq9QGbbZaHKbOV2aW4tuewhR8hKArdzMI1gEpvVb+2YzDjfFHk+ RlnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=C6eTFOeHQK9nYh5h4r/C/bwtrrNFgvhlyzIsM+Se0rA=; b=SRIHKuvgFSexg6TRBPf43JDvWalbdEQoSR6WQVHp5erpuuOnDzOP9SohA3o2BJY7nM WYJVVVu+kVS8/rYJVywDPyTUq+yd2QzWE7ZC1DHtkyOqfJmFW/XwegeV7ROdry/Gydn3 Wy6N8NEGEcqfuUvxwkm8PITCcZiDcfBrmlmXaUyeqFHDhKesm5D98Gjrwwvzp/YlrMwv exbl8UiFWU6F7HsGL4leLf19pO3Tp4n4ZiC2KmQNrA+vcjEswb2AF6ISQZhUp1xbMDiE 6l03wrxrQXgH/dUURmcLWSp0jyqtsmQjgFSTw7jsFesQvodLJrhvFV6gpyc5xA0BMIKN JgkQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 44si32972420plc.134.2019.04.16.01.08.16; Tue, 16 Apr 2019 01:08:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbfDPIHb (ORCPT + 99 others); Tue, 16 Apr 2019 04:07:31 -0400 Received: from terminus.zytor.com ([198.137.202.136]:56797 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbfDPIHb (ORCPT ); Tue, 16 Apr 2019 04:07:31 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3G87DRt3347557 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 16 Apr 2019 01:07:13 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3G87D0b3347554; Tue, 16 Apr 2019 01:07:13 -0700 Date: Tue, 16 Apr 2019 01:07:13 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jian-Hong Pan Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, bp@alien8.de, drake@endlessm.com, jian-hong@endlessm.com, matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org Reply-To: peterz@infradead.org, bp@alien8.de, drake@endlessm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, jian-hong@endlessm.com, matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, hpa@zytor.com In-Reply-To: <20190412080152.3718-1-jian-hong@endlessm.com> References: <20190412080152.3718-1-jian-hong@endlessm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T Git-Commit-ID: 0082517fa4bce073e7cf542633439f26538a14cc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0082517fa4bce073e7cf542633439f26538a14cc Gitweb: https://git.kernel.org/tip/0082517fa4bce073e7cf542633439f26538a14cc Author: Jian-Hong Pan AuthorDate: Fri, 12 Apr 2019 16:01:53 +0800 Committer: Ingo Molnar CommitDate: Tue, 16 Apr 2019 10:01:24 +0200 x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T 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 --- 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 725624b6c0c0..8fd3cedd9acc 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 54357a258b35..6ebc2098cfe1 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1611,7 +1611,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); extern unsigned long efi_call_virt_save_flags(void);