|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/3] x86/cpufreq: Clean up powernow registration
On 15.11.2021 10:27, Roger Pau Monné wrote:
> On Fri, Nov 12, 2021 at 06:28:16PM +0000, Andrew Cooper wrote:
>> @@ -353,25 +349,13 @@ static const struct cpufreq_driver __initconstrel
>> powernow_cpufreq_driver = {
>> .update = powernow_cpufreq_update
>> };
>>
>> -unsigned int __init powernow_register_driver()
>> +unsigned int __init powernow_register_driver(void)
>> {
>> - unsigned int i, ret = 0;
>> + if ( !(boot_cpu_data.x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
>> + return -ENODEV;
>>
>> - for_each_online_cpu(i) {
>> - struct cpuinfo_x86 *c = &cpu_data[i];
>> - if (!(c->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
>> - ret = -ENODEV;
>> - else
>> - {
>> - u32 eax, ebx, ecx, edx;
>> - cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
>> - if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE)
>> - ret = -ENODEV;
>> - }
>> - if (ret)
>> - return ret;
>> - }
>> + if ( !(cpuid_edx(CPUID_FREQ_VOLT_CAPABILITIES) & USE_HW_PSTATE) )
>> + return -ENODEV;
>
> I wonder if we could move this check into cpufreq_driver_init and get
> rid of powernow_register_driver.
That's a vendor specific leaf, so I'd prefer to keep checking it in
vendor-specific code. Dropping the vendor check from here would seem
reasonable, considering it's already done in the caller.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |