[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] x86/cpufreq: Clean up powernow registration


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 15 Nov 2021 12:17:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZJW83aJbUaqBjmdn56EQqm/Dr1O1eulsphlMqmmf6dc=; b=i0j4bvUnXXAWF50ZxhpNmZVp1xx2VSKpZTz2rhGL6Y0cVCIAPfi6bEMpP+akZeZF0wl/jFy83ccVzNL5aleMOFYXQQ7I8c1rkdn3N/HPeZnc7YMcCjTgaWAxqr+xWNgVx0hRFf/zfgobPYRNNsjIu0um0i0yWk5mDvC9PJ0gc8iU9Re88dML9S2J6HECIoJ4/JreKTQAdO1uheNwYiVpRD/517zWKTWo0baL55ITcGIxoOjmn/UEbeBsc8k6J+EP2ypkVGhasz1whCENAuVIxRvdslo6P9K3MLbC2yp/8c4vkR7boEJdVkeor/JOiks5HqNg7s9KRAKLTDHu2cywcw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PLHsaQskDkxjIcjP/uisBHTccgICPav05vU/aLLqBmANHDwRJT2CkvrHPl/lU/mHqXzS14yRWEiUpObfC53QMWlVd7mMwP2Hm4bOIGWq0cJoqV2EM19MWjcCCOnorw0Pt5GJpYrFqYBQ0qi4TIC4b70SmvCqh6mlFpwTicSYORStvTAfH+O2pGd8ojSMaWMn4XgP3pzgEfhvjqpJhDZCewGPjzQ3xEjT9gp3/mkl8gYB8w0mMztXq96YAPW/9MZbCFbFljPjcyo0XG5e6JbiPS+nr+6N4cw9bXG5SnawNnnwnc6cwhAZyg3l5/P4ZFoi5an71NVrRFrp93LwnDrO1w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 15 Nov 2021 11:17:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.11.2021 19:28, Andrew Cooper wrote:
> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> @@ -640,13 +640,19 @@ static int __init cpufreq_driver_init(void)
>  {
>      int ret = 0;
>  
> -    if ((cpufreq_controller == FREQCTL_xen) &&
> -        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
> -        ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> -    else if ((cpufreq_controller == FREQCTL_xen) &&
> -        (boot_cpu_data.x86_vendor &
> -         (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
> -        ret = powernow_register_driver();
> +    if ( cpufreq_controller == FREQCTL_xen )
> +    {
> +        switch ( boot_cpu_data.x86_vendor )
> +        {
> +        case X86_VENDOR_INTEL:
> +            ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> +            break;

I've been wondering why we continue to tie this to Intel. I don't
think there's much Intel specific in the ACPI driver, so I wonder
whether this shouldn't use "default:" instead. But I can agree
that's likely better to be done in a separate change.

> @@ -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;

Ideally with this dropped (and of course with the issue pointed
out by Roger taken care of)

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.