File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1977,6 +1977,7 @@ static bool core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq)
1977
1977
static bool intel_set_max_freq_ratio (void )
1978
1978
{
1979
1979
u64 base_freq , turbo_freq ;
1980
+ u64 turbo_ratio ;
1980
1981
1981
1982
if (slv_set_max_freq_ratio (& base_freq , & turbo_freq ))
1982
1983
goto out ;
@@ -2010,9 +2011,15 @@ static bool intel_set_max_freq_ratio(void)
2010
2011
return false;
2011
2012
}
2012
2013
2013
- arch_turbo_freq_ratio = div_u64 (turbo_freq * SCHED_CAPACITY_SCALE ,
2014
- base_freq );
2014
+ turbo_ratio = div_u64 (turbo_freq * SCHED_CAPACITY_SCALE , base_freq );
2015
+ if (!turbo_ratio ) {
2016
+ pr_debug ("Non-zero turbo and base frequencies led to a 0 ratio.\n" );
2017
+ return false;
2018
+ }
2019
+
2020
+ arch_turbo_freq_ratio = turbo_ratio ;
2015
2021
arch_set_max_freq_ratio (turbo_disabled ());
2022
+
2016
2023
return true;
2017
2024
}
2018
2025
You can’t perform that action at this time.
0 commit comments