Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4172088pxb; Tue, 10 Nov 2020 09:33:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiWZy514D5YmSEocYXANO22rY/MJ2ukqZMGppXZG4gzcQ5YgDeQBgqYc9SZDKBfvh0hKds X-Received: by 2002:aa7:d98b:: with SMTP id u11mr451469eds.107.1605029601656; Tue, 10 Nov 2020 09:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605029601; cv=none; d=google.com; s=arc-20160816; b=NhBjB/DnmYobNQQNOsNAZCT1zheUZeUC5K6HSkVNGfewLN4E7U0aH3UJgOAQOW/URa kx7On/WdOEKG20I2DW6u7GneOgY51Sz2Tsxnu0Os2U8ZcsPiCw0246CYCE2d+F8CT2Ld htrVOp/Ze4PuWRcSz99vOtfw/je/w6AkNTmrOaFEQNog0mNbsDDFPbzXWETOw0qZd038 UVR9/qgKkdjhEJoiJ0JiQlU+IFcdCgh7OxKH+NllFLVEDsLuSZYgHEilERtphBg3tWi8 ki/X95AB4kcrwI0oFNnvzH9fajE4UMXk1EYUTjwGiKG1VK8Wa1EqpZlC0cTndUb5O8Sa 9WmQ== 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=nV0RSlHzFI5qjHYbELLbKCMEd00PJQGcfjBQ0MXBiQI=; b=ffRcApu2wr6RDc68UW4ziYst8mCYxlvUHJrx5n1vOxwwsb7j2MQwzibUyXpYQWuvZA KjJ7+q6N98cJ3AfTJYRLO0ll/xN1TKd0q9aZl2pu/LVW9KYy/t4AT9ojTNP8JuoeFeOJ ADx+lnM5jTPAedZTpopW1dppmlTMkJopN96xDI/yjPC/t/uziigaF2hrbAjkIsCgnSZM b9L6U4QC1pIv7Faq9Hr9/4gWbq+OgZPpxAoajSqxMunUcVE50ZmoMJmoOcoC6zkgawlJ KqazwCb4MuVeRMTJMgYbF05XeVplLmRnkDIOYviYUd+l7qgFLrNN35kiu+gjHNL3hRRB gR9A== 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 62si10558401edc.231.2020.11.10.09.32.54; Tue, 10 Nov 2020 09:33:21 -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 S1731065AbgKJR2b (ORCPT + 99 others); Tue, 10 Nov 2020 12:28:31 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:64718 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730788AbgKJR2W (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 eb18a5d101e080bd; Tue, 10 Nov 2020 18:28:20 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Zhang Rui , LKML , Doug Smythies Subject: [PATCH v3 1/4] cpufreq: Introduce governor flags Date: Tue, 10 Nov 2020 18:25:57 +0100 Message-ID: <2505524.E2vhmOMirR@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 A new cpufreq governor flag will be added subsequently, so replace the bool dynamic_switching fleid in struct cpufreq_governor with a flags field and introduce CPUFREQ_GOV_DYNAMIC_SWITCHING to set for the "dynamic switching" governors instead of it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/cpufreq_governor.h | 2 +- include/linux/cpufreq.h | 9 +++++++-- kernel/sched/cpufreq_schedutil.c | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) Index: linux-pm/drivers/cpufreq/cpufreq.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq.c +++ linux-pm/drivers/cpufreq/cpufreq.c @@ -2254,7 +2254,7 @@ static int cpufreq_init_governor(struct return -EINVAL; /* Platform doesn't want dynamic frequency switching ? */ - if (policy->governor->dynamic_switching && + if (policy->governor->flags & CPUFREQ_GOV_DYNAMIC_SWITCHING && cpufreq_driver->flags & CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING) { struct cpufreq_governor *gov = cpufreq_fallback_governor(); Index: linux-pm/drivers/cpufreq/cpufreq_governor.h =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq_governor.h +++ linux-pm/drivers/cpufreq/cpufreq_governor.h @@ -156,7 +156,7 @@ void cpufreq_dbs_governor_limits(struct #define CPUFREQ_DBS_GOVERNOR_INITIALIZER(_name_) \ { \ .name = _name_, \ - .dynamic_switching = true, \ + .flags = CPUFREQ_GOV_DYNAMIC_SWITCHING, \ .owner = THIS_MODULE, \ .init = cpufreq_dbs_governor_init, \ .exit = cpufreq_dbs_governor_exit, \ Index: linux-pm/include/linux/cpufreq.h =================================================================== --- linux-pm.orig/include/linux/cpufreq.h +++ linux-pm/include/linux/cpufreq.h @@ -565,12 +565,17 @@ struct cpufreq_governor { char *buf); int (*store_setspeed) (struct cpufreq_policy *policy, unsigned int freq); - /* For governors which change frequency dynamically by themselves */ - bool dynamic_switching; struct list_head governor_list; struct module *owner; + u8 flags; }; +/* Governor flags */ + +/* For governors which change frequency dynamically by themselves */ +#define CPUFREQ_GOV_DYNAMIC_SWITCHING BIT(0) + + /* Pass a target to the cpufreq driver */ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq); Index: linux-pm/kernel/sched/cpufreq_schedutil.c =================================================================== --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c +++ linux-pm/kernel/sched/cpufreq_schedutil.c @@ -881,7 +881,7 @@ static void sugov_limits(struct cpufreq_ struct cpufreq_governor schedutil_gov = { .name = "schedutil", .owner = THIS_MODULE, - .dynamic_switching = true, + .flags = CPUFREQ_GOV_DYNAMIC_SWITCHING, .init = sugov_init, .exit = sugov_exit, .start = sugov_start,