28 Jun, 2017

1 commit


14 May, 2017

1 commit

  • In the current code we accidentally return the successful result from
    idr_alloc() instead of a negative error pointer. The caller is looking
    for an error pointer and so it treats the returned value as a valid
    pointer.

    This one might be a bit serious because if it lets people get around the
    kernel's protection for remapping NULL. I'm not sure.

    Fixes: 75d2364ea0ca (PowerCap: Add class driver)
    Signed-off-by: Dan Carpenter
    Reviewed-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki

    Dan Carpenter
     

29 Apr, 2017

1 commit


01 Dec, 2016

1 commit


29 Nov, 2016

1 commit

  • 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

    Jacob Pan
     

25 Nov, 2016

5 commits

  • The ability of the CPU hotplug code to stop online/offline at each step
    makes it necessary to track the activated CPUs in a package directly,
    because outerwise a CPU offline callback can find CPUs which have already
    executed the offline callback, but are not yet marked offline in the
    topology mask. That could make such a CPU the package leader and in case
    that CPU goes fully offline leave the package lead orphaned.

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

    Thomas Gleixner
     
  • The whole init/exit code is a duplicate of the cpuhotplug code. So we can
    just let the hotplug code do the actual work of setting up and tearing down
    the domains.

    This also restores the package hardware when a package is removed during
    hotplug instead of leaving it in the last configured state and only reset
    it when the driver is removed.

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

    Thomas Gleixner
     
  • Install the callbacks via the state machine as a first step. The init/exit
    code is a duplicate of the hotplug code. This is cleaned up in a
    consecutive patch.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Tested-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki

    Sebastian Andrzej Siewior
     
  • If rapl_package_register_powercap() fails in rapl_add_package() the
    function happily returns 0.

    Capture the error code and propagate it.

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

    Thomas Gleixner
     
  • The domain data of packages is only updated at init time, but new packages
    created by hotplug miss that treatment.

    Add it there and remove the global update at init time, because it's now
    obsolete.

    The more interesting question is why rapl_update_domain_data() exists at
    all as nothing ever uses that data.

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

    Thomas Gleixner
     

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