Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1649108ybg; Wed, 29 Jul 2020 21:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+dJ68gCP0NWN+SjbwsOzjpzpOU9+SVaiWqmcZ3o+TaXOVRs8BhjXjZL+xaPYW7diLGXPx X-Received: by 2002:a17:906:b352:: with SMTP id cd18mr812444ejb.230.1596084399964; Wed, 29 Jul 2020 21:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596084399; cv=none; d=google.com; s=arc-20160816; b=RIL/ATuHczdg3YDuG4snAMzGVfunPHcqi5lM38rCUeGXMHKRn04ldCbA2clR7/NBQx OMFPX0K2jC4APU2sEznRIwOYRx0ibxKiZOTLU/z9GLMzia6aL9UexTVGqa/a877L0dQb 23+KVPjrX83aGU8GiLnQ5zb9/jfNSxVWg0hrW2S48esPhdJiFLnpqtr4enrVvvLBLlIH dNqcp30cqj8AW0HhVSP1mOAicSQH4wIa9g0XmJ0OTduvhjC5Ep6gXOA1bC3qlivUJeJ1 mKf1fOMbRxDF74AJV6COd28PZ6E9ujV4fFgEF4CA0pGp9MoSth7oTWTKISNFi82fPWH8 DjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wF05xhf0pmO+SSDfaVtMOIn5xpcwCosKEIhsXa5iKW0=; b=EPKnpg9nWQcrjmJ2AttDgBrYaCZjwnNlyjZf6rgcxSkhDIrDz71LhoPh8KZvumK74V T9wbRpIKMdsh5zFQt87oQBPlknFnkF4bWjn9ws0tpKhog8rvHJC3zMmTxe9zp4iwyCnV E36qjScqTb9Zc2caWORNiLhTVyPiGLnVX3UOLF85GrbcHH93ActsvCUbYl3AgYgrse2X PmUszxWR9gGvZ9cP74ZtGHS4Ye1VoCe/tjS+XR8nktjYfhLtAWksU0th0gBs+YtKSebw uogHSLESY55L5cmGXyHf87bbY7TlFZVIMo8dXfD7OfWo5xamtudd1armvPyxGMTGP1xw Ar5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fzel8Nfe; 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 nf1si2394471ejb.527.2020.07.29.21.46.14; Wed, 29 Jul 2020 21:46:39 -0700 (PDT) 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=fzel8Nfe; 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 S1726275AbgG3Enu (ORCPT + 99 others); Thu, 30 Jul 2020 00:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgG3Enu (ORCPT ); Thu, 30 Jul 2020 00:43:50 -0400 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 0CE05C061794 for ; Wed, 29 Jul 2020 21:43:50 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id l12so4762133pgt.13 for ; Wed, 29 Jul 2020 21:43:49 -0700 (PDT) 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=wF05xhf0pmO+SSDfaVtMOIn5xpcwCosKEIhsXa5iKW0=; b=fzel8NfefEAXLrAbNWtDcfYD0YL3yGUJOZ3zytgP3tVwdyw20MGYQzzKYicNU9dZru ZYDVRNCXeeALbgfgg7WKV8Gz5ueVQ9X12Ypfah1VBwaQbAAzjmkkUNRaGmSJLcaY7eFH 30rB53RFoOHvXqK0yuFOFX6oekKlie4+nLSSMBDlQNV4BoBrKJiAbDsVaPwQH5N71GFo 8y3/iSrAWU26TB6qnbDiKcQVDw9vTTyYl6QEjfRpPhbfWP9grtYdwN0ejgxda8HI/1n2 qfkQYKGpZ5yLugfXZtPpyxJUqEKAKTD4DmzOx+pd9moHzFYO5o0Ro3KUKwkExoEkl5CN ODTQ== 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=wF05xhf0pmO+SSDfaVtMOIn5xpcwCosKEIhsXa5iKW0=; b=nPXam3GUDFcfKWJ3ipFYqXM644aTOHS5kOkALNS10vkqy1pGNBiqMoxCm2zrkA6o63 TlFgklchSO9npglQF5HnfG9QZeUhTy6deZJrKI2v5eUpn+EolmC+RRQef/1ukYSwB/pQ YFBmPBlnCZAT/Nz9oVn8m0gyyugnwjOea8xszFdDWEbZdhbdROyPDT89R+sETL7hpFPB HYH5yPI5mUNIew6Aq+buNjZ8gPHBKS+q/m9PfX75r/LnAYy97iq9ysDLWLa8XypEg5V3 B41rXSklfvXY2+Yi09onriQ+86ClWC7QVdLnWeZn08bc+gTnaJUp+jvsfUeQllAmQSVq a3NA== X-Gm-Message-State: AOAM531ku3/NaVJoU+Bc0iyH5NuM1JCQzLHWyvGaWc34fU46/yjwzgB+ Wn23P+88Tb6Asw6qBN6Durqd9A== X-Received: by 2002:a63:f316:: with SMTP id l22mr31659281pgh.291.1596084229406; Wed, 29 Jul 2020 21:43:49 -0700 (PDT) Received: from localhost ([106.201.14.19]) by smtp.gmail.com with ESMTPSA id t184sm4334122pfd.49.2020.07.29.21.43.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 21:43:48 -0700 (PDT) Date: Thu, 30 Jul 2020 10:13:46 +0530 From: Viresh Kumar To: Ionela Voinescu Cc: rjw@rjwysocki.net, dietmar.eggemann@arm.com, catalin.marinas@arm.com, sudeep.holla@arm.com, will@kernel.org, linux@armlinux.org.uk, mingo@redhat.com, peterz@infradead.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/7] cpufreq: report whether cpufreq supports Frequency Invariance (FI) Message-ID: <20200730044346.rgtaikotkgwdpc3m@vireshk-mac-ubuntu> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-5-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722093732.14297-5-ionela.voinescu@arm.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-07-20, 10:37, Ionela Voinescu wrote: > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 3497c1cd6818..1d0b046fe8e9 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -61,6 +61,9 @@ static struct cpufreq_driver *cpufreq_driver; > static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); > static DEFINE_RWLOCK(cpufreq_driver_lock); > > +/* Mark support for the scheduler's frequency invariance engine */ > +static DEFINE_STATIC_KEY_FALSE(cpufreq_set_freq_scale); > + > /* Flag to suspend/resume CPUFreq governors */ > static bool cpufreq_suspended; > > @@ -69,6 +72,25 @@ static inline bool has_target(void) > return cpufreq_driver->target_index || cpufreq_driver->target; > } > > +static inline > +void enable_cpufreq_freq_invariance(struct cpufreq_driver *driver) > +{ > + if ((driver->target || driver->target_index || driver->fast_switch) && > + !driver->setpolicy) { Just checking for !driver->setpolicy should be enough here. > + static_branch_enable_cpuslocked(&cpufreq_set_freq_scale); > + pr_debug("%s: Driver %s can provide frequency invariance.", > + __func__, driver->name); I think a simpler print will work well too. pr_debug("Freq invariance enabled"); __func__ isn't really required as this is the only print with that kind of info in cpufreq.c. > + } else > + pr_err("%s: Driver %s cannot provide frequency invariance.", > + __func__, driver->name); Why not supporting freq-invariance an error ? I will just drop this message completely. -- viresh