]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/power/x86/intel-speed-select: Print Version info when Incompatible API version...
authorZhang Rui <rui.zhang@intel.com>
Thu, 19 Mar 2026 05:52:55 +0000 (13:52 +0800)
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Sun, 5 Apr 2026 18:47:19 +0000 (11:47 -0700)
When running an old version intel-speed-select tool on newer platforms,
even with "intel-speed-select -v", the tool only complains about
"Incompatible API version", without giving the current version info.

Print Version info whenever Incompatible API version is detected.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
tools/power/x86/intel-speed-select/isst-config.c

index b1376411cfa44553a0631f82faab94ef2c683a41..1e156063141e65bc0b85f3e7e856dcb9d50e6307 100644 (file)
@@ -82,6 +82,11 @@ struct cpu_topology {
 
 static int read_only;
 
+static void print_version(void)
+{
+       fprintf(outf, "Version %s\n", version_str);
+}
+
 static void check_privilege(void)
 {
        if (!read_only)
@@ -1138,6 +1143,7 @@ static int isst_fill_platform_info(void)
        close(fd);
 
        if (isst_platform_info.api_version > supported_api_ver) {
+               print_version();
                printf("Incompatible API versions; Upgrade of tool is required\n");
                exit(1);
        }
@@ -3198,12 +3204,6 @@ static void usage(void)
        exit(0);
 }
 
-static void print_version(void)
-{
-       fprintf(outf, "Version %s\n", version_str);
-       exit(0);
-}
-
 static void cmdline(int argc, char **argv)
 {
        const char *pathname = "/dev/isst_interface";
@@ -3315,6 +3315,7 @@ static void cmdline(int argc, char **argv)
                        break;
                case 'v':
                        print_version();
+                       exit(0);
                        break;
                case 'b':
                        oob_mode = 1;