Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1740704imu; Wed, 28 Nov 2018 14:25:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/U8WJf2p/3jG3xT0YZHP0H/iO8cD53oVjQscs5efVQS7eYJL97R2nGOhDEkIgE2JcjMZjIX X-Received: by 2002:a63:580a:: with SMTP id m10mr34356361pgb.332.1543443943847; Wed, 28 Nov 2018 14:25:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443943; cv=none; d=google.com; s=arc-20160816; b=NB565ImH5ObJ3Nc8GzS2C5//rrqAVJKkxoMS/x6NQLs+XYeffnhGUVVvXsqNjyWxX5 tiyvnb+YLDn2TFvlvlamitJr5SYA8pOPH7HsSG69iXWp3gwtmkXCBEgE3KsxXkQLMo/c I1k1chQ0VPujoHrIfJN3aSEK9RA86EJ0c0pAZkxRrHpqYqLz9fgidWsYai4v0eplg3Hd 6UJ2PsfidngUkcs4HMs/wo6SD0G3I39+T82FuR5+ToeHLZHa179MnxEFFUoHFY0+Dwe/ F5K9TmLpNSpXZAfRmPMo/+fnJtJN7vr3OOtJuXTp5PD1E62JHJR1LY9jd085S1DXEcZR WKjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WT+OyciSn6tm60G+djLo1QOuzRI00eAck3T2zc1OecU=; b=HaqFQRdJ6j7JfHBzgr987Ectdgx4rcP/YlhTZ3UN2C/9c1I7kAlv3eYUKgo3R4Wxjb vIe4Krn1GK1JeTSXD98RhUK3TACxyCgXMai1gfD+IZosp+FT5t9pKn8MLrzREgOqluw4 1yZAjJfbT+znj1lw4qJM4FUN8yts9r19sx7xLrCZGzYqQqEz1YiirzQsBWhB8kk+MC9o kHrFLHlHgey8KkmW7VC9SR/xoURyRmvt8/ImLlr35F9eQzjqg2VR5RxQOOKpOGcXq6Xf d6aF5/zF13AEC4UgkXSyXCl9maaOHNYnS2QZVKKmDdv+G3Zq5BFBOZFCdqQZK4PXEu/f NFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUaYlVLj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si8925766pgi.443.2018.11.28.14.25.29; Wed, 28 Nov 2018 14:25:43 -0800 (PST) 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=@linaro.org header.s=google header.b=PUaYlVLj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbeK2J0r (ORCPT + 99 others); Thu, 29 Nov 2018 04:26:47 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39939 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbeK2J0q (ORCPT ); Thu, 29 Nov 2018 04:26:46 -0500 Received: by mail-pg1-f194.google.com with SMTP id z10so10123589pgp.7 for ; Wed, 28 Nov 2018 14:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WT+OyciSn6tm60G+djLo1QOuzRI00eAck3T2zc1OecU=; b=PUaYlVLjG9y87eq/KazmTUgNZepc6InldOAcRlp3/N+0D5akM51lsNGmPCpB5vbkvx gpzTQwOJcko0mMjcFOEmTOBgoRR5wpbX9+Ze+SBp9tMOe8dYYvOIXTJ8p6VIeaRxqonN ArIo7YWd68dtDwX3k+6+ufaRjB4kxhsCLnnjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WT+OyciSn6tm60G+djLo1QOuzRI00eAck3T2zc1OecU=; b=ap253sgZgJUCrJAJ9NJEhVIrGfhKdlN60aQBiSkO9+wmUvTmxrqVIuMO7u1lc60YVC JMDgSPxdqvtjqiTu7QUTpULUQZe9NFYMRvul7wQbOSK9pzkYs1dDXTy+9B5cw09pHH/C Zzh85JspQ5TfIBgi8OhLdloKZUOatNB1XGaw4XMw8GW9DTRLNqFOeoCFBJRw0d12jSUr uMaCFjcraMpRNbhtz4HOPjpjs+xFDSLXFoR2Iys3uNS/3KGvOalhYFV4rdPrf4LuXxw1 crvdwtW/rry567vVki0ZYrMExkdT93JvqBk1QdbtPlpkROgd4KSDFT8ZYsfJR/ZKP+oY j88g== X-Gm-Message-State: AGRZ1gJTrtOhxn+7p4VQ0qSSbSN6R3+oJ4Ev1UVdlzX6LWTO1li6FAgT ZHtBC+dfKU+GnuB3OYV8YgLZxA== X-Received: by 2002:a62:8145:: with SMTP id t66mr39647480pfd.55.1543443817498; Wed, 28 Nov 2018 14:23:37 -0800 (PST) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k137sm15023364pfd.56.2018.11.28.14.23.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 14:23:36 -0800 (PST) Date: Wed, 28 Nov 2018 14:23:34 -0800 From: Bjorn Andersson To: Georgi Djakov Cc: linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, rjw@rjwysocki.net, robh+dt@kernel.org, mturquette@baylibre.com, khilman@baylibre.com, vincent.guittot@linaro.org, skannan@codeaurora.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, maxime.ripard@bootlin.com, arnd@arndb.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, linux-mmc@vger.kernel.org Subject: Re: [RFC] mmc: host: sdhci-msm: Use the interconnect API Message-ID: <20181128222333.GA24969@minitux> References: <20181011120336.9129-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181011120336.9129-1-georgi.djakov@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 11 Oct 05:03 PDT 2018, Georgi Djakov wrote: > The interconnect API provides an interface for consumer drivers to express > their bandwidth needs in the SoC. This data is aggregated and the on-chip > interconnect hardware is configured to the appropriate power/performance > profile. > > Use the interconnect API to get() the path between the endpoints used for > data transfers by the SD host controller and report the needed bandwidth > based on the clock rate, bus width and mode. > Although the Qualcomm SDHCI driver is our primary target, wouldn't it be possible to add this in the mmc core or sdhci helper functions instead, so that other platforms doesn't need to duplicate this code? [..] > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c [..] > @@ -1917,6 +1957,7 @@ static int sdhci_msm_runtime_suspend(struct device *dev) > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); > > + icc_set(msm_host->path, 0, 0); The use sdhci_msm_icc_update() to enable a bus vote and icc_set() to disable the vote lacks symmetry. Please see if this can be improved, e.g. by passing a boolean to the update function to "enable"/"disable" the vote. > clk_bulk_disable_unprepare(ARRAY_SIZE(msm_host->bulk_clks), > msm_host->bulk_clks); > > @@ -1929,6 +1970,7 @@ static int sdhci_msm_runtime_resume(struct device *dev) > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); > > + sdhci_msm_icc_update(msm_host); > return clk_bulk_prepare_enable(ARRAY_SIZE(msm_host->bulk_clks), > msm_host->bulk_clks); > } Regards, Bjorn