Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3352535pxb; Mon, 9 Nov 2020 09:00:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeerOlksK81bnhpusD5KrYKJzub6kpn5yGrxphBwKflxQIgB5GSG4MJ7m9bO17O2S8xxxy X-Received: by 2002:a17:906:3a59:: with SMTP id a25mr16312616ejf.546.1604941231421; Mon, 09 Nov 2020 09:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604941231; cv=none; d=google.com; s=arc-20160816; b=SmcsNLzGdBjzbsQnuBWJS26CF3dGi9Bsqgf1YTKMwhkuFPk4WXWC84QlC3FjdQt3tP /1/sGeQ40VQrP4LEXf/6LVy2HyosOrVsLt9rWEYqhXlvNoR2yr32Sgfpt4tpZ28lrjKC X6aowFnzpZLAjLBXWcaWkOLBhMLcGUtb6iHN/zlcSqchJVoo3YGsGwPA9n1cOxou1Oml DvWX/6/5CWqTa3XJK207ANg22fRMUb44Z+RpxoWbhtxAL2hxJFJGtqIpt0dvrwE4ueFe XGgM3WIEo65DXn3Tcm4YCgqt7cYD4fAaGBywxc6HLsDa/Wofuwq2O6B0lkSWBWVKtTKv YJRw== 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=hxtjSm9CROHrxH8GjmfDu6igcUADMb7q3g/gItqd0wc=; b=jigBGO1LKBosfuCGP5+5DdJrapmipqFM4SbKn1YIV3wtcdsDM4T4HiDTkm2dHNhoq7 B2UqkQkZJXYFIDQn9xHoUOsNDOiL/HBUCehqEMerHXz2pB5OiCwPNpq3PHkc9dGfdqhC psulfEUQhh9Bz1ZuzeYTjNfaeBnuune93i0i3H4eCt/3hFTbHS9+smqVN9LDSmy7l28p 7oz/mP1sTDLNZTw+i1lL7LKiCw7xOTfVVPhiQ9upOJ6nOruxv92DmpcrfQUB6WSMw01q alK8WTC188Llm/WPCUkXEzTJr6IIlPDWF45lkXMlsM4MaUppgU6A82ouOixMNyeSWd7J NBKA== 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 a23si7975007edn.292.2020.11.09.09.00.07; Mon, 09 Nov 2020 09:00:31 -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 S1731126AbgKIQ5K (ORCPT + 99 others); Mon, 9 Nov 2020 11:57:10 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:61328 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730900AbgKIQ5H (ORCPT ); Mon, 9 Nov 2020 11:57:07 -0500 Received: from 89-64-87-89.dynamic.chello.pl (89.64.87.89) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.520) id 38f5c0c130c6c1e8; Mon, 9 Nov 2020 17:57:05 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Zhang Rui , LKML , Doug Smythies Subject: [PATCH v2 3/4] cpufreq: Add strict_target to struct cpufreq_policy Date: Mon, 09 Nov 2020 17:53:53 +0100 Message-ID: <2826323.52ZM0ncLkd@kreacher> In-Reply-To: <13269660.K2JYd4sGFX@kreacher> References: <13269660.K2JYd4sGFX@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 Add a new field to be set when the CPUFREQ_GOV_FLAG_STRICT_TARGET flag is set for the current governor to struct cpufreq_policy, so that the drivers needing to check CPUFREQ_GOV_FLAG_STRICT_TARGET do not have to access the governor object during every frequency transition. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/cpufreq.c | 2 ++ include/linux/cpufreq.h | 6 ++++++ 2 files changed, 8 insertions(+) Index: linux-pm/drivers/cpufreq/cpufreq.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq.c +++ linux-pm/drivers/cpufreq/cpufreq.c @@ -2280,6 +2280,8 @@ static int cpufreq_init_governor(struct } } + policy->strict_target = !!(policy->governor->flags & CPUFREQ_GOV_FLAG_STRICT_TARGET); + return 0; } Index: linux-pm/include/linux/cpufreq.h =================================================================== --- linux-pm.orig/include/linux/cpufreq.h +++ linux-pm/include/linux/cpufreq.h @@ -109,6 +109,12 @@ struct cpufreq_policy { bool fast_switch_enabled; /* + * Set if the CPUFREQ_GOV_FLAG_STRICT_TARGET flag is set for the + * current governor. + */ + bool strict_target; + + /* * Preferred average time interval between consecutive invocations of * the driver to set the frequency for this policy. To be set by the * scaling driver (0, which is the default, means no preference).