Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp472849yba; Wed, 15 May 2019 04:45:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTU7kZFCFv4remeGny+HEQuuBAnS7oz/NX4+hs19C1EQQToGxjCFVNZ7n4FGRseuA0EGp0 X-Received: by 2002:a62:5a47:: with SMTP id o68mr21842128pfb.149.1557920730363; Wed, 15 May 2019 04:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920730; cv=none; d=google.com; s=arc-20160816; b=As9lca+XmXWHTgnJvlo9UIYp/6iNxaKw5QSEL2jGfZob4/v+IZyFdkEtp0TNJugFYW yxw0IFZtrAj6q1k9weROXL2+NMbdVBNQPd4aMMSDQhaXlTSidQBrPw/1pCQr1jdmHCEY zxS0/AdfTxMlC9Aa3blAszb/6UnTV9SkA94r7ahVmkoo/kw+WNfDfSU/QNiaORo0RBpP qIuelc5qYQcCuOSFtH+l4FaeCkNihqPzztBw+GgHiC3BJfO1+rQuTXUiRYCPPKWFktWo sQE1AEibngTw3Qi6Ec4/6k7CYf/vXF6Nr6FkM+PTsG69jaDYAoqIjvzTqNaxMsKudiJE ICLw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vez/CA2dqME6takP55ZL98ZnkmVsloS7YRmJrELlIjs=; b=TiHG57/lo4zOhITIkbQvnU+aTJjIyrOQlVgEtFdnJ9vM9avh58m1cBhzXlHYwP7tBk I+fnOKXPF8Oi4yFQL9ae6dcHl7ojaSRykMbPvlAvN6fJNqqe/i7DoGkr1Z14G6PhGJTD W6fzmtmf54xvBTQRm4MxUScuwFdXArwkMJe36qwdjClN9x0TNr/5zKBcT91b7SdztkHf yWoXxPyP2Scy+PE4EP2lrzqSPVXD2NJulZIg+/CR7TN0VQdlylM90ZHb2q2vuLq25Rdt 17IWAMGRIzalPrQa1tC5dn3QuEWU41eyt3QiNja8NNM/ww76wkHOFK+5rFfnY6QymJt4 aoxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1ZduIT7e; 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 ay3si1530076plb.298.2019.05.15.04.45.16; Wed, 15 May 2019 04:45:30 -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=1ZduIT7e; 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 S1732495AbfEOLmx (ORCPT + 99 others); Wed, 15 May 2019 07:42:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732286AbfEOL1v (ORCPT ); Wed, 15 May 2019 07:27:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB8A320843; Wed, 15 May 2019 11:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919670; bh=GG0qt3ctbTqUNhqn8fE9gUxNmpq9AC1MRoQ2tNGlc/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1ZduIT7eTPouDwv98655pYGW5ds1fJWH0YNZmICegdGKRLL10LwJmmZuAW6OOjejp 8mwrZjoX8KDt0KKmJ98wh88SlYpgaowhO6wBKObnw5U9K57ZCtez+oqjD7/IPS8M/z +aNMd7abYG2Km2FsAQrLRhtPpCNv61Ckazw4LYDs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, 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 5.0 049/137] x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T Date: Wed, 15 May 2019 12:55:30 +0200 Message-Id: <20190515090657.030753220@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 725624b6c0c05..8fd3cedd9accd 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 a86485ac7c878..de05a43025292 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1598,7 +1598,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