Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2202600ybb; Thu, 2 Apr 2020 15:25:58 -0700 (PDT) X-Google-Smtp-Source: APiQypKQPd/Gzo04W/uCy2xAemEIC51hyY26nmWy4AZsnWKPWXwm2BDxEHFoVltUTyMz2Y2zWCGY X-Received: by 2002:a9d:798f:: with SMTP id h15mr4231022otm.284.1585866358552; Thu, 02 Apr 2020 15:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585866358; cv=none; d=google.com; s=arc-20160816; b=UfT6qG14BHxrFQLMNsDAnODZFhd1uZPz5eHCqycLAYTV9AMnxR4Pe3W3VJPZqWrd12 DSCwo8jSdAG+GPd5sFdZUR0tcktf6xpsn918lCYlkcBHUEJ+vSoWwPU7SDGnXCCR/+q4 DZldG0kaKuzxBVbpaCcPAf5FRrrYgEeielNY3qpu7Kzzhh6hsoCIcP98VCIqXjoeU7da WdSEuUYoShjbLefo8sUkOgYST1htkKLpoUTCgqQgRzvyjvxg5ecpeuXzSwCwzrI05zQq zQPRBM9yhH5bhifpzQqrUwYxDx5m7vhJxapKU27vLD6JVMkLPW8/P08Cl7nugPHO6iqI mPgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+2mkX6A1G0+Xunn7PHZuiJIRUkyKCyujbbSwAgY3fow=; b=ozOH8TXpE8ShO9Nbul+kqzCwVD0stbtKWnGxbwtAWbJfJztCg5nOK+Nso0mSspls+Z VJIK6K8Y28704Qt3fZAUggZrn/oc4/l5yXDpiHUOvE+ejJmrHNu0WdvEWgLhuu9Yqyke qW7NIRUZPs/vQPKsyQiNDeyutUFDBaqBtYsKd3MdJ9AN1jOyGWpu0ocqqpPbAIVLesCY XK315M3zskcS4rpwOMlUblV17g/95y8n8Kz+b2nvHvMc3v1PvPlEsEkyRHk5nZoBwOCv y+IiJWdr7ZmuQq44ocX58/KmFUqbJpicpunhInIZTJPtHIMfuzfaCB3eDnZbeEJp7SB+ gNPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ec3n5Lsm; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k92si2959056otk.261.2020.04.02.15.25.45; Thu, 02 Apr 2020 15:25:58 -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=@gmail.com header.s=20161025 header.b=ec3n5Lsm; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389725AbgDBWZS (ORCPT + 99 others); Thu, 2 Apr 2020 18:25:18 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43047 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbgDBWZR (ORCPT ); Thu, 2 Apr 2020 18:25:17 -0400 Received: by mail-lj1-f193.google.com with SMTP id g27so4936586ljn.10; Thu, 02 Apr 2020 15:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+2mkX6A1G0+Xunn7PHZuiJIRUkyKCyujbbSwAgY3fow=; b=ec3n5LsmhX/SkYSDvUqFz2mqyPUykh1na58jXLUYuGXFEG8bRsoTDTZBV13aEU6PeT yNSIW7mCAu21B8zCC33+jdKq4ysCjUxIkOcjh1wtmUQm8HOGNR3qzP6NJ7rxnuOqGewM YNXva8VfwcxLHO+VPD250rbWLsQ7UNRI8tsdqJzcJqPhgYXbCPVt2S1CMI8GUL0k54k6 xR8TTJqBk+FLCRvWztq23pK2sU6FrCygjEHPSW/zHBATd020+VGZT6/1FNh/mS/07E/V DdcT4ego7E57+JBT0Zn6LbuUOMwkHrUNU+/2klymqriu3rerFml5JFDBGfEUTZzS6TlY 4nmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+2mkX6A1G0+Xunn7PHZuiJIRUkyKCyujbbSwAgY3fow=; b=H4hfI60PH5RlhVeIl86hMYKJP/EGNp3ZxoTQi9D7Gw9gsxIb3kHTMutB4mkT+ZqnOB DCZ1tWIeV27CyqJbk54wSjWoGtTfeXwtLMavHXGmLFE9dg55ec0NbKCy9Izz18ecOzTf 99f8AUiZGfZ9dOsQO2huLRe4h+6PJAyeNoZLr30Ygt7St6nwHoGoNnmowGowqLPzclDl 21d0SspfULSUj9/GZXkFs+hrVDo1caf6Id1loGZ9Jxy00H7iiuQQr1eQQZTgIC4/Il/j WbZSIj7mJN0bieQtXQG7YQYvHgYge+YkuAc80Rb/MPajoMs2Fme1o6NB8kOuPJhrl2AZ Ne+A== X-Gm-Message-State: AGi0PuY5vG4vrP3BXBvwoFySDAYPvSbFPfW9FBJ359+n52efTLMNtgHk 0ck5s6BIMrWTkFu3fTaXM/o= X-Received: by 2002:a2e:b6c2:: with SMTP id m2mr3201743ljo.59.1585866315290; Thu, 02 Apr 2020 15:25:15 -0700 (PDT) Received: from localhost.localdomain (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.gmail.com with ESMTPSA id f6sm4815139lfm.40.2020.04.02.15.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 15:25:14 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Jonathan Hunter Cc: linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting Date: Fri, 3 Apr 2020 01:24:48 +0300 Message-Id: <20200402222448.8320-1-digetx@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We're taking into account both HW memory-accesses + CPU activity based on current CPU's frequency. For memory-accesses there is a kind of hysteresis in a form of "boosting" which is managed by the tegra30-devfreq driver. If current HW memory activity is higher than activity judged based of the CPU's frequency, then there is no need to schedule cpufreq_update_work because the result of the work will be a NO-OP. And thus, tegra_actmon_cpufreq_contribution() should return 0, meaning that at the moment CPU frequency doesn't contribute anything to the final decision about required memory clock rate. Signed-off-by: Dmitry Osipenko --- Changelog: v2: - Made commit's message more detailed, which was requested by Chanwoo Choi in the review comment to v1. - This patch is now made to be standalone because there are no dependencies in regards to this change. drivers/devfreq/tegra30-devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c index 28b2c7ca416e..dfc3ac93c584 100644 --- a/drivers/devfreq/tegra30-devfreq.c +++ b/drivers/devfreq/tegra30-devfreq.c @@ -420,7 +420,7 @@ tegra_actmon_cpufreq_contribution(struct tegra_devfreq *tegra, static_cpu_emc_freq = actmon_cpu_to_emc_rate(tegra, cpu_freq); - if (dev_freq >= static_cpu_emc_freq) + if (dev_freq + actmon_dev->boost_freq >= static_cpu_emc_freq) return 0; return static_cpu_emc_freq; -- 2.25.1