1. 12 1月, 2018 1 次提交
  2. 10 1月, 2018 2 次提交
  3. 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
  4. 28 12月, 2017 2 次提交
  5. 21 12月, 2017 1 次提交
  6. 18 12月, 2017 15 次提交
  7. 17 12月, 2017 15 次提交