Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4169491pxb; Tue, 10 Nov 2020 09:30:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN5M4D3oW6jKleu9LXXhvoH5N9xtDMMM5mxZk2DZKK0zZ5CGgIZlGHIsOkfWwzciCOQRC9 X-Received: by 2002:aa7:c358:: with SMTP id j24mr22399330edr.265.1605029410210; Tue, 10 Nov 2020 09:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605029410; cv=none; d=google.com; s=arc-20160816; b=pl9FRCkoRa904crQlMkFk7Tcx0/k+dBal9/A+wky45KNOHstjjZFnsrBvtYPB5yxa3 4wCv7XJBCIBrTJCZ2pGPDSDCNx9VUxadmX+O9FgPjnl3WHoJTh5bidopzAF8n+gfFIhh c24W/TaEcetHxqoNMg6hYHq4yVER9QdUUzKjjG/VnaUIogGNWoD55o2OBJ+947UW5OZD DFdRDdBJ6A0kfXp9xLHKakpu5sNklCy47BbWQZTLgM2TkTjL3wMJbk98l3JnxuDSBCgX v9sUn7K4fXUilFcM3Yi/BzqMLFPHF2u5nbRNXvz1xQ7yJz678IPjxz2UqADcAXjFnuTS z8Mw== 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=+vsvzlaCcld35/yDA16USIC2mtEptfc/Fiy02qi552U=; b=pp7pCLtaUwdIXoCabomgEY5LRqvbB0PWDLaOat7oc250ZcbEjvxD8x4sh1MjknrbZv KDRzWzGE0BLv7s+pHjuyXASxmbTlEcGQS2ZfGpCxk2U4JAavE8aJ174l6KEx+eb0zems s1ewNAcBI/Rb/mFK3JcOs7DM38pur3KxlGpPdRVVNmDcKoHK4PlRvH5JfHcuZ9Sa9Evf rzuZefeP5DxcjszofSMEB1BZNcpNh5RPHC+wjHN5LicT00fgjbhd/ctoRhQUSHo2Ec1Z t/+26KgaLcN12SWaHvfwk/1h63EoGR0Uxm1jXamyuLUEOrWjs5URwYrvATDVyGjFp9Ww MvTw== 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 p9si9730679eja.144.2020.11.10.09.29.45; Tue, 10 Nov 2020 09:30:10 -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 S1730796AbgKJR2V (ORCPT + 99 others); Tue, 10 Nov 2020 12:28:21 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:51620 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730164AbgKJR2U (ORCPT ); Tue, 10 Nov 2020 12:28:20 -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 6021c75f9d64ef1b; Tue, 10 Nov 2020 18:28:18 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Zhang Rui , LKML , Doug Smythies Subject: [PATCH v3 3/4] cpufreq: Add strict_target to struct cpufreq_policy Date: Tue, 10 Nov 2020 18:26:37 +0100 Message-ID: <17647050.Bfk6z5ThJy@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 Add a new field to be set when the CPUFREQ_GOV_STRICT_TARGET flag is set for the current governor to struct cpufreq_policy, so that the drivers needing to check CPUFREQ_GOV_STRICT_TARGET do not have to access the governor object during every frequency transition. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- 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_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_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).