Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp489213yba; Wed, 15 May 2019 05:03:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSpUx/dx5U2Brfjjnk1aKhgbnlJ0K4SAtOj4gs+vx1Wbf8feAjPkWzJ5MMSJ+iiiyFvk8k X-Received: by 2002:a65:550b:: with SMTP id f11mr43046002pgr.311.1557921830255; Wed, 15 May 2019 05:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557921830; cv=none; d=google.com; s=arc-20160816; b=PMDRUhD/ZRr+/NW7T6wbmUg4Uc4ue76JUCT1DvWyrAGIt10knXXVUo75MOjJDdQGmQ cR9DKnn9fMlrtV7k6uq1zRZcm8q18hU0hXbQoLZqVpEHB/HfsXjqC6gX4uGOYM1b9gjg V/3eDYU1eHY74WpdgvBh3LWCnD9Suq64Y1HW+g+m17DExZs0TdxVfraS3as2YuOY0VVF vnFNZv1hzm3QMKIDj9eXMo2lDkio41kA57YqwC9U/+PFATEjQVL4GkHMvcd+dgM6tnrG EmZ8ZJvhRYnzGtpd0vZxJJp/l3e2w+lj6IOW6eCSzwC8vOE7MKHMjhlIR4Y7DpFkAxyZ t31w== 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=GAOeZTrXvTPiZIetE82IKOAAM/kzyHhFcytVmGfV2nA=; b=0xvMQnH0xXZAJiNNpoohm18l7+0a4XcfdREIIolDOgOd8QaYN6g3o13JoAgjaCX80D PXEk0N4Vg686Bh0/NM1cib6aeNhbdlYt+X/pMiB+ysMHnZu4fDIf1Cc+nuvUHjeFG5nT hmf6ImXXbxxQXjGPmZda3cubvdSKjBgAXqP7ipPJ1ACzZx9fjgHjukjIRlXkY2APQUK9 m9s//IEkohyz+vMJuzxMVrH5BhIuEgVJM1NPZ925Fs0fdA6qEvFGRn7aGsvPlHwLN1Gk f/WNL8uFHvJ/DwfwDZfLyhZJileNzdpk1mhxVEA/aIPnLr/oNoW1GvNOUnGcnDXhoHeE c1+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UPXiDK+9; 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 g9si1623633plt.33.2019.05.15.05.03.34; Wed, 15 May 2019 05:03:50 -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=UPXiDK+9; 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 S1730039AbfEOLNy (ORCPT + 99 others); Wed, 15 May 2019 07:13:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730029AbfEOLNu (ORCPT ); Wed, 15 May 2019 07:13:50 -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 E9CD020843; Wed, 15 May 2019 11:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918829; bh=C3pjdgoM05E/pFgWcXmBFJyVyCqrBL4TcyQyem672PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPXiDK+9MuPfq3AKPDqt3bCzm7VW8iWk1U3l28EykNFT5heIlQn5n9BB0od2JWDBx yzhz9Bz/ENqa0HJF/dBfEgCn2ZailPWlQcHR/tUwrUgXgRtXvtHGjlKo/n+sRwfhAa QgQcvkfiDY26gOSM5FJQDjoDUTy10EZ9LzQ8veY8= 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 4.9 16/51] x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T Date: Wed, 15 May 2019 12:55:51 +0200 Message-Id: <20190515090622.504518229@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.669619870@linuxfoundation.org> References: <20190515090616.669619870@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 4a12362a194af..c55b11fe8e9f6 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 80b1b8faf503f..e6711bf9f0d12 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