Skip to content
  1. Jun 27, 2016
    • Rafael J. Wysocki's avatar
      intel_pstate: Do not clear utilization update hooks on policy changes · 5ab666e0
      Rafael J. Wysocki authored
      
      
      intel_pstate_set_policy() is invoked by the cpufreq core during
      driver initialization, on changes of policy attributes (minimim and
      maximum frequency, for example) via sysfs and via CPU notifications
      from the platform firmware.  On some platforms the latter may occur
      relatively often.
      
      Commit bb6ab52f (intel_pstate: Do not set utilization update hook
      too early) made intel_pstate_set_policy() clear the CPU's utilization
      update hook before updating the policy attributes for it (and set the
      hook again after doind that), but that involves invoking
      synchronize_sched() and adds overhead to the CPU notifications
      mentioned above and to the sched-RCU handling in general.
      
      That extra overhead is arguably not necessary, because updating
      policy attributes when the CPU's utilization update hook is active
      should not lead to any adverse effects, so drop the clearing of
      the hook from intel_pstate_set_policy() and make it check if
      the hook has been set already when attempting to set it.
      
      Fixes: bb6ab52f (intel_pstate: Do not set utilization update hook too early)
      Reported-by: default avatarJisheng Zhang <jszhang@marvell.com>
      Tested-by: default avatarJisheng Zhang <jszhang@marvell.com>
      Tested-by: default avatarDoug Smythies <dsmythies@telus.net>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5ab666e0
  2. Jun 23, 2016
  3. Jun 14, 2016
  4. Jun 08, 2016
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo · 983e600e
      Srinivas Pandruvada authored
      
      
      When turbo is disabled, the ->set_policy() interface is broken.
      
      For example, when turbo is disabled and cpuinfo.max = 2900000 (full
      max turbo frequency), setting the limits results in frequency less
      than the requested one:
      Set 1000000 KHz results in 0700000 KHz
      Set 1500000 KHz results in 1100000 KHz
      Set 2000000 KHz results in  1500000 KHz
      
      This is because the limits->max_perf fraction is calculated using
      the max turbo frequency as the reference, but when the max P-State is
      capped in intel_pstate_get_min_max(), the reference is not the max
      turbo P-State. This results in reducing max P-State.
      
      One option is to always use max turbo as reference for calculating
      limits. But this will not be correct. By definition the intel_pstate
      sysfs limits, shows percentage of available performance. So when
      BIOS has disabled turbo, the available performance is max non turbo.
      So the max_perf_pct should still show 100%.
      
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      [ rjw : Subject & changelog, rewrite in fewer lines of code ]
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      983e600e
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Fix code ordering in intel_pstate_set_policy() · 2c2c1af4
      Srinivas Pandruvada authored
      
      
      The limits->max_perf is rounded_up but immediately overwritten by
      another assignment to limits->max_perf.
      
      Move that operation to the correct location.
      
      While here also added a pr_debug() call in ->set_policy to aid in
      debugging.
      
      Fixes: 785ee278 (cpufreq: intel_pstate: Fix limits->max_perf rounding error)
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      [ rjw : Subject & changelog ]
      Cc: 4.4+ <stable@vger.kernel.org> # 4.4+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2c2c1af4
  5. Jun 01, 2016
  6. May 30, 2016
  7. May 27, 2016
    • Arnd Bergmann's avatar
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann authored
      
      
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      
      
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  8. May 18, 2016
  9. May 17, 2016
  10. May 13, 2016
  11. May 11, 2016
  12. May 09, 2016
  13. May 06, 2016
  14. May 04, 2016
  15. May 02, 2016
  16. May 01, 2016
  17. Apr 28, 2016
Loading