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

[xen staging] x86/cpufreq: continue looping other than -EBUSY or successful return



commit 513d2967956be2c76548719473fc5f690225749e
Author:     Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Thu Jul 17 08:56:02 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jul 17 08:56:02 2025 +0200

    x86/cpufreq: continue looping other than -EBUSY or successful return
    
    Right now, only when we failed cpufreq driver registration with -ENODEV, we 
get
    the chance to try the fallback option.
    There are two code path erroring out other than -ENODEV in cpufreq driver
    registration: one is when the driver itself is broken, like missing 
mandatory
    hooks, cpufreq_register_driver() will fail with -EINVAL, in which we shall
    be able to try the fallback option, and the other is -EBUSY due to repeated
    registration, in which we shall just exit the loop.
    
    So in conclusion, when error code is -EBUSY or successful return, both
    indicating a proper driver is already registered, we shall bail the loop,
    other than that, we shall continue to try the fallback option.
    
    Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c 
b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 61e98b67bd..45f301f354 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -150,7 +150,7 @@ static int __init cf_check cpufreq_driver_init(void)
                     break;
                 }
 
-                if ( ret != -ENODEV )
+                if ( !ret || ret == -EBUSY )
                     break;
             }
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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