platform/x86: intel-uncore-freq: Conditionally create attribute for read frequency
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 4 Oct 2023 18:19:15 +0000 (11:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:15 +0000 (12:03 +0200)
commit52d54f1d4e032204f2bf53fb04afb89d7f7ab6e5
treea085eae0f1db2ef09f036afe98b348e07fa4c9fe
parent8a4b575d00ef9051bf66ca3a564b86cd776e0595
platform/x86: intel-uncore-freq: Conditionally create attribute for read frequency

commit 4d73c6772ab771cbbe7e46a73e7c78ba490350fa upstream.

When the current uncore frequency can't be read, don't create attribute
"current_freq_khz" as any read will fail later. Some user space
applications like turbostat fail to continue with the failure. So, check
error during attribute creation.

Fixes: 414eef27283a ("platform/x86/intel/uncore-freq: Display uncore current frequency")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231004181915.1887913-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c