Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590185

Re: [PATCH] mmc: core: Fix power sequence ordering in mmc_power_up

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!feeder4.usenet.farm!news.usenet.farm!feeder2.usenet.farm!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Arend Van Spriel <arend.vanspriel@broadcom.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mmc: core: Fix power sequence ordering in mmc_power_up
Date Wed, 01 Mar 2017 11:30:01 +0100
Message-ID <tg9wu-1CS-25@gated-at.bofh.it> (permalink)
References <tg8qK-Tq-13@gated-at.bofh.it>
X-Original-To Romain Perier <romain.perier@collabora.com>, Ulf Hansson <ulf.hansson@linaro.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=EmYXMhkYaiwZZqjhKkUjBFQxULJxrwTHtGg/Sbosz54=; b=VdnnQf/m6s7rRoPqjrTm0F+1bQeEnG/QPNMXpYOY0rKAhjSodBUI9AoAwJx7eiQ0oR SaaeIr2HGoM1+5Ay/LatnlZg25Ik0mY2XRAblHAfD+Q1qZsW9pLFMM0ooxVQmN9Zwxp+ /xWKBqqTUCxiQura0PZdpIApT7Qm3Je3vqFCY=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=EmYXMhkYaiwZZqjhKkUjBFQxULJxrwTHtGg/Sbosz54=; b=lD7uOI8BpGEBGA7iRWPmZJFG5uaP0M0Mu7JYBPrG4tK9CWZGjAsZ0LppAAp7GlSzMM keWqM4eWtG5XvwpkB1gdwTdmhhJNZpzPeaDIFUOWAbbMqHQnPmiVZKKn0bhf1LNzBtPB cW00aemZGh3UtclUB2gY+/2Vj4n7O3Qx+gPmr6GeCspdE1SgJDFkDd4NlNR8LBnkEkB9 HWQbEnaip1xk0wt6JbCp7cxjXKc1zr2+r/uQvWUG+VnMPXgO+BLKjhLhMZyP88WWCVPP /d+nx5SL68eRNEW3fAiSrviSvDijkm1XCEGqRXpC5svgXzIA9cITwgMIB1F1/n49/xRm pitg==
X-Gm-Message-State AMke39nl4WO5M6o5THPAVObFUkhqt+3CAIaxJ5e6rrp3pY/Uch9M8AG+SBhDdnDNIJDJr3AO
X-Received by 10.237.37.165 with SMTP id x34mr8938797qtc.0.1488362033366; Wed, 01 Mar 2017 01:53:53 -0800 (PST)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 68
Organization linux.* mail to news gateway
X-Original-Cc linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sjoerd Simons <sjoerd.simons@collabora.co.uk>
X-Original-Date Wed, 1 Mar 2017 10:53:46 +0100
X-Original-Message-ID <ef8580d1-989f-c9ab-abc7-034eb8cad7d0@broadcom.com>
X-Original-References <20170301085902.7388-1-romain.perier@collabora.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1590185

Show key headers only | View raw


On 1-3-2017 9:59, Romain Perier wrote:
> Currently, mmc_power_up calls the pre_power_on callback, enables the
> power supply of the mmc by calling mmc_set_ios() and then call
> post_power_on. WiFi chipsets like the AP6335 require a specific power
> sequence ordering before being used. You must enable the power supply
> and wait until it reaches its minimum voltage, gate the clock and wait
> at least two cycles and then assert the reset line.

Hi Romain,

You have to be more clear. What power supply, ie. vmmc or the supply for
the wifi chipset. Without knowing much of the details to me this sounds
like a new powerseq variant.

> This commit prevents regulators to be enabled in the middle of or after
> the power sequencing. We this fix, mmc_set_ios is first call, the
> underlying regulators are enabled, then pre_power_on and post_power_on
> are called, so clock and reset line are enabled in the right order,
> after the regulator.

It feels counter intuitive and maybe even wrong to change a setup
pattern like this. Can you be sure this will not cause any regressions?

Regards,
Arend

> Signed-off-by: Romain Perier <romain.perier@collabora.com>
> ---
>  drivers/mmc/core/core.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 1076b9d..36df24f 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1798,8 +1798,6 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
>  	if (host->ios.power_mode == MMC_POWER_ON)
>  		return;
>  
> -	mmc_pwrseq_pre_power_on(host);
> -
>  	host->ios.vdd = fls(ocr) - 1;
>  	host->ios.power_mode = MMC_POWER_UP;
>  	/* Set initial state and call mmc_set_ios */
> @@ -1819,13 +1817,20 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
>  	 */
>  	mmc_delay(10);
>  
> -	mmc_pwrseq_post_power_on(host);
> -
>  	host->ios.clock = host->f_init;
>  
>  	host->ios.power_mode = MMC_POWER_ON;
>  	mmc_set_ios(host);
>  
> +	mmc_pwrseq_pre_power_on(host);
> +
> +	/*
> +	 * This delay should be sufficient to wait at least two cycles of clock
> +	 * gated by pre_power_on
> +	 */
> +	mmc_delay(1);
> +	mmc_pwrseq_post_power_on(host);
> +
>  	/*
>  	 * This delay must be at least 74 clock sizes, or 1 ms, or the
>  	 * time required to reach a stable voltage.
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] mmc: core: Fix power sequence ordering in mmc_power_up Romain Perier <romain.perier@collabora.com> - 2017-03-01 10:10 +0100
  Re: [PATCH] mmc: core: Fix power sequence ordering in mmc_power_up Romain Perier <romain.perier@collabora.com> - 2017-03-01 11:20 +0100
  Re: [PATCH] mmc: core: Fix power sequence ordering in mmc_power_up Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-01 11:30 +0100

csiph-web