Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2038184imm; Mon, 16 Jul 2018 00:38:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKnJhyyTJO5fsZPdIA3d+ryYT/lD7hDBQs7Bts9TmqwmBVLriFT/xXGh35fwObNiTHKxFr X-Received: by 2002:a65:41c6:: with SMTP id b6-v6mr14364486pgq.174.1531726716705; Mon, 16 Jul 2018 00:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726716; cv=none; d=google.com; s=arc-20160816; b=Bze6gnspZvAo93krXKQjNqxI9b9a9nNMuMgIySCfr8WMa0fDEfsX50a5sKKAW1jbNc n44iRNYqjm+mxTFXFeSA3TulalRbMghJ/Q/usq/Bk28+kjW6ocOGEqJQQsc3i7Fy9pYL 2mSYI1/CKmgtMT6Hk8DieiQdbS1ojwESpb73E4721HGfrb5TMdHh05Ap1QYHLRaPRrBW Q5Cyi0IvLyIfE6178/ZsF/pIzkgkf51eEoqRW5MDQgSbcNdlzJy+KeTgul+sO+jnZ6TC qiDbeydLasK4filAbkuEz0tXW21CWQjxAT/jcaOU7ccXaom9aA8tGx5/MbEW9wierAvP X4BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/8iyZN0Y0F3bZrrWVpvbzyL5nf6Qj8FXLI4rM6DjfjI=; b=wGXj2gQu/pct7l5VyAI+ipM9KVxNbDNu4P4/rPEemIh/wCHRUN8NimUMA+jXi5sF4F I/K3cRcAmTxRL5Wlp1YPSFM+/icdv5ujZ0F5k3d7VA8Xo8zua+AkNNZlS1rpGrgn1XV0 wuIWc+p+5U49Q/lQhMdkWki/sEeJlQtgDR/66tWHrXDzsQN9SE+zbXquTx0xOMSWMXiq W2ICMlSjd31p3uJynuSv9kTsoj9XB94OOU8JIJxpB5QE+WcdT7U7c2GyRzDCXEl1WgDq o1gJyDSl4YMKePPRbiGjTQGxQAJ42gxx0Jrl89wGQA1mAASpnUnpoLhPRI75q+8zDOk9 nIrw== ARC-Authentication-Results: i=1; mx.google.com; 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 b2-v6si4358546plk.111.2018.07.16.00.38.21; Mon, 16 Jul 2018 00:38:36 -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; 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 S1731151AbeGPIDC (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46640 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeGPIDC (ORCPT ); Mon, 16 Jul 2018 04:03:02 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 99CB1CA4; Mon, 16 Jul 2018 07:37:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Ulf Hansson Subject: [PATCH 4.17 09/67] mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states Date: Mon, 16 Jul 2018 09:34:38 +0200 Message-Id: <20180716073444.563739900@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Agner commit 92748beac07c471d995fbec642b63572dc01b3dc upstream. If pinctrl nodes for 100/200MHz are missing, the controller should not select any mode which need signal frequencies 100MHz or higher. To prevent such speed modes the driver currently uses the quirk flag SDHCI_QUIRK2_NO_1_8_V. This works nicely for SD cards since 1.8V signaling is required for all faster modes and slower modes use 3.3V signaling only. However, there are eMMC modes which use 1.8V signaling and run below 100MHz, e.g. DDR52 at 1.8V. With using SDHCI_QUIRK2_NO_1_8_V this mode is prevented. When using a fixed 1.8V regulator as vqmmc-supply the stack has no valid mode to use. In this tenuous situation the kernel continuously prints voltage switching errors: mmc1: Switching to 3.3V signalling voltage failed Avoid using SDHCI_QUIRK2_NO_1_8_V and prevent faster modes by altering the SDHCI capability register. With that the stack is able to select 1.8V modes even if no faster pinctrl states are available: # cat /sys/kernel/debug/mmc1/ios ... timing spec: 8 (mmc DDR52) signal voltage: 1 (1.80 V) ... Link: http://lkml.kernel.org/r/20180628081331.13051-1-stefan@agner.ch Signed-off-by: Stefan Agner Fixes: ad93220de7da ("mmc: sdhci-esdhc-imx: change pinctrl state according to uhs mode") Cc: # v4.13+ Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-esdhc-imx.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -306,6 +306,15 @@ static u32 esdhc_readl_le(struct sdhci_h if (imx_data->socdata->flags & ESDHC_FLAG_HS400) val |= SDHCI_SUPPORT_HS400; + + /* + * Do not advertise faster UHS modes if there are no + * pinctrl states for 100MHz/200MHz. + */ + if (IS_ERR_OR_NULL(imx_data->pins_100mhz) || + IS_ERR_OR_NULL(imx_data->pins_200mhz)) + val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50 + | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400); } } @@ -1136,18 +1145,6 @@ sdhci_esdhc_imx_probe_dt(struct platform ESDHC_PINCTRL_STATE_100MHZ); imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, ESDHC_PINCTRL_STATE_200MHZ); - if (IS_ERR(imx_data->pins_100mhz) || - IS_ERR(imx_data->pins_200mhz)) { - dev_warn(mmc_dev(host->mmc), - "could not get ultra high speed state, work on normal mode\n"); - /* - * fall back to not supporting uhs by specifying no - * 1.8v quirk - */ - host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; - } - } else { - host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; } /* call to generic mmc_of_parse to support additional capabilities */