From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CB86C2D0A3 for ; Tue, 10 Nov 2020 02:41:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBBFC20665 for ; Tue, 10 Nov 2020 02:41:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Lxn/uhOB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730482AbgKJCla (ORCPT ); Mon, 9 Nov 2020 21:41:30 -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-Google-Smtp-Source: ABdhPJwhYtOsJXeV0/ou8PbpvaNkFfROJ+N4JJ2Gdt/Jt7Y68WXn6m32bIjMNzk/cSYTrZ/nGz9lQQ== 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