We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9db14ba commit f1d38fcCopy full SHA for f1d38fc
crates/power-daemon/src/systeminfo.rs
@@ -234,8 +234,16 @@ impl CPUInfo {
234
235
let cpufreq_path = entry.path().join("cpufreq/");
236
237
- let base_frequency =
238
- file_content_to_u32(cpufreq_path.join("base_frequency")) / 1000;
+ let base_frequency_path = cpufreq_path.join("base_frequency");
+
239
+ // Some cpu's straight up do not have base_frequency and it's
240
+ // not mentioned anywhere in kernel docs
241
+ let base_frequency = if fs::metadata(&base_frequency_path).is_ok() {
242
+ file_content_to_u32(base_frequency_path) / 1000
243
+ } else {
244
+ 0
245
+ };
246
247
let current_frequency =
248
file_content_to_u32(cpufreq_path.join("scaling_cur_freq")) / 1000;
249
0 commit comments