Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp587152imm; Fri, 13 Jul 2018 02:54:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfch1kFLU6HBOJz6VJ8vRK9jEZLqO559EKxfaxXvoN9FBjlxSQAYs0McPS0lc+vjSxqlAZB X-Received: by 2002:a62:c60e:: with SMTP id m14-v6mr6370568pfg.40.1531475654752; Fri, 13 Jul 2018 02:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531475654; cv=none; d=google.com; s=arc-20160816; b=tN3j+eLD2iTEstU0XVJoUJ4elfVCcRBd6KnTVMfTnCnVqsRHxWWdFxPG1tBtTkbS1u mLQnrCb4C7yziV+lzI3/o1wUVU6Ah3I06lAbEWmyKCiLzqp9gZPe/eAYJVA625JiXTvr 8a6wUY+g9IuR9oEVrNrn0fvnh1Y+QDvFTlmJctMw6hNzmJaHfWgFG5SV4peYb8fS4zPT vtq1TebtQUznVvj4ieCUStajcWu9tR3lOAEGArkI1cEHOFXxzCr1lef+9Bl2wzTH8lxL yFD2uhXc612R3Oxb0KjSWXVCPwOzczmMd+Z9qm0NiCulTRHZYegjFKOK33MPbemC8m13 FyZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=f95d+4LD7Lb9dncfX40/EwvX8JLTb/H9QOKNyIExwGc=; b=B8O9vgfsJ5m8d+SxCalzlNQYR31a0oXJNTeTjUsI+PqKOozCy+tsg4GGLNyZ+CGkdy rqnRmIlMIzO+gHIR8YwD80oOHvcD5U6P6SLMc9Xj1X6TpPXMI81l+P3BA0zulBODgf6l aGT3nO5/CmC8TbUzCI4BHjbBEkQMDvPnCGGCUka9wI8dyRz0ghzAy6WG/vAIqPCQli4l G8Jjf7lrd7DFVMUNxRxFoetutiTKDjtSsOX3Ii7JKH4kqW8VgOrTmzPnP6ef5VPDffOL J7/sZnbXzAVFF8itm+0z6usO+J0LIXwcxyK+27M0GwPiV32HUccDpmYK0xJtZt6abLcX pbgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=LYagyxnV; dkim=pass header.i=@codeaurora.org header.s=default header.b=FpnFaup2; 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 190-v6si23728860pgd.673.2018.07.13.02.53.59; Fri, 13 Jul 2018 02:54:14 -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=LYagyxnV; dkim=pass header.i=@codeaurora.org header.s=default header.b=FpnFaup2; 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 S1727535AbeGMKHR (ORCPT + 99 others); Fri, 13 Jul 2018 06:07:17 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49202 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbeGMKHQ (ORCPT ); Fri, 13 Jul 2018 06:07:16 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5A04960555; Fri, 13 Jul 2018 09:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531475601; bh=ku1t/oStNkUqIu5vcHW2erKw0hVV0k84ZuaEjXPgGQ0=; h=From:To:Cc:Subject:Date:From; b=LYagyxnV/rHnBlIXIMkBUsOnSi9OIaN+Y9KKPuUDS66XdaL3iWyoRhi8sDL/0vpNz SWnDYPYs48NaGDRzFh+1ObmoyLjUdiUMYLMJG8fGQu0pmUMNfLJmoVm/X4gt52Cd5L 1Asb7m6wKHcG/iDexIHkQfUTnNQ36ZJ3ytGw1UXs= 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.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from sayalil-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sayalil@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0079560271; Fri, 13 Jul 2018 09:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531475600; bh=ku1t/oStNkUqIu5vcHW2erKw0hVV0k84ZuaEjXPgGQ0=; h=From:To:Cc:Subject:Date:From; b=FpnFaup2c0q82cmYsv72RnkOylWmO/TNlO/T56PtrqfdUZyhNropW6oXCGnTyC/O8 9r+CXsZ19JzJjSZwZXuJ7zi6D/GX8N/vP6tBZtqQkjGAdd12n5pxOiLuySkX+SyOMf 0qw2ENag/xlVJ9D3He6pvhVJe342aBPuCY4kEdw8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0079560271 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 From: Sayali Lokhande To: adrian.hunter@intel.com, ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: 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, sayalil@codeaurora.org Subject: [PATCH RFC 0/7] Add devfreq based clock scaling support for mmc Date: Fri, 13 Jul 2018 15:22:56 +0530 Message-Id: <1531475583-7050-1-git-send-email-sayalil@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change adds the use of devfreq based clock scaling to MMC. Both eMMC and SD card can 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, 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 as per load. Sahitya Tummala (1): devfreq: Add new flag to do simple clock scaling Sayali Lokhande (6): mmc: core: devfreq: Add devfreq based clock scaling support mmc: core: Add sysfs entries for dynamic control of clock scaling mmc: core: add support for devfreq suspend/resume mmc: sdhci-msm: Kconfig: select devfreq ondemand for sdhci-msm mmc: sdhci-msm: Enable clock scaling property mmc: core: Add a debugfs entry to set max clock rate .../devicetree/bindings/mmc/sdhci-msm.txt | 10 + Documentation/mmc/mmc-dev-attrs.txt | 38 ++ drivers/devfreq/governor_simpleondemand.c | 25 +- drivers/mmc/core/core.c | 672 +++++++++++++++++++++ drivers/mmc/core/core.h | 9 + drivers/mmc/core/debugfs.c | 90 +++ drivers/mmc/core/host.c | 163 ++++- drivers/mmc/core/mmc.c | 227 ++++++- drivers/mmc/core/sd.c | 85 ++- drivers/mmc/host/Kconfig | 2 + drivers/mmc/host/sdhci-msm.c | 38 ++ drivers/mmc/host/sdhci-pltfm.c | 11 + drivers/mmc/host/sdhci.c | 27 + drivers/mmc/host/sdhci.h | 8 + include/linux/devfreq.h | 4 + include/linux/mmc/card.h | 5 + include/linux/mmc/host.h | 70 +++ 17 files changed, 1475 insertions(+), 9 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project