From: Sohil Mehta <sohil.mehta@intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
<linux-pm@vger.kernel.org>, <x86@kernel.org>,
Tony Luck <tony.luck@intel.com>,
Zhao Liu <zhao1.liu@linux.intel.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] cpufreq: ondemand: Update the efficient idle check for Intel extended Families
Date: Fri, 5 Sep 2025 14:32:38 -0700 [thread overview]
Message-ID: <67ffd6b7-55c2-4ee0-9243-44bf8336152d@intel.com> (raw)
In-Reply-To: <CAJZ5v0hw+797-mm3qA6PqQdA7hWyZKhkYobbvF+8MCvg1cHZvQ@mail.gmail.com>
On 9/4/2025 1:02 PM, Rafael J. Wysocki wrote:
>
> Since you are adding this #ifdef below, why don't you go a bit farther and do
>
>> +#ifdef CONFIG_X86
>> +#include <asm/cpu_device_id.h>
>
> static bool should_io_be_busy(void)
> {
> /* All Intel Family 6 and later processors have efficient idle. */
> return boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO;
> }
> #else
> static inline bool should_io_be_busy(void)
> {
> return false;
> }
>> +#endif
>> +
>> #include "cpufreq_ondemand.h"
>>
I am fine with this approach. Would moving the #define to the header be
slightly better?
Add to cpufreq_ondemand.h:
#ifdef CONFIG_X86
#include <asm/cpu_device_id.h>
bool od_should_io_be_busy(void);
#else
static inline bool od_should_io_be_busy(void) { return false; }
#endif
Then, cpufreq_ondemand.c doesn't need the #ifdefs. It can simply do:
bool od_should_io_be_busy(void)
{
/* For Intel, Family 6 and later have an efficient idle. */
return (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO);
}
next prev parent reply other threads:[~2025-09-05 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 18:36 [PATCH v3] cpufreq: ondemand: Update the efficient idle check for Intel extended Families Sohil Mehta
2025-09-04 20:02 ` Rafael J. Wysocki
2025-09-05 21:32 ` Sohil Mehta [this message]
2025-09-08 18:54 ` Rafael J. Wysocki
2025-09-08 19:02 ` Sohil Mehta
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=67ffd6b7-55c2-4ee0-9243-44bf8336152d@intel.com \
--to=sohil.mehta@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=viresh.kumar@linaro.org \
--cc=x86@kernel.org \
--cc=zhao1.liu@linux.intel.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox