Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp511984imm; Thu, 5 Jul 2018 04:23:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpff3nlTGcQGlJRXaVhUH1pPUJs/EFWsV/SMCjnG8Mi9XagNidPW7jI/hRxwwh+2ebWZCL+z X-Received: by 2002:a63:c44a:: with SMTP id m10-v6mr5261073pgg.416.1530789832708; Thu, 05 Jul 2018 04:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530789832; cv=none; d=google.com; s=arc-20160816; b=nUII4FJFFZH4Jmf56C3fa+8Tc7Tg/9ExHrlQycf7Yr8lJFMylMfgX4bRj5jO60bXSj kWxNiijeLW0IViJT8rF+/8TctJt0OExI+zb1CnJ/oM/12mcQF1wnOOKVGR7lFvK01kBg Ags26n0+wHmDzGxK0KCaWoCSENkY/C48wNjY7Hl5UwzOJYwOVI6gFGZSLYbhFIkD/4gp fj38trsMHtPwj6IBwRs6PzN5RBr7sMGzJy0/NMFeC7LnSKD3qMpov+dx8q16X5N/z2Jf 10vDCfZZ5+aVm4WgSFU3bQdwsQf1Ta5Pez1pRHnqQVD05YZft/8m5VZUFb97HizJp6Lm 9RSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=G3Dy8qoagLqfR3gEnIq2Edxkl0Y3vHbBz1M48+t9uYQ=; b=SNUYwafbXksFl6W9T1d8OmZ+7+l2onZFSCo5jQvNlgQZH/9xeHslWm8Q9bHBwmQ6qW 9nErtvXCwIi74Et4ctZoWp26ZO5JfQWkRshhEythKcKXCnl5FagLVg5wqYIaBfwte9oR aCS9VC90hwxrTVVgnF5mde0bI7oVT+CD6tuVowxrgzzHmg5S4XyyXtSGysW4JAQCWeog coH948oJ5lVRwxcfFjCJyU7wx34rsc+yf2RyVTDkY19oaE4mLVFVHDCJkz1naZf93iHL ypw2bgLm75lCphcFSRMt30xr1fpB2EJ41XMWsvLnWVpxyWBV8xLIGbPaINvkuMTv+T7P 4QtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=SLhGlWBb; 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 h65-v6si5129434pfb.70.2018.07.05.04.23.38; Thu, 05 Jul 2018 04:23:52 -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; dkim=pass header.i=@agner.ch header.s=dkim header.b=SLhGlWBb; 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 S1753823AbeGELWh (ORCPT + 99 others); Thu, 5 Jul 2018 07:22:37 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:38234 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753409AbeGELWf (ORCPT ); Thu, 5 Jul 2018 07:22:35 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id D55815C16B5; Thu, 5 Jul 2018 13:22:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1530789753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G3Dy8qoagLqfR3gEnIq2Edxkl0Y3vHbBz1M48+t9uYQ=; b=SLhGlWBbUqxZvR+RUj+GTp6ZxAYW9vLekFhJFXBV5jvevEQtvN+Nr/g2KcNpuHNvla5d90 wx8QOdhcdmyh2sr+jBaj2WF0Gg0dIqjWZp5Q+3JGL/kRpgNT6vaGfB7GqBf3SQ9TiyB8nB wTD0bSXaNcqKz8rct3/3NF3HcGEGh+o= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 05 Jul 2018 13:22:33 +0200 From: Stefan Agner To: Ulf Hansson Cc: Adrian Hunter , Fabio Estevam , Haibo Chen , Aisheng Dong , Michael Trimarchi , Russell King , linux-mmc@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [PATCH v2] mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states In-Reply-To: References: <20180704150745.21003-1-stefan@agner.ch> Message-ID: <69f6122b8a69f1ab41d2ef8274321689@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[kernel]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.07.2018 11:48, Ulf Hansson wrote: > On 4 July 2018 at 17:18, Stefan Agner wrote: >> On 04.07.2018 17:07, Stefan Agner wrote: >>> 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 >>> --- >> >> Btw, I still get the switching error once during boot-up: >> mmc1: Switching to 3.3V signalling voltage failed > > I guess the this happens then also at system resume? > > The core tries first with 3.3 then if it fails, it continues with 1.8V, etc. > >> >> This is due to the call from mmc_set_initial_signal_voltage. It is a bit >> unfortunate since this is printed as a warning. Not sure if that could >> be prevented somehow? > > Seems like SDHCI_SIGNALING_330 should not be set, unless 3.3V I/O is > supported. That should avoid SDHCI from trying and instead just > returning an error code immediately. > > This seems like a generic issues for all SDHCI variant drivers. Hm, can we resolve this in a generic fashion? E.g something like this in sdhci_setup_host(): if (!regulator_is_supported_voltage(mmc->supply.vqmmc, 3200000, 3450000)) host->flags &= ~SDHCI_SIGNALING_330; -- Stefan