20 Jan, 2017

1 commit

  • commit cb43f81b8489dcb87555e16c17453f0a9fa690f2 upstream.

    Commit e1399ba20eee ("powercap / RAPL: handle missing MSRs") added
    contraint_to_pl() function to return index into an array. But it
    can potentially return -EINVAL if powercap layer sends an out of
    range constraint ID. This patch adds sanity check.

    Unnecessary RAPL domain pointer check is removed since it must be
    initialized before calling rapl_unit_xlate().

    Fixes: e1399ba20eee ("powercap / RAPL: handle missing MSRs")
    Reported-by: Odzioba, Lukasz
    Reported-by: Koss, Marcin
    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Jacob Pan
     

08 Sep, 2016

1 commit

  • Merrifield2 is actually Moorefield.

    Rename it accordingly and drop tail digit from Merrifield1.

    Signed-off-by: Andy Shevchenko
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20160906184254.94440-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Ingo Molnar

    Andy Shevchenko
     

25 Jun, 2016

1 commit


15 Jun, 2016

3 commits


10 Jun, 2016

1 commit

  • Since the RAPL interface is not architectual, its enumeration depends
    on poking MSRs instead of using the CPUID method.

    In KVM guests, the RAPL driver probe will fail and emit the following
    message for every CPU: "no valid rapl domains found in package"

    This patch converts the warning to a debug message only (still return
    -ENODEV so that RAPL does not run in KVM guests).

    Signed-off-by: Jacob Pan
    [ rjw: Subject & changelog ]
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     

08 Jun, 2016

3 commits

  • SKX uses similar RAPL interface as Broadwell server according to
    Jacob Pan.

    Signed-off-by: Dave Hansen
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jacob Pan
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: jacob.jun.pan@intel.com
    Cc: linux-pm@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160603001955.38E1E684@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Dave Hansen
     
  • Let's make an effort to group these things by microarchitecture
    name. It makes it easier to see if something got missed.

    Signed-off-by: Dave Hansen
    Acked-by: Rafael J. Wysocki
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: jacob.jun.pan@intel.com
    Cc: linux-pm@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160603001937.B53A383A@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Dave Hansen
     
  • Use the new macros to remove another large set of open-coded values.

    Signed-off-by: Dave Hansen
    Acked-by: Rafael J. Wysocki
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: jacob.jun.pan@intel.com
    Cc: linux-pm@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160603001936.F474F9D8@viggo.jf.intel.com
    Signed-off-by: Ingo Molnar

    Dave Hansen
     

17 May, 2016

1 commit

  • Pull power management updates from Rafael Wysocki:
    "The majority of changes go into the cpufreq subsystem this time.

    To me, quite obviously, the biggest ticket item is the new "schedutil"
    governor. Interestingly enough, it's the first new cpufreq governor
    since the beginning of the git era (except for some out-of-the-tree
    ones).

    There are two main differences between it and the existing governors.
    First, it uses the information provided by the scheduler directly for
    making its decisions, so it doesn't have to track anything by itself.
    Second, it can invoke drivers (supporting that feature) to adjust CPU
    performance right away without having to spawn work items to be
    executed in process context or similar. Currently, the acpi-cpufreq
    driver is the only one supporting that mode of operation, but then it
    is used on a large number of systems.

    The "schedutil" governor as included here is very simple and mostly
    regarded as a foundation for future work on the integration of the
    scheduler with CPU power management (in fact, there is work in
    progress on top of it already). Nevertheless it works and the
    preliminary results obtained with it are encouraging.

    There also is some consolidation of CPU frequency management for ARM
    platforms that can add their machine IDs the the new stub dt-platdev
    driver now and that will take care of creating the requisite platform
    device for cpufreq-dt, so it is not necessary to do that in platform
    code any more. Several ARM platforms are switched over to using this
    generic mechanism.

    In addition to that, the intel_pstate driver is now going to respect
    CPU frequency limits set by the platform firmware (or a BMC) and
    provided via the ACPI _PPC object.

    The devfreq subsystem is getting a new "passive" governor for SoCs
    subsystems that will depend on somebody else to manage their voltage
    rails and its support for Samsung Exynos SoCs is consolidated.

    The rest is support for new hardware (Intel Broxton support in
    intel_idle for one example), bug fixes, optimizations and cleanups in
    a number of places.

    Specifics:

    - New cpufreq "schedutil" governor (making decisions based on CPU
    utilization information provided by the scheduler and capable of
    switching CPU frequencies right away if the underlying driver
    supports that) and support for fast frequency switching in the
    acpi-cpufreq driver (Rafael Wysocki)

    - Consolidation of CPU frequency management on ARM platforms allowing
    them to get rid of some platform-specific boilerplate code if they
    are going to use the cpufreq-dt driver (Viresh Kumar, Finley Xiao,
    Marc Gonzalez)

    - Support for ACPI _PPC and CPU frequency limits in the intel_pstate
    driver (Srinivas Pandruvada)

    - Fixes and cleanups in the cpufreq core and generic governor code
    (Rafael Wysocki, Sai Gurrappadi)

    - intel_pstate driver optimizations and cleanups (Rafael Wysocki,
    Philippe Longepe, Chen Yu, Joe Perches)

    - cpufreq powernv driver fixes and cleanups (Akshay Adiga, Shilpasri
    Bhat)

    - cpufreq qoriq driver fixes and cleanups (Jia Hongtao)

    - ACPI cpufreq driver cleanups (Viresh Kumar)

    - Assorted cpufreq driver updates (Ashwin Chaugule, Geliang Tang,
    Javier Martinez Canillas, Paul Gortmaker, Sudeep Holla)

    - Assorted cpufreq fixes and cleanups (Joe Perches, Arnd Bergmann)

    - Fixes and cleanups in the OPP (Operating Performance Points)
    framework, mostly related to OPP sharing, and reorganization of
    OF-dependent code in it (Viresh Kumar, Arnd Bergmann, Sudeep Holla)

    - New "passive" governor for devfreq (for SoC subsystems that will
    rely on someone else for the management of their power resources)
    and consolidation of devfreq support for Exynos platforms, coding
    style and typo fixes for devfreq (Chanwoo Choi, MyungJoo Ham)

    - PM core fixes and cleanups, mostly to make it work better with the
    generic power domains (genpd) framework, and updates for that
    framework (Ulf Hansson, Thierry Reding, Colin Ian King)

    - Intel Broxton support for the intel_idle driver (Len Brown)

    - cpuidle core optimization and fix (Daniel Lezcano, Dave Gerlach)

    - ARM cpuidle cleanups (Jisheng Zhang)

    - Intel Kabylake support for the RAPL power capping driver (Jacob
    Pan)

    - AVS (Adaptive Voltage Switching) rockchip-io driver update (Heiko
    Stuebner)

    - Updates for the cpupower tool (Arjun Sreedharan, Colin Ian King,
    Mattia Dongili, Thomas Renninger)"

    * tag 'pm-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (112 commits)
    intel_pstate: Clean up get_target_pstate_use_performance()
    intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
    intel_pstate: Clarify average performance computation
    intel_pstate: Avoid unnecessary synchronize_sched() during initialization
    cpufreq: schedutil: Make default depend on CONFIG_SMP
    cpufreq: powernv: del_timer_sync when global and local pstate are equal
    cpufreq: powernv: Move smp_call_function_any() out of irq safe block
    intel_pstate: Clean up intel_pstate_get()
    cpufreq: schedutil: Make it depend on CONFIG_SMP
    cpufreq: governor: Fix handling of special cases in dbs_update()
    PM / OPP: Move CONFIG_OF dependent code in a separate file
    cpufreq: intel_pstate: Ignore _PPC processing under HWP
    cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table
    PM / OPP: add non-OF versions of dev_pm_opp_{cpumask_, }remove_table
    cpufreq: tango: Use generic platdev driver
    PM / OPP: pass cpumask by reference
    cpufreq: Fix GOV_LIMITS handling for the userspace governor
    cpupower: fix potential memory leak
    PM / devfreq: style/typo fixes
    PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus
    ..

    Linus Torvalds
     

28 Apr, 2016

1 commit

  • Skylake processor supports a new set of RAPL registers for controlling
    entire SoC instead of just CPU package. This is useful for thermal
    and power control when source of power/thermal is not just CPU/GPU.
    This change adds a new platform domain (AKA PSys) to the current
    power capping Intel RAPL driver.

    PSys also supports PL1 (long term) and PL2 (short term) control like
    package domain. This also follows same MSRs for energy and time
    units as package domain.

    Unlike package domain, PSys support requires more than just processor
    level implementation. The other parts in the system need additional
    implementation, which OEMs needs to support. So not all Skylake
    systems will support PSys.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Rafael J. Wysocki
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: bp@alien8.de
    Cc: hpa@zytor.com
    Cc: jacob.jun.pan@linux.intel.com
    Cc: rjw@rjwysocki.net
    Link: http://lkml.kernel.org/r/1460930581-29748-3-git-send-email-srinivas.pandruvada@linux.intel.com
    Signed-off-by: Ingo Molnar

    Srinivas Pandruvada
     

27 Apr, 2016

1 commit


05 Apr, 2016

1 commit


09 Mar, 2016

3 commits

  • RAPL driver operates on MSRs that are under package/socket
    scope instead of core scope. However, the current code does not
    keep track of which CPUs are available on each package for MSR
    access. Therefore it has to search for an active CPU on a given
    package each time.

    This patch optimizes the package level operations by tracking a
    per package lead CPU during initialization and CPU hotplug. The
    runtime search for active CPU is avoided.

    Suggested-by: Thomas Gleixner
    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     
  • This patch adds to each rapl domain a reference of the package
    it belongs to. At runtime, we can then avoid searching the package
    data for each access. It simplifies the domain level operations
    which depend on package level information.

    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     
  • Reduce remote CPU calls for MSR access by combining read
    modify write into one function.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     

12 Jan, 2016

2 commits

  • * powercap:
    powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures

    Rafael J. Wysocki
     
  • * acpi-soc:
    PM / clk: don't leave clocks enabled when driver not bound
    i2c: dw: Add APM X-Gene ACPI I2C device support
    ACPI / APD: Add APM X-Gene ACPI I2C device support
    ACPI / LPSS: change 'does not have' to 'has' in comment
    Revert "dmaengine: dw: platform: provide platform data for Intel"
    dmaengine: dw: return immediately from IRQ when DMA isn't in use
    dmaengine: dw: platform: power on device on shutdown
    ACPI / LPSS: override power state for LPSS DMA device
    ACPI / LPSS: power on when probe() and otherwise when remove()
    ACPI / LPSS: do delay for all LPSS devices when D3->D0
    ACPI / LPSS: allow to use specific PM domain during ->probe()
    Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()"
    device core: add BUS_NOTIFY_DRIVER_NOT_BOUND notification
    x86/platform/iosf_mbi: Remove duplicate definitions

    Conflicts:
    drivers/i2c/busses/i2c-designware-platdrv.c

    Rafael J. Wysocki
     

02 Jan, 2016

1 commit


12 Dec, 2015

1 commit

  • Intel RAPL initialized on several systems where the BIOS lock bit (msr
    0x610, bit 63) was set. This occured because the return value of
    rapl_read_data_raw() was being checked, rather than the value of the variable
    passed in, locked.

    This patch properly implments the rapl_read_data_raw() call to check the
    variable locked, and now the Intel RAPL driver outputs the warning:

    intel_rapl: RAPL package 0 domain package locked by BIOS

    and does not initialize for the package.

    Signed-off-by: Prarit Bhargava
    Acked-by: Jacob Pan
    Cc: All applicable
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava
     

09 Dec, 2015

1 commit

  • The read and write opcodes are global for all units on SoC and even across
    Intel SoCs. Remove duplication of corresponding constants. At the same time
    convert all current users.

    No functional change.

    Acked-by: Thomas Gleixner
    Acked-by: Boon Leong Ong
    Acked-by: Jacob Pan
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

17 Oct, 2015

1 commit


29 Aug, 2015

1 commit


01 Aug, 2015

2 commits


21 May, 2015

1 commit


05 May, 2015

1 commit

  • CPU Floor frequency is set in BIOS for newer Atom
    SoCs. This patch handles configuration of floor
    frequency for different variants of Atom SoCs
    appropriately and ensures configuration of floor
    frequency is not done from driver for these
    newer Atom SoCs.

    Since address of the register for configuring
    floor frequency might change for different
    Atom SoCs, this patch also prevents potential
    overwriting of wrong registers.

    Reviewed-by: Jacob Pan
    Signed-off-by: Ajay Thomas
    Signed-off-by: Rafael J. Wysocki

    Ajay Thomas
     

16 Apr, 2015

1 commit


11 Apr, 2015

2 commits


14 Mar, 2015

1 commit

  • The current driver assumes all RAPL domains within a CPU package
    have the same energy unit. This is no longer true for HSW server
    CPUs since DRAM domain has is own fixed energy unit which can be
    different than the package energy unit enumerated by package
    power MSR. In fact, the default HSW EP package power unit is 61uJ
    whereas DRAM domain unit is 15.3uJ. The result is that DRAM power
    consumption is counted 4x more than real power reported by energy
    counters, similarly for max_energy_range_uj of DRAM domain.

    This patch adds domain specific energy unit per cpu type, it allows
    domain energy unit to override package energy unit if non zero.

    Please see this document for details.
    "Intel Xeon Processor E5-1600 and E5-2600 v3 Product Families, Volume 2 of 2.
    Datasheet, September 2014, Reference Number: 330784-001 "

    Signed-off-by: Jacob Pan
    Cc: 3.10+ # 3.10+
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     

17 Dec, 2014

1 commit


13 Nov, 2014

1 commit


12 Nov, 2014

3 commits

  • Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     
  • RAPL implementation on Atom has made some changes that are not compatible
    with Core CPUs. Specifically, it is different in the way units are computed
    as well as floor frequency is enforced.

    This patch uses the per CPU model functions to handle the differences. Intel
    Software Developers' Manual has also been updated to reflect the changes in
    Table 35-7 V3C.

    Signed-off-by: Ajay Thomas
    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     
  • RAPL implementations may vary slightly between Core and Atom CPUs. There are
    also potential differences among generations of CPUs within the family.

    This patch adds a per model structure to abstract the differences such that
    variations can be handled cleanly.

    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     

03 Sep, 2014

2 commits

  • Many CPUs do not support complete set of RAPL domains, as a
    result this detection failed message is very misleading and
    can be annoying.

    [ 5.082632] intel_rapl: RAPL domain core detection failed
    [ 5.088370] intel_rapl: RAPL domain uncore detection failed

    So lower the warning message to info and only print out the RAPL
    domains that are supported.

    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jacob Pan
     
  • I've confirmed that monitoring the package power usage as well as setting power
    limits appear to be working as expected. Supports the package and dram domains.

    Tested aginst cpu:

    Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz

    Signed-off-by: Jason Baron
    Acked-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Jason Baron
     

01 May, 2014

1 commit