From: "Rafael J. Wysocki" <rafael@kernel.org> To: Beata Michalska <beata.michalska@arm.com> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, sumitg@nvidia.com, sudeep.holla@arm.covm, will@kernel.org, catalin.marinas@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, ionela.voinescu@arm.com, yang@os.amperecomputing.com, linux-tegra@vger.kernel.org Subject: Re: [PATCH v2 2/2] cpufreq: Wire-up arch-flavored freq info into cpufreq_verify_current_freq Date: Wed, 6 Dec 2023 21:41:05 +0100 [thread overview] Message-ID: <CAJZ5v0jh3mG3hyFS6war=0bk3PvsVtTwZ1_YwwWov36Bmz7q0w@mail.gmail.com> (raw) In-Reply-To: <20231127160838.1403404-3-beata.michalska@arm.com> On Mon, Nov 27, 2023 at 5:09 PM Beata Michalska <beata.michalska@arm.com> wrote: > > From: Sumit Gupta <sumitg@nvidia.com> > > When available, use arch_freq_get_on_cpu to obtain current frequency > (usually an average reported over given period of time) > to better align the cpufreq's view on the current state of affairs. And why is this a good idea? Any problem statement? > This also automatically pulls in the update for cpuinfo_cur_freq sysfs > attribute, aligning it with the scaling_cur_freq one, and thus providing > consistent view on relevant platforms. I have no idea what the above is supposed to mean, sorry. > Signed-off-by: Sumit Gupta <sumitg@nvidia.com> > [BM: Subject & commit msg] > Signed-off-by: Beata Michalska <beata.michalska@arm.com> > --- > drivers/cpufreq/cpufreq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 8c4f9c2f9c44..109559438f45 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1756,7 +1756,8 @@ static unsigned int cpufreq_verify_current_freq(struct cpufreq_policy *policy, b > { > unsigned int new_freq; > > - new_freq = cpufreq_driver->get(policy->cpu); > + new_freq = arch_freq_get_on_cpu(policy->cpu); > + new_freq = new_freq ?: cpufreq_driver->get(policy->cpu); Please don't use ?: in general and it is not even useful here AFAICS. What would be wrong with new_freq = arch_freq_get_on_cpu(policy->cpu); if (!new_freq) new_freq = cpufreq_driver->get(policy->cpu); ? > if (!new_freq) > return 0; > > --
WARNING: multiple messages have this Message-ID (diff)
From: "Rafael J. Wysocki" <rafael@kernel.org> To: Beata Michalska <beata.michalska@arm.com> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, sumitg@nvidia.com, sudeep.holla@arm.covm, will@kernel.org, catalin.marinas@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, ionela.voinescu@arm.com, yang@os.amperecomputing.com, linux-tegra@vger.kernel.org Subject: Re: [PATCH v2 2/2] cpufreq: Wire-up arch-flavored freq info into cpufreq_verify_current_freq Date: Wed, 6 Dec 2023 21:41:05 +0100 [thread overview] Message-ID: <CAJZ5v0jh3mG3hyFS6war=0bk3PvsVtTwZ1_YwwWov36Bmz7q0w@mail.gmail.com> (raw) In-Reply-To: <20231127160838.1403404-3-beata.michalska@arm.com> On Mon, Nov 27, 2023 at 5:09 PM Beata Michalska <beata.michalska@arm.com> wrote: > > From: Sumit Gupta <sumitg@nvidia.com> > > When available, use arch_freq_get_on_cpu to obtain current frequency > (usually an average reported over given period of time) > to better align the cpufreq's view on the current state of affairs. And why is this a good idea? Any problem statement? > This also automatically pulls in the update for cpuinfo_cur_freq sysfs > attribute, aligning it with the scaling_cur_freq one, and thus providing > consistent view on relevant platforms. I have no idea what the above is supposed to mean, sorry. > Signed-off-by: Sumit Gupta <sumitg@nvidia.com> > [BM: Subject & commit msg] > Signed-off-by: Beata Michalska <beata.michalska@arm.com> > --- > drivers/cpufreq/cpufreq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 8c4f9c2f9c44..109559438f45 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1756,7 +1756,8 @@ static unsigned int cpufreq_verify_current_freq(struct cpufreq_policy *policy, b > { > unsigned int new_freq; > > - new_freq = cpufreq_driver->get(policy->cpu); > + new_freq = arch_freq_get_on_cpu(policy->cpu); > + new_freq = new_freq ?: cpufreq_driver->get(policy->cpu); Please don't use ?: in general and it is not even useful here AFAICS. What would be wrong with new_freq = arch_freq_get_on_cpu(policy->cpu); if (!new_freq) new_freq = cpufreq_driver->get(policy->cpu); ? > if (!new_freq) > return 0; > > -- _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-12-06 20:41 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-27 16:08 [PATCH v2 0/2] Add support for AArch64 AMUv1-based arch_freq_get_on_cpu Beata Michalska 2023-11-27 16:08 ` Beata Michalska 2023-11-27 16:08 ` [PATCH v2 1/2] arm64: Provide an AMU-based version of arch_freq_get_on_cpu Beata Michalska 2023-11-27 16:08 ` Beata Michalska 2023-11-28 15:13 ` Ionela Voinescu 2023-11-28 15:13 ` Ionela Voinescu 2024-02-02 9:20 ` Beata Michalska 2024-02-02 9:20 ` Beata Michalska 2024-02-22 19:55 ` Vanshidhar Konda 2024-02-22 19:55 ` Vanshidhar Konda 2023-11-27 16:08 ` [PATCH v2 2/2] cpufreq: Wire-up arch-flavored freq info into cpufreq_verify_current_freq Beata Michalska 2023-11-27 16:08 ` Beata Michalska 2023-11-28 14:01 ` Ionela Voinescu 2023-11-28 14:01 ` Ionela Voinescu 2023-12-01 13:02 ` Sumit Gupta 2023-12-01 13:02 ` Sumit Gupta 2023-12-05 11:05 ` Ionela Voinescu 2023-12-05 11:05 ` Ionela Voinescu 2023-12-06 13:28 ` Sumit Gupta 2023-12-06 13:28 ` Sumit Gupta 2023-12-07 9:22 ` Ionela Voinescu 2023-12-07 9:22 ` Ionela Voinescu 2023-12-08 15:34 ` Sumit Gupta 2023-12-08 15:34 ` Sumit Gupta 2024-02-02 9:14 ` Beata Michalska 2024-02-02 9:14 ` Beata Michalska 2023-12-06 20:41 ` Rafael J. Wysocki [this message] 2023-12-06 20:41 ` Rafael J. Wysocki 2024-02-02 9:05 ` Beata Michalska 2024-02-02 9:05 ` Beata Michalska
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAJZ5v0jh3mG3hyFS6war=0bk3PvsVtTwZ1_YwwWov36Bmz7q0w@mail.gmail.com' \ --to=rafael@kernel.org \ --cc=beata.michalska@arm.com \ --cc=catalin.marinas@arm.com \ --cc=ionela.voinescu@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-tegra@vger.kernel.org \ --cc=sudeep.holla@arm.covm \ --cc=sumitg@nvidia.com \ --cc=viresh.kumar@linaro.org \ --cc=will@kernel.org \ --cc=yang@os.amperecomputing.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.