Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3678813pxb; Mon, 9 Nov 2020 18:45:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrnNE4pU1+s5wVrjSO1xM4+C2foWndtIIjq69FtpoNq/2kUY7DrpiAtCu0Tj88tcTal1Fh X-Received: by 2002:a17:906:4116:: with SMTP id j22mr17686771ejk.373.1604976351405; Mon, 09 Nov 2020 18:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604976351; cv=none; d=google.com; s=arc-20160816; b=pAMfaDfHL7qAlFWvM7KpLI0HI3krHtKC6ohFtKvdEujbI6U88olFAtX6pBArFcMVgN pbQVD/+vSH8m5uHZELxIZdMNaxiuu3+jdrALlrBBR2H7X/gk5lRT30jxaSOUFnz0zwfi hvWCNqK7o9WaW7GvsN/sCX7czztF6Rw++DwtQUiZr5JmDTclZTTCp/f+FvuVhOzin1Dc WGuF/+EGAGLFwU0uSBfBF93JZfwegbUcNnz+sT4ggEtS1ngudqttBbOVrrwF5jB0j+7B Bn1I3Tbxx7yHjn1gFa41HbejPsz9EFmymrFvZEYczjGnm5Xo0TKlsX4O6KAOghHiFiN4 VUeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WCOY4IMrlHpe9VU35gF/zByAnrSLbBEzV7qQu2kBJd4=; b=dwEiEJIeHgC7kykd2ROGjgZv76O/xeSgoRydK+ioR/aIffnjQY/jfoVlLUHgqOXZd0 taHK00G56QLwQDKPpEyQxSjIv7bczXmUKOX6WGVr21dOd6QQHyKRI6JoqoapxXxFVybb tp5Q1IZhzA+l1Zzm0qOuoZj3SjzhOrpINQMdT0Lq4KilDG1PsrwcwV27PndgyCcqrDcY YjkMAXMMR7H63kAx3ebAwcs18C0/BYbGChZMCPHG4GFNl428Irg9R05xFv1b2aqiaFOi dsemwOmxhlEHCU53oQyo0gbGZdr5hV5mOaIGQpXgmXMuiSsvh8/Wg3YEAb0cmOUg+pcp OxHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Lxn/uhOB"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf3si8332564ejb.78.2020.11.09.18.45.28; Mon, 09 Nov 2020 18:45:51 -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=@linaro.org header.s=google header.b="Lxn/uhOB"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730348AbgKJCl3 (ORCPT + 99 others); Mon, 9 Nov 2020 21:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730066AbgKJCl3 (ORCPT ); Mon, 9 Nov 2020 21:41:29 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DC54C0613CF for ; Mon, 9 Nov 2020 18:41:29 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id m13so702770pgl.7 for ; Mon, 09 Nov 2020 18:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WCOY4IMrlHpe9VU35gF/zByAnrSLbBEzV7qQu2kBJd4=; b=Lxn/uhOBDwxB83RBFnsrqtlFnW8KbcVFAhrlo9WKhTF4Sz2XTBcjv+xruokz1nKSUy A+2QWxXhhSLiMp19Civc3VZy3sfm8KHGlPaSGa+6+LDgNO8rysirWdgZstnsg1SBQo25 MWk10hJ998bf7gSKgxG9FgmbqsM+xCVH4XVY4ftdG8EAoXZutNwuqct1O2jVtt49g5Op ynnEKVB9sEGGazuHz6UzmGTqwT3wezsKNuAfYY3yCB2VdcN9XGrp3BBdnEdjddnHGi2G JfWpOXIKcvfs2v37vgoYTLg/HUZ0pQM60fiWzHQPezsc64CnNXHRCEAcrYC4kQS65Gd2 A7Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WCOY4IMrlHpe9VU35gF/zByAnrSLbBEzV7qQu2kBJd4=; b=aEd/G7OTrD1zwzY/4kwQZrxUeIVY/MjBdvxqmg4Q1cvc2KwxCNnGEUuz1V/WLGKa40 qkN8fu+4n9boEa18VWx49Nq4ceWBoVt+XraMu0x1ryAac4dseWzaV9lvf5ToRxP5UL7+ aCYAkp9AlagTHYxQTaD/IyTPRhHwP3b72wHV6mBWFlM2o8jnsgb26Zo8oGfCKX4fun3W ZSy6jMzHmHXh5euhSBBkx1zq00u4TaSoQfV7wI+xoKGgPPmezNWah/fSM5GlTy7qSm5U MtVt2D+qYR057JR59fMJx02AwpN83+QjzHOxGolYESLkPXxmDi82n4ld7i9gTGdZWykE koiA== X-Gm-Message-State: AOAM532gK6wFSDKJFvq/L0kEQ2pxElaN4AfrEdzJ0785NEIzEJfd91Z1 wX0FyDYvRpzhrNW5a721bp+gqA== X-Received: by 2002:a65:50c8:: with SMTP id s8mr8683055pgp.197.1604976089181; Mon, 09 Nov 2020 18:41:29 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id z22sm903214pje.16.2020.11.09.18.41.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2020 18:41:28 -0800 (PST) Date: Tue, 10 Nov 2020 08:11:26 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , "Rafael J. Wysocki" , Srinivas Pandruvada , Zhang Rui , LKML , Doug Smythies Subject: Re: [PATCH v2 1/4] cpufreq: Introduce governor flags Message-ID: <20201110024126.v4yxai5hpguj5p5b@vireshk-i7> References: <13269660.K2JYd4sGFX@kreacher> <1876249.M1ZxxmeKtZ@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1876249.M1ZxxmeKtZ@kreacher> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-11-20, 17:51, Rafael J. Wysocki wrote: > 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_FLAG_DYN_SWITCH to set for > the "dynamic switching" governors instead of it. > > No intentional functional impact. > > Signed-off-by: Rafael J. Wysocki > --- > 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 && I completely forgot that we had something like this :) > + if (policy->governor->flags & CPUFREQ_GOV_FLAG_DYN_SWITCH && > 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_FLAG_DYN_SWITCH, \ > .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_FLAG_DYN_SWITCH BIT(0) Maybe just drop the FLAG_ part as we don't use it for other cpufreq related flags as well. That will also give us space to write DYN as DYNAMIC (it may be better as we use the full name in CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING). Acked-by: Viresh Kumar -- viresh