All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] x86/intel_pstate: Handle runtime turbo disablement/enablement in frequency invariance
@ 2020-02-03 10:58 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-02-03 10:58 UTC (permalink / raw)
  To: kernel-janitors

Hello Giovanni Gherdovich,

The patch 918229cdd5ab: "x86/intel_pstate: Handle runtime turbo
disablement/enablement in frequency invariance" from Jan 22, 2020,
leads to the following static checker warning:

	arch/x86/kernel/smpboot.c:1988 intel_set_max_freq_ratio()
	error: uninitialized symbol 'turbo_freq'.

arch/x86/kernel/smpboot.c
  1964  static bool intel_set_max_freq_ratio(void)
  1965  {
  1966          u64 base_freq, turbo_freq;
  1967  
  1968          if (slv_set_max_freq_ratio(&base_freq, &turbo_freq))
  1969                  goto out;
  1970  
  1971          if (x86_match_cpu(has_glm_turbo_ratio_limits) &&
  1972              skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
  1973                  goto out;
  1974  
  1975          if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The last return here should be "false" instead of "true".  Otherwise we
use "turbo_freq" without initializing it.

  1976                  goto out;
  1977  
  1978          if (x86_match_cpu(has_skx_turbo_ratio_limits) &&
  1979              skx_set_max_freq_ratio(&base_freq, &turbo_freq, 4))
  1980                  goto out;
  1981  
  1982          if (core_set_max_freq_ratio(&base_freq, &turbo_freq))
  1983                  goto out;
  1984  
  1985          return false;
  1986  
  1987  out:
  1988          arch_turbo_freq_ratio = div_u64(turbo_freq * SCHED_CAPACITY_SCALE,
  1989                                          base_freq);
  1990          arch_set_max_freq_ratio(turbo_disabled());
  1991          return true;
  1992  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-03 10:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03 10:58 [bug report] x86/intel_pstate: Handle runtime turbo disablement/enablement in frequency invariance Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.