]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tools/power/x86/intel-speed-select: Ignore missing config level
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Fri, 15 Nov 2019 20:35:22 +0000 (12:35 -0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 21 Nov 2019 12:27:32 +0000 (14:27 +0200)
It is possible that certain config levels are not available, even
if the max level includes the level. There can be missing levels in
some platforms. So ignore the level when called for information dump
for all levels and fail if specifically ask for the missing level.

Here the changes is to continue reading information about other levels
even if we fail to get information for the current level. But use the
"processed" flag to indicate the failure. When the "processed" flag is
not set, don't dump information about that level.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
tools/power/x86/intel-speed-select/isst-core.c
tools/power/x86/intel-speed-select/isst-display.c

index 52698553de92ac9acf05fafd338c70bc07e8945f..aa19c9998e6cdc800b3b4ccf11028df175d5a2f9 100644 (file)
@@ -646,7 +646,6 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
                             i);
                ctdp_level = &pkg_dev->ctdp_level[i];
 
-               ctdp_level->processed = 1;
                ctdp_level->level = i;
                ctdp_level->control_cpu = cpu;
                ctdp_level->pkg_id = get_physical_package_id(cpu);
@@ -654,7 +653,10 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
 
                ret = isst_get_ctdp_control(cpu, i, ctdp_level);
                if (ret)
-                       return ret;
+                       continue;
+
+               pkg_dev->processed = 1;
+               ctdp_level->processed = 1;
 
                if (ctdp_level->pbf_support) {
                        ret = isst_get_pbf_info(cpu, i, &ctdp_level->pbf_info);
@@ -724,8 +726,6 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
                isst_get_uncore_mem_freq(cpu, i, ctdp_level);
        }
 
-       pkg_dev->processed = 1;
-
        return 0;
 }
 
index c976bfe9b5032281ff28bbd8721745db3807e6bd..040dd09d5eee41ac23cb4f62b47ede5cac09e597 100644 (file)
@@ -315,7 +315,8 @@ void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
        char value[256];
        int i, base_level = 1;
 
-       print_package_info(cpu, outf);
+       if (pkg_dev->processed)
+               print_package_info(cpu, outf);
 
        for (i = 0; i <= pkg_dev->levels; ++i) {
                struct isst_pkg_ctdp_level_info *ctdp_level;