From patchwork Wed Jan 31 08:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 10193549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A62960383 for ; Wed, 31 Jan 2018 08:40:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EECB62808F for ; Wed, 31 Jan 2018 08:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E306A2859E; Wed, 31 Jan 2018 08:40:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29CF02808F for ; Wed, 31 Jan 2018 08:40:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbeAaIkS (ORCPT ); Wed, 31 Jan 2018 03:40:18 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:38693 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbeAaIkS (ORCPT ); Wed, 31 Jan 2018 03:40:18 -0500 Received: from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1egnw9-0005LX-Nl; Wed, 31 Jan 2018 08:40:10 +0000 From: Alex Hung To: rjw@rjwysocki.net, lenb@kernel.org, jdelvare@suse.com, gregkh@linuxfoundation.org, davem@davemloft.net, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, f.fainelli@gmail.com, dmitry.torokhov@gmail.com, kishon@ti.com, karniksayli1995@gmail.com, linux-acpi@vger.kernel.org, alex.hung@canonical.com, Mario.Limonciello@dell.com Subject: [PATCH 2/2] ACPI / osi: add DMI quirk for Dell systems Date: Wed, 31 Jan 2018 00:40:05 -0800 Message-Id: <1517388005-14852-2-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517388005-14852-1-git-send-email-alex.hung@canonical.com> References: <1517388005-14852-1-git-send-email-alex.hung@canonical.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A number of Dell systems require an OEM _OSI string "Linux-Dell-Video" as a BIOS workaround for a system hang bug caused by discrete VGA. The form of the OEM _OSI string is discussed in Documentation/acpi/osi.txt and is defined by each OEM. Signed-off-by: Alex Hung --- drivers/acpi/osi.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c index 76998a5..43e4349 100644 --- a/drivers/acpi/osi.c +++ b/drivers/acpi/osi.c @@ -477,6 +477,112 @@ static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = { {} }; +static int __init dmi_oem_osi_add(const struct dmi_system_id *d) +{ + struct acpi_osi_entry *osi; + const char *str = d->driver_data; + int i; + + for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) { + osi = &osi_setup_entries[i]; + if (!strcmp(osi->string, str)) { + osi->enable = true; + continue; + } else if (osi->string[0] == '\0') { + osi->enable = true; + strncpy(osi->string, str, OSI_STRING_LENGTH_MAX); + break; + } + } + + return 0; +} + +static const struct dmi_system_id acpi_oem_osi_dmi_table[] __initconst = { + { + .callback = dmi_oem_osi_add, + .ident = "Dell Latitude 5491", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0818]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell Latitude 5591", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0819]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell Precision 3530", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0820]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell Inspiron 7777 AIO", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0850]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell Inspiron 5477 AIO", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0851]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell G5 5779", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0886]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell G5 5779", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0870]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell G5 5579", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[086F]"), + }, + .driver_data = "Linux-Dell-Video", + }, + { + .callback = dmi_oem_osi_add, + .ident = "Dell G5 5579", + .matches = { + DMI_EXACT_MATCH(DMI_OEM_STRING, "Dell System"), + DMI_EXACT_MATCH(DMI_OEM_STRING, "1[0885]"), + }, + .driver_data = "Linux-Dell-Video", + }, + {} +}; + static __init void acpi_osi_dmi_blacklisted(void) { dmi_check_system(acpi_osi_dmi_table); @@ -496,6 +602,7 @@ int __init early_acpi_osi_init(void) int __init acpi_osi_init(void) { acpi_install_interface_handler(acpi_osi_handler); + dmi_check_system(acpi_oem_osi_dmi_table); acpi_osi_setup_late(); return 0;