From patchwork Tue Oct 23 10:07:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 10652945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C76AD13A4 for ; Tue, 23 Oct 2018 10:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DCA6292BA for ; Tue, 23 Oct 2018 10:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91BA929214; Tue, 23 Oct 2018 10:08:12 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 2D2FC29214 for ; Tue, 23 Oct 2018 10:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729023AbeJWSa2 (ORCPT ); Tue, 23 Oct 2018 14:30:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35496 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbeJWSa2 (ORCPT ); Tue, 23 Oct 2018 14:30:28 -0400 Received: by mail-wm1-f65.google.com with SMTP id w186-v6so1138341wmf.0 for ; Tue, 23 Oct 2018 03:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=astier-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=1yJ8J3Yam1Q1wlDeQK3fsxuGh+b4WnI7dD8h+RpA+YI=; b=UpWJbEze0+jM+5C8+Fi9ybuFpiBJkNfHfHYzpWDsd1JZW+XssMvYQa5Os5lItXUmPD yJ2cYWuNp3NgDCFd11mNJ0lEhBLMFSzwlIgHz5KDBlEGLZ80JKaBtycBAr2fEkSGj5wV eLE/Ul7c8Ogs/mi8XoWImYH6MvzqcvoYJT6vL20SZZcBaZftSVB7AXrRDNQDR40SOGMg 7q7az35HZp+2pd6yNE2ijxMV5kMwlLhpiJ8LEtv2iC4Yh/HN9qKmIbvZmuTJOzge/nsQ qjSwt/zM0jpYks0843grIPl+3yxMgB9s3toD9JCtKwrDQOM8Gh2vwe7EK08TLW0ux7W8 T+mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1yJ8J3Yam1Q1wlDeQK3fsxuGh+b4WnI7dD8h+RpA+YI=; b=F8K/8czGQ1GlV2PjGxgM3gnMO/ioUSt4XiKlE7vBadr2+nXeA8M4Fw2A+zJt4yjMEP 1bvEPNAuH4TZgScKaJwEHKLRwiidQTaeJCb10lRDRaOgaADPC51S97KjEWYWQlYGIllB fYJiNqFqY3si5E17+wrhzhV95p/jJLWLjuu8+jb+6odsX6J50/LnknjQIT3l62JLLGBX q3JZB6Eoh1LnZtg5goh+Po3YSpZrbOdsFYp3pWCpnJh/LbWGAe2SMijwgc5n6BsQZvHC GoQTFY0ZJAPhLgzwa5KX6PosDr1gkWRp+cjfWb1RjCMd2q1J/MJ4IUmng6xHvneWaEAj MIpA== X-Gm-Message-State: AGRZ1gJG3GOq5QsEgxIj/p7L7KZViv1LMkSEJEKGOzf42vRukPhaF4rE cBJj8oDs9xhJEsnzGb6Opzkq7Q== X-Google-Smtp-Source: AJdET5ce2uwYGyCPfGTvewhHTTLEmoMkTtZozUEe6wFAq4dCCItDDkaT9gpst2T8EIyacsImzIvHiQ== X-Received: by 2002:a1c:7a0a:: with SMTP id v10-v6mr2532579wmc.41.1540289263047; Tue, 23 Oct 2018 03:07:43 -0700 (PDT) Received: from jaya.substantiel.local ([92.103.140.194]) by smtp.gmail.com with ESMTPSA id i13-v6sm910930wrn.62.2018.10.23.03.07.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 03:07:42 -0700 (PDT) From: Anisse Astier To: Adrian Hunter Cc: Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Anisse Astier Subject: [PATCH v2 1/3] mmc: sdhci-pci: disable 1.8V with dmi quirk Date: Tue, 23 Oct 2018 12:07:27 +0200 Message-Id: <20181023100729.28864-2-anisse@astier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181023100729.28864-1-anisse@astier.eu> References: <20181023100729.28864-1-anisse@astier.eu> In-Reply-To: <20181022134026.GB18413@jaya> References: <20181022134026.GB18413@jaya> 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 If the motherboard is known not to support 1.8V properly, add the necessary quirk on probe. This fixes an issue on a Gemini Lake (GLK) laptop : eMMC driver will timeout on boot (from 60seconds to 10minutes ) as the cqhci attempts CQE recovery after a failed voltage switch. In earlier kernels, the problem existed, but only delayed boot for about 10 seconds after an I/O error, allowing booting on the eMMC (almost) unnoticed. Signed-off-by: Anisse Astier --- drivers/mmc/host/sdhci-pci-core.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 7bfd366d970d..396413f7c854 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "cqhci.h" @@ -703,6 +704,16 @@ static int intel_execute_tuning(struct mmc_host *mmc, u32 opcode) return 0; } +static const struct dmi_system_id board_no_1_8v[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), + DMI_MATCH(DMI_PRODUCT_NAME, "N75_77GU"), + }, + }, + { } +}; + static void byt_probe_slot(struct sdhci_pci_slot *slot) { struct mmc_host_ops *ops = &slot->host->mmc_host_ops; @@ -710,6 +721,12 @@ static void byt_probe_slot(struct sdhci_pci_slot *slot) byt_read_dsm(slot); ops->execute_tuning = intel_execute_tuning; + + if (dmi_check_system(board_no_1_8v)) { + pr_debug("%s: motherboard does not support 1.8V\n", + mmc_hostname(slot->host->mmc)); + slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; + } ops->start_signal_voltage_switch = intel_start_signal_voltage_switch; } From patchwork Tue Oct 23 10:07:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 10652947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 067C113B5 for ; Tue, 23 Oct 2018 10:08:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0FD229214 for ; Tue, 23 Oct 2018 10:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5704292BA; Tue, 23 Oct 2018 10:08:12 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 7B003292C7 for ; Tue, 23 Oct 2018 10:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728848AbeJWSay (ORCPT ); Tue, 23 Oct 2018 14:30:54 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38992 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729021AbeJWSa2 (ORCPT ); Tue, 23 Oct 2018 14:30:28 -0400 Received: by mail-wr1-f65.google.com with SMTP id r10-v6so103374wrv.6 for ; Tue, 23 Oct 2018 03:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=astier-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=g+t10cHmuM9MWFndnI6k5nB9kv/fzz/0OksJl35QveE=; b=OOZPSPSASxpKCviqMQOl+Z+yHXUCvzHO+rlCwg9TTTNe3BQGOu1rk39OzmWBdI/6ns f5NTQ6wLIQRYUr5aD2nxu8Hgv9JG5sqYwZMDjzqr5EoFOejaoBhTL1y1n7mYgq7WQZW5 ECibVNVhfqLOnks2MeQOOQdObRxn7BR1eKemvbVLFfLnbsQikyZHlQRwEyFdTmrOg7P7 YZLFfjhEWccwVqjDNUhoHOKsxEqdxBpu+QpW4ldkqO5S19DdGaSmfK7YwuDVnJUjJbL4 SQB7+zIXHGI6DXQ6jipWEN8snaYwymRr+C7n7FjD5Iyf+BH6a9CtIrI9QGjGjJoGR3/t OqlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=g+t10cHmuM9MWFndnI6k5nB9kv/fzz/0OksJl35QveE=; b=bgiZ5JeFTc83VtCzkyKkR0fvkTPa9s//aO4BwkGdWm5FioTgnGvw91qkiKvh4ZJkyh RUD7UoazkB6FP1nYXqf3HXyR82V3Gr3LFlj1Yz8C2WT/B/5Jp3dFneUcSYOdk61Sh5nn MsdzTsiE0D30cgjz1h8kK9GO6M8E8wvFx/JKDHb9wuny5/zCMxVpCTl8r7bHHzdkF7Kc HFIUtVR6cieLdJRVAgQY/kPaW8tAXRKM6K0kXNTr8ALqh7/CyqvTThsC4kLX84V0s4zC 30b/RwAluT805Y0flBVvlTEnx5RI6XCLoHv60TwNuvt/TL6xA4QECPSiKEftUgMVweT5 J6vw== X-Gm-Message-State: AGRZ1gKpULEADSaqU9UmvNHVwQjktckljEFIKEqSAM4/TSVfGWGe3cnS UKOF1MsbguhXoiVpiiat2V3g4w== X-Google-Smtp-Source: AJdET5fAEFScllTLKzMwzONntdnIBXVIAhTQeuPWhriSwoFxv3o7vFWIICo4IIoHejlAa+XMsPZxzQ== X-Received: by 2002:adf:ea0b:: with SMTP id q11-v6mr233865wrm.5.1540289263980; Tue, 23 Oct 2018 03:07:43 -0700 (PDT) Received: from jaya.substantiel.local ([92.103.140.194]) by smtp.gmail.com with ESMTPSA id i13-v6sm910930wrn.62.2018.10.23.03.07.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 03:07:43 -0700 (PDT) From: Anisse Astier To: Adrian Hunter Cc: Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Anisse Astier Subject: [PATCH v2 2/3] mmc: sdhci-pci: add new machine with 1.8V dmi quirk Date: Tue, 23 Oct 2018 12:07:28 +0200 Message-Id: <20181023100729.28864-3-anisse@astier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181023100729.28864-1-anisse@astier.eu> References: <20181023100729.28864-1-anisse@astier.eu> In-Reply-To: <20181022134026.GB18413@jaya> References: <20181022134026.GB18413@jaya> 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 This machine also displays the same issue that is fixed by the quirk. Signed-off-by: Anisse Astier --- drivers/mmc/host/sdhci-pci-core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 396413f7c854..f2c1fb339d66 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -711,6 +711,12 @@ static const struct dmi_system_id board_no_1_8v[] = { DMI_MATCH(DMI_PRODUCT_NAME, "N75_77GU"), }, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Ordissimo"), + DMI_MATCH(DMI_PRODUCT_NAME, "Agathe3"), + }, + }, { } }; From patchwork Tue Oct 23 10:07:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 10652943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A42C13B5 for ; Tue, 23 Oct 2018 10:07:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E29A929214 for ; Tue, 23 Oct 2018 10:07:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D672F292C7; Tue, 23 Oct 2018 10:07:49 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 0D44729214 for ; Tue, 23 Oct 2018 10:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728961AbeJWSaa (ORCPT ); Tue, 23 Oct 2018 14:30:30 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:33993 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729026AbeJWSa3 (ORCPT ); Tue, 23 Oct 2018 14:30:29 -0400 Received: by mail-wm1-f68.google.com with SMTP id z25-v6so11232975wmf.1 for ; Tue, 23 Oct 2018 03:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=astier-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2lGu63PRc1IiqaG5JjRbZANs5k88cp36wl81f1JLXWE=; b=SI+biLT6x8fnzl8nEcGcGde6OlmtnkUzg8dvnvVksAzdfV3opYNiOD5/9hthmqXyyY G+EJ0mb9WdLN2fK9RMvoPODktJoMj7CnvjicmfLWzm9wlp/2r4QTGc//4TMtrbkUuULO pJslCXCzFO1nQO0ghNBRRU6nrKOOXfXUHy64Dp23ZadLdvHqEZWgr61R6eCJsmxIepWF b6Pyjr5+U+vykepG/Tuz83Ar+6IKtiVbgmgOb8ChloXkjK9bzSHiqm884f8fBHhQvfU/ pElvC271Rrz99X/O7mJlB2XzZ499S9jiZ1Rrfnrx//q84ks7coJiS24xSrHITaCw/xeM E7qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=2lGu63PRc1IiqaG5JjRbZANs5k88cp36wl81f1JLXWE=; b=Gcmn+R2j44YwnPQYDVJNWvOu8fQmbaP302frVlDnTcck1Lgo1ExFXXUWpC5u+sTkVT LoU+YVC5kCX2tZkfZwVSmJxXkt6h1ElZG3vkbsXkA+DLNyD1z2MYTRnne9PwXzMXdPCC YYDWFiMTr2H8DiWoqTLKyrZvoQsIBuEF0KYHV7C67plOkxt3dm6k/oJK7L9f9muLnhZ6 iW+70DQBRKb2FIYqrYzbIXw/DHcEAjpduEQI33bYSytBFOF/NovsFXqVQ4bnw0WGfW0B D+c4yOXLGuILq7gFUGPImvxStJC3/XYpOWxV6rH+OkzSLb7Tqr5wL+nGNCd9AMt1cMOs FnkQ== X-Gm-Message-State: AGRZ1gLewZ4ZY94ATlgbNc0AQPwqRLZPGg5/xP8t2FFk1X+bNEs6WCyq 7I4txUpXg+8gC5R9WRGmgAQ9dw== X-Google-Smtp-Source: ACcGV6390eJA+hhle7tonXD7EiuB+vB5K7iHR/+6t2Q6ip4HUdvFYnjDgiiuf2wJwnJe2Zyrno+fqw== X-Received: by 2002:a1c:f518:: with SMTP id t24-v6mr1840374wmh.82.1540289264902; Tue, 23 Oct 2018 03:07:44 -0700 (PDT) Received: from jaya.substantiel.local ([92.103.140.194]) by smtp.gmail.com with ESMTPSA id i13-v6sm910930wrn.62.2018.10.23.03.07.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 03:07:44 -0700 (PDT) From: Anisse Astier To: Adrian Hunter Cc: Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Anisse Astier Subject: [PATCH v2 3/3] mmc: sdhci-pci: only install voltage switch method when useful Date: Tue, 23 Oct 2018 12:07:29 +0200 Message-Id: <20181023100729.28864-4-anisse@astier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181023100729.28864-1-anisse@astier.eu> References: <20181023100729.28864-1-anisse@astier.eu> In-Reply-To: <20181022134026.GB18413@jaya> References: <20181022134026.GB18413@jaya> 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 If there's no ACPI DSM for voltage switch, it will just cause a lot of debug info down the line, we only need one at startup. Signed-off-by: Anisse Astier --- drivers/mmc/host/sdhci-pci-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index f2c1fb339d66..95fdbb883c7e 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -723,6 +723,7 @@ static const struct dmi_system_id board_no_1_8v[] = { static void byt_probe_slot(struct sdhci_pci_slot *slot) { struct mmc_host_ops *ops = &slot->host->mmc_host_ops; + struct intel_host *intel_host = sdhci_pci_priv(slot); byt_read_dsm(slot); @@ -733,6 +734,16 @@ static void byt_probe_slot(struct sdhci_pci_slot *slot) mmc_hostname(slot->host->mmc)); slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; } + /* Check if we have the appropriate voltage switch DSM methods */ + if (!(intel_host->dsm_fns & (1 << INTEL_DSM_V18_SWITCH)) && + !(intel_host->dsm_fns & (1 << INTEL_DSM_V33_SWITCH))) { + /* No voltage switching supported at all, there's no + * point in installing the callback: return. + */ + pr_debug("%s: No voltage switching ACPI DSM helper\n", + mmc_hostname(slot->host->mmc)); + return; + } ops->start_signal_voltage_switch = intel_start_signal_voltage_switch; }