Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4170683pxb; Tue, 10 Nov 2020 09:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzv9ke9nEJdHsiF7x5S5IUtXOd1UY2Hxa4MOtvBfab1eTQFJVCLouKdbHEJu7usYz6WjhP4 X-Received: by 2002:aa7:c617:: with SMTP id h23mr21580545edq.154.1605029497008; Tue, 10 Nov 2020 09:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605029496; cv=none; d=google.com; s=arc-20160816; b=zj61PwvshwPIkjJgGMJpf94s5FYAh0m0TTdUqkN6amiqs4u59l9bOw/K2zt4kZMM3Q R0fSjJYm44Ys+mQoWNUFiz0dKX3iKnek16x7LbEfB3/lXJHlVCRklqFQNtOFus89RyPU XamhnI8xpr/XQrFFeTJVMr0wfdImlwuggiyq8CJm71gAOVqrLoQ0xHLpU4JGbO52gyZP O/04WtMghxF2OfT4zvy0xI6FyRfvdJLZpiUAGYdB5px3wL8JXe8KxHl9CBaqkciwAHHE j/EctkLa09OSe4k+K2kLJBdeR0Y8TQl+Lo6/NvW+2oKcPJ55r8MFgppTtkP9LcIZn+hX zN/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lnVUWWBxt3LBG/L2A+HxrTD4JjeE2SurkBMq3MIWxh8=; b=msSxg/eVrs2UjLQoD9az2uydeKGWFcn0Ho+wNmtF7a7B8qaWgjjhBjzrXYUlGZSM1t +lTERjZzOzegdaeSxGYpFBw3/GpieIQ6oqGjdm29qHT12umcCdVN2U8XoV9a0sUxLFUc 9ZS8iZ4IoBUvohpdz90+kfwKnpzRDkvMVJHHg0MRa2Lq4Yn4arsjAhTRw5zueRu2Clq9 5ZEzJVv3QRIJlsVlfDjNqoQj4w4geqMwKcpBxeMgfsAKWFEWtlXngy6N0O7JjJif/JPP bn8VKpko0GdvFM4g0s92bS/RQu4rzDQVcQpeobGcWXDsGHpWoSPq8iQHZZ+GtBX0zIWX Zr0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si6178475edw.160.2020.11.10.09.31.12; Tue, 10 Nov 2020 09:31:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730871AbgKJR2X (ORCPT + 99 others); Tue, 10 Nov 2020 12:28:23 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:64472 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726152AbgKJR2W (ORCPT ); Tue, 10 Nov 2020 12:28:22 -0500 Received: from 89-64-88-129.dynamic.chello.pl (89.64.88.129) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.520) id a3535b29aed76d2e; Tue, 10 Nov 2020 18:28:19 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Zhang Rui , LKML , Doug Smythies Subject: [PATCH v3 2/4] cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET Date: Tue, 10 Nov 2020 18:26:10 +0100 Message-ID: <11987196.RHpQgyFsab@kreacher> In-Reply-To: <11312387.r5AVKgp8zO@kreacher> References: <13269660.K2JYd4sGFX@kreacher> <11312387.r5AVKgp8zO@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Introduce a new governor flag, CPUFREQ_GOV_STRICT_TARGET, for the governors that want the target frequency to be set exactly to the given value without leaving any room for adjustments on the hardware side and set this flag for the powersave and performance governors. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq_performance.c | 1 + drivers/cpufreq/cpufreq_powersave.c | 1 + include/linux/cpufreq.h | 3 +++ 3 files changed, 5 insertions(+) Index: linux-pm/drivers/cpufreq/cpufreq_performance.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq_performance.c +++ linux-pm/drivers/cpufreq/cpufreq_performance.c @@ -20,6 +20,7 @@ static void cpufreq_gov_performance_limi static struct cpufreq_governor cpufreq_gov_performance = { .name = "performance", .owner = THIS_MODULE, + .flags = CPUFREQ_GOV_STRICT_TARGET, .limits = cpufreq_gov_performance_limits, }; Index: linux-pm/drivers/cpufreq/cpufreq_powersave.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq_powersave.c +++ linux-pm/drivers/cpufreq/cpufreq_powersave.c @@ -21,6 +21,7 @@ static struct cpufreq_governor cpufreq_g .name = "powersave", .limits = cpufreq_gov_powersave_limits, .owner = THIS_MODULE, + .flags = CPUFREQ_GOV_STRICT_TARGET, }; MODULE_AUTHOR("Dominik Brodowski "); Index: linux-pm/include/linux/cpufreq.h =================================================================== --- linux-pm.orig/include/linux/cpufreq.h +++ linux-pm/include/linux/cpufreq.h @@ -575,6 +575,9 @@ struct cpufreq_governor { /* For governors which change frequency dynamically by themselves */ #define CPUFREQ_GOV_DYNAMIC_SWITCHING BIT(0) +/* For governors wanting the target frequency to be set exactly */ +#define CPUFREQ_GOV_STRICT_TARGET BIT(1) + /* Pass a target to the cpufreq driver */ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,