1. 08 2月, 2018 4 次提交
  2. 07 2月, 2018 3 次提交
  3. 05 2月, 2018 1 次提交
    • B
      cpufreq: Skip cpufreq resume if it's not suspended · 703cbaa6
      Bo Yan 提交于
      cpufreq_resume can be called even without preceding cpufreq_suspend.
      This can happen in following scenario:
      
          suspend_devices_and_enter
             --> dpm_suspend_start
                --> dpm_prepare
                    --> device_prepare : this function errors out
                --> dpm_suspend: this is skipped due to dpm_prepare failure
                                 this means cpufreq_suspend is skipped over
             --> goto Recover_platform, due to previous error
             --> goto Resume_devices
             --> dpm_resume_end
                 --> dpm_resume
                     --> cpufreq_resume
      
      In case schedutil is used as frequency governor, cpufreq_resume will
      eventually call sugov_start, which does following:
      
          memset(sg_cpu, 0, sizeof(*sg_cpu));
          ....
      
      This effectively erases function pointer for frequency update, causing
      crash later on. The function pointer would have been set correctly if
      subsequent cpufreq_add_update_util_hook runs successfully, but that
      function returns earlier because cpufreq_suspend was not called:
      
          if (WARN_ON(per_cpu(cpufreq_update_util_data, cpu)))
      		return;
      
      The fix is to check cpufreq_suspended first, if it's false, that means
      cpufreq_suspend was not called in the first place, so do not resume
      cpufreq.
      Signed-off-by: NBo Yan <byan@nvidia.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Dropped printing a message ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      703cbaa6
  4. 17 1月, 2018 1 次提交
    • S
      cpufreq: scpi: remove arm_big_little dependency · 343a8d17
      Sudeep Holla 提交于
      The dependency on physical_package_id from the topology to get the
      cluster identifier is wrong. The concept of cluster used in ARM topology
      is unfortunately not well defined in the architecture, we should avoid
      using it. Further the frequency domain need not be mapped to so called
      "clusters" one to one.
      
      SCPI already provides means to obtain the frequency domain id from the
      device tree. In order to support some new topologies(e.g. DSU which
      contains 2 frequency domains within the physical cluster), pseudo
      clusters are created to make this driver work which is wrong again.
      
      In order to solve those issues and also remove dependency of topological
      physical id for frequency domain, this patch removes the arm_big_little
      dependency from scpi driver.
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      343a8d17
  5. 12 1月, 2018 3 次提交
  6. 10 1月, 2018 1 次提交
  7. 05 1月, 2018 4 次提交
    • V
      cpufreq: stats: Change return type of cpufreq_stats_update() as void · d476ec4f
      Viresh Kumar 提交于
      It always returns 0 and none of its callers check its return value. Make
      it return void.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d476ec4f
    • G
      powernv-cpufreq: Treat pstates as opaque 8-bit values · 967b87fd
      Gautham R. Shenoy 提交于
      On POWER8 and POWER9, the PMSR and the PMCR registers define pstates
      to be 8-bit wide values. The device-tree exports pstates as 32-bit
      wide values of which the lower byte is the actual pstate.
      
      The current implementation in the kernel treats pstates as integer
      type, since it used to use the sign of the pstate for performing some
      boundary-checks. This is no longer required after the patch
      "powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous
      pstates".
      
      So, in this patch, we modify the powernv-cpufreq driver to uniformly
      treat pstates as opaque 8-bit values obtained from the device-tree or
      the PMCR. This simplifies the extract_pstate() helper function since
      we no longer no longer require to worry about the sign-extentions.
      Signed-off-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      967b87fd
    • G
      powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous pstates · 332f0a01
      Gautham R. Shenoy 提交于
      The code in powernv-cpufreq, makes the following two assumptions which
      are not guaranteed by the device-tree bindings:
      
          1) Pstate ids are continguous: This is used in pstate_to_idx() to
             obtain the reverse map from a pstate to it's corresponding
             entry into the cpufreq frequency table.
      
          2) Every Pstate should always lie between the max and the min
             pstates that are explicitly reported in the device tree: This
             is used to determine whether a pstate reported by the PMSR is
             out of bounds.
      
      Both these assumptions are unwarranted and can change on future
      platforms.
      
      In this patch, we maintain the reverse map from a pstate to it's index
      in the cpufreq frequency table and use this in pstate_to_idx(). This
      does away with the assumptions (1) mentioned above, and will work with
      non continguous pstate ids. If no entry exists for a particular
      pstate, then such a pstate is treated as being out of bounds. This
      gets rid of assumption (2).
      
      On all the existing platforms, where the pstates are 8-bit long
      values, the new implementation of pstate_to_idx() takes constant time.
      Signed-off-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      332f0a01
    • G
      powernv-cpufreq: Add helper to extract pstate from PMSR · ee1f4a7d
      Gautham R. Shenoy 提交于
      On POWERNV platform, the fields for pstates in the Power Management
      Status Register (PMSR) and the Power Management Control Register
      (PMCR) are 8-bits wide. On POWER8 the pstates are negatively numbered
      while on POWER9 they are positively numbered.
      
      The device-tree exports pstates as 32-bit entries. The device-tree
      implementation sign-extends the 8-bit pstate values to obtain the
      corresponding 32-bit entry.
      
      Eg: On POWER8, a pstate value 0x82 [-126] is represented in the
      device-tree as 0xfffffff82 while on POWER9, the same value 0x82 [130]
      is represented in the device-tree as 0x00000082.
      
      The powernv-cpufreq driver implementation represents pstates using the
      integer type. In multiple places in the driver, the code interprets
      the pstates extracted from the PMSR as a signed byte and assigns it to
      a integer variable to get the sign-extention.
      
      On POWER9 platforms which have greater than 128 pstates, this results
      in the driver performing incorrect sign-extention, and thereby
      treating a legitimate pstate (say 130) as an invalid pstates (since it
      is interpreted as -126).
      
      This patch fixes the issue by implementing a helper function to
      extract Pstates from PMSR register, and correctly sign-extend it to be
      consistent with the values provided by the device-tree.
      Signed-off-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ee1f4a7d
  8. 28 12月, 2017 1 次提交
  9. 18 12月, 2017 4 次提交
  10. 17 12月, 2017 1 次提交
  11. 16 12月, 2017 4 次提交
  12. 13 12月, 2017 3 次提交
  13. 08 12月, 2017 2 次提交
  14. 04 12月, 2017 4 次提交
  15. 22 11月, 2017 2 次提交
  16. 09 11月, 2017 2 次提交