intel_pstate: Change busy calculation to use fixed point math.
authorDirk Brandewie <dirk.j.brandewie@intel.com>
Tue, 25 Feb 2014 18:35:37 +0000 (10:35 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 25 Feb 2014 23:56:49 +0000 (00:56 +0100)
commite66c176837462928a05a135bbe16cdce70536d6e
tree3f2b47b1f93f84efa151fd9c5596a3d7238fa080
parentcfbf8d4857c26a8a307fb7cd258074c9dcd8c691
intel_pstate: Change busy calculation to use fixed point math.

Commit fcb6a15c2e (intel_pstate: Take core C0 time into account for
core busy calculation) introduced a regression on some processor SKUs
supported by intel_pstate. This was due to the truncation caused by
using integer math to calculate core busy and C0 percentages.

On a i7-4770K processor operating at 800Mhz going to 100% utilization
the percent busy of the CPU using integer math is 22%, but it actually
is 22.85%.  This value scaled to the current frequency returned 97
which the PID interpreted as no error and did not adjust the P state.

Tested on i7-4770K, i7-2600, i5-3230M.

Fixes: fcb6a15c2e7e (intel_pstate: Take core C0 time into account for core busy calculation)
References: https://lkml.org/lkml/2014/2/19/626
References: https://bugzilla.kernel.org/show_bug.cgi?id=70941
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c