From patchwork Fri Mar 22 08:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1060977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44QcQx3Jrlz9sRk; Fri, 22 Mar 2019 19:34:49 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1h7FdR-0005yn-7o; Fri, 22 Mar 2019 08:34:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1h7FdP-0005yY-BM for kernel-team@lists.ubuntu.com; Fri, 22 Mar 2019 08:34:39 +0000 Received: from [222.129.42.169] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1h7FdO-0008AG-DW for kernel-team@lists.ubuntu.com; Fri, 22 Mar 2019 08:34:39 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: SAUCE: ACPI / bus: Add some Lenovo laptops in list of acpi table term list Date: Fri, 22 Mar 2019 16:34:26 +0800 Message-Id: <20190322083426.9038-2-aaron.ma@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190322083426.9038-1-aaron.ma@canonical.com> References: <20190322083426.9038-1-aaron.ma@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1819921 Some Lenovo laptops failed to boot because of no package handling with module-level code which is supported from v4.17-rc1. Due to the regression concerns, add these series of laptops in a quirk list to be handled. Signed-off-by: Aaron Ma Acked-by: Alex Hung --- drivers/acpi/bus.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f0348e388d01..4297316bfea1 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -109,10 +109,39 @@ static const struct dmi_system_id acpi_quirks_dmi_table[] __initconst = { }, {} }; + +static const char * const acpi_quirk_lenovo_bios_ids[] = { + "N2H", /* first 3 bytes of Lenovo BIOS version */ + NULL +}; + +bool acpi_quirk_matches_bios_ids(const char * const ids[]) +{ + const char *bios_vendor = dmi_get_system_info(DMI_BIOS_VENDOR); + const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION); + int i; + + if ((!bios_vendor) && (!bios_ver) && strncmp(bios_vendor, "LENOVO", 6)) + return false; + + for (i = 0; ids[i]; i++) + if (!strncmp(bios_ver, ids[i], 3)) { + acpi_gbl_parse_table_as_term_list = 1; + return true; + } + + return false; +} + #else static const struct dmi_system_id acpi_quirks_dmi_table[] __initconst = { {} }; + +bool acpi_quirk_matches_bios_ids(const char * const ids[]) +{ + return false; +} #endif /* -------------------------------------------------------------------------- @@ -1036,6 +1065,7 @@ void __init acpi_early_init(void) /* Check machine-specific quirks */ dmi_check_system(acpi_quirks_dmi_table); + acpi_quirk_matches_bios_ids(acpi_quirk_lenovo_bios_ids); status = acpi_reallocate_root_table(); if (ACPI_FAILURE(status)) {