On 2016-01-22 01:15, Prarit Bhargava wrote:
> Some systems erroneously set the maximum time window field of
> MSR_PKG_POWER_INFO register to 0. This results in a user not being able
> to set the time windows for the package. In some cases, however, RAPL
> will still continue to work with a small window (albeit through some
> trial and error). This patch adds a ignore_max_time_window_check module
> parameter to avoid the maximum time window check in set_time_window().
>
> [v2]: change name to max_time_window_check, fix (val == 0) check
>
> Cc: "Rafael J. Wysocki" <[email protected]>
> Cc: Prarit Bhargava <[email protected]>
> Cc: Radivoje Jovanovic <[email protected]>
> Cc: Seiichi Ikarashi <[email protected]>
> Cc: Mathias Krause <[email protected]>
> Cc: Ajay Thomas <[email protected]>
> Signed-off-by: Prarit Bhargava <[email protected]>
> ---
> drivers/powercap/intel_rapl.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
> index 14753e5..939026d 100644
> --- a/drivers/powercap/intel_rapl.c
> +++ b/drivers/powercap/intel_rapl.c
> @@ -505,13 +505,24 @@ static int get_max_time_window(struct powercap_zone
> *power_zone, int id,
>
> if (rapl_read_data_raw(rd, MAX_TIME_WINDOW, true, &val))
> ret = -EIO;
> - else
> + else {
> *data = val;
> -
> + if (val == 0)
> + pr_warn_once(FW_BUG "intel_rapl: Maximum Time Window is
> zero. This is a BIOS bug that should be reported to your hardware or BIOS
> vendor. The value of zero may prevent Intel RAPL from functioning properly.
> Most bugs can be avoided by setting the ignore_max_window_check module
> parameter.\n");
The correct name is
ignore_max_time_window_check here.
--
Seiichi