Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp925952imm; Thu, 4 Oct 2018 05:44:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60O+1tlAjay7OGBtIMAsvUFpkjvo+T541Yb9LFnPwFCKvR/zwDkrznQ4HII2Jeq2lgjX8qn X-Received: by 2002:a63:6bc2:: with SMTP id g185-v6mr5721123pgc.25.1538657042700; Thu, 04 Oct 2018 05:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538657042; cv=none; d=google.com; s=arc-20160816; b=qzEgiwjWjc2YsB8ypeikeScXp17ivkzRnwbErLX0uOC4m0xfwr2lNYpvKi2h354RH6 H73e7cSmtmdKAj3D5w0EIplg3omakrCC0POULrhKvVT73OrPwMPeGvK8BVjFOPJUATJs rsUiDSrMtDIco/Qk5fWx/PCs2YSsftJGW3G2yl4MyV52D2053rZNK7cAwGichMRTntRr sT1dwBUt6QukjDUWUs0Mnah+diDpD01zy/iaWRULgi7uGElmuxE+Br+VGKHTMWrPj7gh aV/yI5NELKywQAM6CffnR+Kt/iaCuo7XvZ0cC2yXiAWb6UEnXKE+QslvSYjYbI4c4HTx UFsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=sdf8zCTfKAOSwLdFB469EaaKaD9I77gVtN4GPF0AQRs=; b=pW8ionCnTCqGsupiiYPK/0GOmleApUryQ4XHv7I9trBJlT8ULSUr13VESV1DV4yWy6 0pCiUYZPrvqRMe5zAk64vieVC+HehP8+jymxBCQ0r+eYBUWnIYFfrm3YNq8LWdhNe3E1 eZT+7n0PXU8fTD9t18bl5t5r83ybGJGYlG1o0CQvS9QwfG7HNHJ0tXwo0pwUfV1fmgoN n0UuveDZy+C2PVpKTvpTcbNnKywzvvjEJxn1wPheGqUYPIKyG1unYieX7rBDLnDEkh/O exMnhgYyittpeKyNyMIQQzQgaUD5RA6f+1R2rm0pUWT+M5JVU/ZqU9ZHi6TDXUCGyRJC ef9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=FgSgqBro; dkim=pass header.i=@codeaurora.org header.s=default header.b=oRmmgyol; 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 x5-v6si4713785pgc.210.2018.10.04.05.43.46; Thu, 04 Oct 2018 05:44:02 -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=@codeaurora.org header.s=default header.b=FgSgqBro; dkim=pass header.i=@codeaurora.org header.s=default header.b=oRmmgyol; 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 S1727505AbeJDTgk (ORCPT + 99 others); Thu, 4 Oct 2018 15:36:40 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48410 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbeJDTgk (ORCPT ); Thu, 4 Oct 2018 15:36:40 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DAFB560C8A; Thu, 4 Oct 2018 12:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538657011; bh=FmzgTWgi+ZEA3uEWblw+2fSeC7lFKq0pebJF1yG+zEE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FgSgqBrot4ewGwDwkdb637zcRsXnnsFq/kAhTLA6ZuCgVLbIocZXi7MQC8ZFmED2m vceImziI6CzFD7ONbB+Axh6cSBDOz8hLUw49onVNH5wSoSwbnOSqEG+DS6BMqLJGhB vNfSA9RHz3eykH1tLAftNgvGbz2WxWFDVHfYGqXY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.206.24.39] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sayalil@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 81258607BD; Thu, 4 Oct 2018 12:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538657010; bh=FmzgTWgi+ZEA3uEWblw+2fSeC7lFKq0pebJF1yG+zEE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oRmmgyol6KNV1BOkooIDYvW8OMrJxmbWWvMURslhAtwcKVE4c+Bqo6/NDbJhbuDmr bqjy2VxJRnG0ZQa3C47SJJ/aGl2barRweke9Ai6wQmRCNpyW26DU8RzzzQlPLIouy6 Ab9JabQkBhx9sscwP4HLD4pfiooEatR+eXLTVu9k= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 81258607BD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sayalil@codeaurora.org Subject: Re: [PATCH RFC 2/7] mmc: core: devfreq: Add devfreq based clock scaling support To: Rob Herring Cc: adrian.hunter@intel.com, ulf.hansson@linaro.org, mark.rutland@arm.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, devicetree@vger.kernel.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, vviswana@codeaurora.org, bjorn.andersson@linaro.org, riteshh@codeaurora.org, vbadigan@codeaurora.org, Talel Shenhar References: <1531475583-7050-1-git-send-email-sayalil@codeaurora.org> <1531475583-7050-3-git-send-email-sayalil@codeaurora.org> <20180720152436.GA4566@rob-hp-laptop> From: Sayali Lokhande Message-ID: <17490ba5-42f6-f1c1-cb5c-be315dfdf197@codeaurora.org> Date: Thu, 4 Oct 2018 18:13:21 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180720152436.GA4566@rob-hp-laptop> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On 7/20/2018 8:54 PM, Rob Herring wrote: > On Fri, Jul 13, 2018 at 03:22:58PM +0530, Sayali Lokhande wrote: >> This change adds the use of devfreq to MMC. >> Both eMMC and SD card will use it. >> For some workloads, such as video playback, it isn't >> necessary for these cards to run at high speed. >> Running at lower frequency, for example 52MHz, in such >> cases can still meet the deadlines for data transfers. >> Scaling down the clock frequency dynamically has power >> savings not only because the bus is running at lower frequency >> but also has an advantage of scaling down the system core >> voltage, if supported. >> Provide an ondemand clock scaling support similar to the >> cpufreq ondemand governor having two thresholds, >> up_threshold and down_threshold to decide whether to >> increase the frequency or scale it down respectively. >> The sampling interval is in the order of milliseconds. >> If sampling interval is too low, frequent switching of >> frequencies can lead to high power consumption and if >> sampling interval is too high, the clock scaling logic >> would take long time to realize that the underlying >> hardware (controller and card) is busy and scale up >> the clocks. >> >> Signed-off-by: Talel Shenhar >> Signed-off-by: Sayali Lokhande >> --- >> .../devicetree/bindings/mmc/sdhci-msm.txt | 10 + >> drivers/mmc/core/core.c | 560 +++++++++++++++++++++ >> drivers/mmc/core/core.h | 7 + >> drivers/mmc/core/debugfs.c | 46 ++ >> drivers/mmc/core/host.c | 8 + >> drivers/mmc/core/mmc.c | 200 +++++++- >> drivers/mmc/core/sd.c | 72 ++- >> drivers/mmc/host/sdhci-msm.c | 37 ++ >> drivers/mmc/host/sdhci-pltfm.c | 11 + >> drivers/mmc/host/sdhci.c | 27 + >> drivers/mmc/host/sdhci.h | 8 + >> include/linux/mmc/card.h | 5 + >> include/linux/mmc/host.h | 70 +++ >> 13 files changed, 1059 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt >> index 502b3b8..bd8470a 100644 >> --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt >> +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt >> @@ -26,6 +26,15 @@ Required properties: >> "cal" - reference clock for RCLK delay calibration (optional) >> "sleep" - sleep clock for RCLK delay calibration (optional) >> >> +Optional Properties: >> +- qcom,devfreq,freq-table - specifies supported frequencies for clock scaling. >> + Clock scaling logic shall toggle between these frequencies based >> + on card load. In case the defined frequencies are over or below >> + the supported card frequencies, they will be overridden >> + during card init. In case this entry is not supplied, >> + the driver will construct one based on the card >> + supported max and min frequencies. >> + The frequencies must be ordered from lowest to highest. > This should be a common binding in which case will just a list of > frequencies be sufficient. [Sayali] : Can you please elaborate more on what do you mean by common binding here ? Like if you are referring to any already available property (by devfreq ?) to pass min-max frequencies ? Any Documentation file to refer ? > > Rob