1. 22 Dec, 2021 1 commit
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Update cpuinfo.max_freq on HWP_CAP changes · dfeeedc1
      Rafael J. Wysocki authored
      With HWP enabled, when the turbo range of performance levels is
      disabled by the platform firmware, the CPU capacity is given by
      the "guaranteed performance" field in MSR_HWP_CAPABILITIES which
      is generally dynamic.  When it changes, the kernel receives an HWP
      notification interrupt handled by notify_hwp_interrupt().
      
      When the "guaranteed performance" value changes in the above
      configuration, the CPU performance scaling needs to be adjusted so
      as to use the new CPU capacity in computations, which means that
      the cpuinfo.max_freq value needs to be updated for that CPU.
      
      Accordingly, modify intel_pstate_notify_work() to read
      MSR_HWP_CAPABILITIES and update cpuinfo.max_freq to reflect the
      new configuration (this update can be carried out even if the
      configuration doesn't actually change, because it simply doesn't
      matter then and it takes less time to update it than to do extra
      checks to decide whether or not a change has really occurred).
      Reported-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dfeeedc1
  2. 17 Dec, 2021 3 commits
    • Rafael J. Wysocki's avatar
      cpufreq: Fix initialization of min and max frequency QoS requests · 521223d8
      Rafael J. Wysocki authored
      The min and max frequency QoS requests in the cpufreq core are
      initialized to whatever the current min and max frequency values are
      at the init time, but if any of these values change later (for
      example, cpuinfo.max_freq is updated by the driver), these initial
      request values will be limiting the CPU frequency unnecessarily
      unless they are changed by user space via sysfs.
      
      To address this, initialize min_freq_req and max_freq_req to
      FREQ_QOS_MIN_DEFAULT_VALUE and FREQ_QOS_MAX_DEFAULT_VALUE,
      respectively, so they don't really limit anything until user
      space updates them.
      Reported-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      521223d8
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Update EPP for AlderLake mobile · b6e6f8be
      Srinivas Pandruvada authored
      There is an expectation from users that they can get frequency specified
      by cpufreq/cpuinfo_max_freq when conditions permit. But with AlderLake
      mobile it may not be possible. This is possible that frequency is clipped
      based on the system power-up EPP value. In this case users can update
      cpufreq/energy_performance_preference to some performance oriented EPP to
      limit clipping of frequencies.
      
      To get out of box behavior as the prior generations of CPUs, update EPP
      for AlderLake mobile CPUs on boot. On prior generations of CPUs EPP = 128
      was enough to get maximum frequency, but with AlderLake mobile the
      equivalent EPP is 102. Since EPP is model specific, this is possible that
      they have different meaning on each generation of CPU.
      
      The current EPP string "balance_performance" corresponds to EPP = 128.
      Change the EPP corresponding to "balance_performance" to 102 for only
      AlderLake mobile CPUs and update this on each CPU during boot.
      
      To implement reuse epp_values[] array and update the modified EPP at the
      index for BALANCE_PERFORMANCE. Add a dummy EPP_INDEX_DEFAULT to
      epp_values[] to match indexes in the energy_perf_strings[].
      
      After HWP PM is enabled also update EPP when "balance_performance" is
      redefined for the very first time after the boot on each CPU. On
      subsequent suspend/resume or offline/online the old EPP is restored,
      so no specific action is needed.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b6e6f8be
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Drop redundant intel_pstate_get_hwp_cap() call · 458b03f8
      Rafael J. Wysocki authored
      It is not necessary to call intel_pstate_get_hwp_cap() from
      intel_pstate_update_perf_limits(), because it gets called from
      intel_pstate_verify_cpu_policy() which is either invoked directly
      right before intel_pstate_update_perf_limits(), in
      intel_cpufreq_verify_policy() in the passive mode, or called
      from driver callbacks in a sequence that causes it to be followed
      by an immediate intel_pstate_update_perf_limits().
      
      Namely, in the active mode intel_cpufreq_verify_policy() is called
      by intel_pstate_verify_policy() which is the ->verify() callback
      routine of intel_pstate and gets called by the cpufreq core right
      before intel_pstate_set_policy(), which is the driver's ->setoplicy()
      callback routine, where intel_pstate_update_perf_limits() is called.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      458b03f8
  3. 12 Dec, 2021 14 commits
  4. 11 Dec, 2021 22 commits