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

[xen staging] xen/cpufreq: add missing default: case for x86 vendor



commit a3bb13bac9ee127cf66a6609595d48e9d4052ac6
Author:     Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Tue Aug 26 08:39:51 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 26 08:39:51 2025 +0200

    xen/cpufreq: add missing default: case for x86 vendor
    
    Since we are missing default case for x86 vendor, there is possibility (i.e.
    new vendor introduced) that we will return successfully while missing the
    whole cpufreq driver initialization process.
    Move "ret = -ENOENT" forward to cover default case for x86 vendor, and add
    error log.
    
    Requested-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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c 
b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index d18735c7ae..e227376bab 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -131,11 +131,11 @@ static int __init cf_check cpufreq_driver_init(void)
 
     if ( cpufreq_controller == FREQCTL_xen )
     {
+        ret = -ENOENT;
+
         switch ( boot_cpu_data.x86_vendor )
         {
         case X86_VENDOR_INTEL:
-            ret = -ENOENT;
-
             for ( unsigned int i = 0; i < cpufreq_xen_cnt; i++ )
             {
                 switch ( cpufreq_xen_opts[i] )
@@ -162,6 +162,10 @@ static int __init cf_check cpufreq_driver_init(void)
         case X86_VENDOR_HYGON:
             ret = IS_ENABLED(CONFIG_AMD) ? powernow_register_driver() : 
-ENODEV;
             break;
+
+        default:
+            printk(XENLOG_ERR "Cpufreq: unsupported x86 vendor\n");
+            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®.