Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3865869pxb; Tue, 17 Nov 2020 05:44:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZi0ERgqM0QA2cuOdx7d4SQrgXAnsv7Xo8sQ+NjiRWXOOJGUW6Xw/tgwYD87MyTuZvgePp X-Received: by 2002:a05:6402:783:: with SMTP id d3mr21143584edy.168.1605620669325; Tue, 17 Nov 2020 05:44:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620669; cv=none; d=google.com; s=arc-20160816; b=NWN+IUrfL1wNjZFuokX6GIyZAb3Huzh0QvH3BsOY6/RMMTHRHFZj7AqpXpYgrVaArt PjNlQM0q3+ygGa3mHcJR4GeCQQCOCLehBFIdXnLx543jVVvkPxXzypwu0afAuVJYgPzj TMoscBGphmxuL/w6c4cBNnIvnreOIGpwfRWiwUQG6G93l3vaddwvkU7bOQVBWNfn2ns6 YPWnlkDu6cZdaFoZj3nda9/RqhL7J4myD7vpGFuvQ04gEW7ZhxkRBjdzZ7TqvfhU0o8H d8t+eUGknA37QfgDlIoLwOFLgbLG6UxtwX3n+G/tZjGQPIocN+MbhDhFMLp2aGzJJkL8 rdOg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xBFiaJhnI869/4p3Z9NYZfMefcbeEMA/vmF4jPfqZvw=; b=otyys/LOpOFgLsNIkASQyxVFzPiE29YtyRoznGAACb8megbNsOI4j3+bT32sDSFacJ AeyJFW+On7zCmyo1Y1LP+LWVdhv3DKQfDjGwnruKj3QIKELJqiaUsv6qMI9YVHsB4ssR TzJ77oA5jWgA6s2e/8jiu/x/IwHzr7AB4tJRPwyng8Fvh2C6n/lqqC2fEucW9bmngLno pFbJjiSq9WwjqIVgOvICr5Qtq+mCGnSXi4YyP8GEdjc0Ex/rxcr9welH8uycezcIUc8t u8xFKHVbDzzSLKRuYtK2o/CwFmb8yz/sSNzS6lmk5REQ0fnE23Soedq9yZ7efsliLYpc GaIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SwrklAdA; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si13982003edc.21.2020.11.17.05.44.05; Tue, 17 Nov 2020 05:44:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SwrklAdA; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733104AbgKQNlb (ORCPT + 99 others); Tue, 17 Nov 2020 08:41:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:53722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733092AbgKQNl1 (ORCPT ); Tue, 17 Nov 2020 08:41:27 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74A2A206A5; Tue, 17 Nov 2020 13:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620487; bh=9IrT82M9DQYhzeoNHKJMJKpQDzlamVxhafriOdQlUgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwrklAdARzlZNhytYwiNc14e+0eCQNrBM7clJk70pY43sLax5ImS4txaUdUviLk2K 37NSRwZApzHDQCeGIQ0srhbNct19E1qTpJih2gDISniwt96lLtJw4AZX/Vq8Kg6YIk 3/0tLlXSol1aU0ayzUNIbvt+QXSo3LvDTQLtPR0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Rafael J. Wysocki" , Viresh Kumar Subject: [PATCH 5.9 236/255] cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET Date: Tue, 17 Nov 2020 14:06:16 +0100 Message-Id: <20201117122150.424011551@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki commit 218f66870181bec7aaa6e3c72f346039c590c3c2 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/cpufreq_performance.c | 1 + drivers/cpufreq/cpufreq_powersave.c | 1 + include/linux/cpufreq.h | 3 +++ 3 files changed, 5 insertions(+) --- a/drivers/cpufreq/cpufreq_performance.c +++ b/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, }; --- a/drivers/cpufreq/cpufreq_powersave.c +++ b/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 "); --- a/include/linux/cpufreq.h +++ b/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,