From patchwork Wed Apr 12 18:19:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9678147 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 DE5AA60383 for ; Wed, 12 Apr 2017 18:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D53F828622 for ; Wed, 12 Apr 2017 18:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA01528694; Wed, 12 Apr 2017 18:19:28 +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 731E928622 for ; Wed, 12 Apr 2017 18:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752401AbdDLST1 (ORCPT ); Wed, 12 Apr 2017 14:19:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbdDLST1 (ORCPT ); Wed, 12 Apr 2017 14:19:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 030C62E6050; Wed, 12 Apr 2017 18:19:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 030C62E6050 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 030C62E6050 Received: from shalem.localdomain.com (ovpn-116-234.ams2.redhat.com [10.36.116.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id E33FB173C6; Wed, 12 Apr 2017 18:19:25 +0000 (UTC) From: Hans de Goede To: Adrian Hunter , Ulf Hansson Cc: Hans de Goede , Takashi Iwai , linux-mmc@vger.kernel.org Subject: [PATCH v3 3/3] mmc: sdhci-acpi: Add DMI fix_up_power_blacklist Date: Wed, 12 Apr 2017 20:19:22 +0200 Message-Id: <20170412181922.31833-3-hdegoede@redhat.com> In-Reply-To: <20170412181922.31833-1-hdegoede@redhat.com> References: <20170412181922.31833-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 12 Apr 2017 18:19:27 +0000 (UTC) Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a DMI based blacklist for systems where calling acpi_device_fix_up_power() is harmful. Signed-off-by: Hans de Goede --- Changes in v2: -Adjust for changes in mmc: sdhci-acpi: Add fix_up_power_blacklist module option -Only use a single fix_up_power_dmi_blacklist for the GPDwin further testing has shown that the DMI strings are unique enough that we do not need the bios-date in there Changes in v3: -Adjust for changes to "mmc: sdhci-acpi: Add blacklist module option" --- drivers/mmc/host/sdhci-acpi.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 42bbc9a..495d1cc 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -384,6 +385,28 @@ static const struct acpi_device_id sdhci_acpi_ids[] = { }; MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); +static const struct dmi_system_id fix_up_power_dmi_blacklist[] = { + { + /* + * Match for the GPDwin which unfortunately uses somewhat + * generic dmi strings, which is why we test for 4 strings. + * Comparing against 23 other byt/cht boards, board_vendor + * and board_name are unique to the GPDwin, where as only one + * other board has the same board_serial and 3 others have + * the same default product_name. Also the GPDwin is the + * only device to have both board_ and product_name not set. + */ + .driver_data = "80860F14:2", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "Default string"), + DMI_MATCH(DMI_BOARD_SERIAL, "Default string"), + DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), + }, + }, + { } +}; + static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid, const char *uid) { @@ -406,6 +429,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) acpi_handle handle = ACPI_HANDLE(dev); const char *bl = blacklist; struct acpi_device *device, *child; + const struct dmi_system_id *dmi_id; struct sdhci_acpi_host *c; struct sdhci_host *host; struct resource *iomem; @@ -420,6 +444,12 @@ static int sdhci_acpi_probe(struct platform_device *pdev) hid = acpi_device_hid(device); uid = device->pnp.unique_id; + if (!bl) { + dmi_id = dmi_first_match(fix_up_power_dmi_blacklist); + if (dmi_id) + bl = dmi_id->driver_data; + } + if (sdhci_acpi_compare_hid_uid(bl, hid, uid)) return -ENODEV;