28 Aug, 2017

1 commit

  • The devfreq ues the OPP library to handle the voltage and frequency
    for the device basically. This patch adds the dependency on CONFIG_PM_OPP
    in order to prevent either the build break or the unknow behavior.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Chanwoo Choi
     

19 Sep, 2016

1 commit

  • The newly added ARM_RK3399_DMC_DEVFREQ driver requires the
    DEVFREQ_EVENT_ROCKCHIP_DFI driver and tries to turn that on through
    a 'select' statement, and that in turn has a dependency on
    PM_DEVFREQ_EVENT, which may be disabled here:

    warning: (ARM_RK3399_DMC_DEVFREQ) selects DEVFREQ_EVENT_ROCKCHIP_DFI which has unmet direct dependencies (PM_DEVFREQ && PM_DEVFREQ_EVENT && ARCH_ROCKCHIP)

    We probably want a 'depends on' here, but other drivers use 'select'
    too, so for consistency I'm doing the same.

    Signed-off-by: Arnd Bergmann
    Fixes: 5a893e31a636 (PM / devfreq: rockchip: add devfreq driver for rk3399 dmc)
    Acked-by: Chanwoo Choi
    Acked-by: MyungJoo Ham
    Signed-off-by: Rafael J. Wysocki

    Arnd Bergmann
     

15 Sep, 2016

1 commit


06 Sep, 2016

3 commits


06 Jul, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    devfreq/Kconfig:config ARM_EXYNOS_BUS_DEVFREQ
    devfreq/Kconfig: bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver"

    ...meaning that it currently is not being built as a module by anyone.

    Rather than rip out the existing modular code, Chanwoo indicated
    that he'd rather see the driver offered as tristate.

    I don't have the hardware for runtime validation, so this change
    is only validated for compile and modpost.

    Signed-off-by: Paul Gortmaker
    Acked-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Paul Gortmaker
     

03 May, 2016

4 commits

  • This patch removes the unused exynos4/5 busfreq driver. Instead,
    generic exynos-bus frequency driver support the all Exynos SoCs.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham
    Acked-by: Krzysztof Kozlowski

    Chanwoo Choi
     
  • This patch adds the support of bus frequency feature for sub-blocks which share
    the one power line. If each bus depends on the power line, each bus is not able
    to change the voltage by oneself. To optimize the power-consumption on runtime,
    some buses using the same power line should change the source clock and
    regulator at the same time. So, this patch uses the passive governor to support
    the bus frequency for all buses which sharing the one power line.

    For example,

    Exynos3250 include the two power line for AXI buses as following:
    : VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller)
    with the power (regulator).
    : VDD_INT : INT (Internal) provide the various sub-blocks with the power
    (regulator).

    Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus
    use the power line. So, there is no any depencency between buese. But, in the
    case of VDD_INT, various buses share the one power line of VDD_INT. We need to
    make the depenency between buses. When using passive governor, there is no
    problem to support the bus frequency as DVFS for all buses. One bus should be
    operated as the parent bus device which gathering the current load of INT block
    and then decides the new frequency with some governors except of passive
    governor. After deciding the new frequency by the parent bus device, the rest
    bus devices will change the each source clock according to new frequency of the
    parent bus device.

    - MIF (Memory Interface) block
    : VDD_MIF |--- DMC

    - INT (Internal) block
    : VDD_INT |--- LEFTBUS (parent)
    |--- PERIL
    |--- MFC
    |--- G3D
    |--- RIGHTBUS
    |--- FSYS
    |--- LCD0
    |--- PERIR
    |--- ISP
    |--- CAM

    Signed-off-by: Chanwoo Choi
    [tjakobi: Reported debugfs error during booting and cw00.choi fix it.]
    Reported-by: Tobias Jakobi
    Signed-off-by: MyungJoo Ham
    Acked-by: Krzysztof Kozlowski

    Chanwoo Choi
     
  • This patch adds the new passive governor for DEVFREQ framework. The following
    governors are already present and used for DVFS (Dynamic Voltage and Frequency
    Scaling) drivers. The following governors are independently used for one device
    driver which don't give the influence to other device drviers and also don't
    receive the effect from other device drivers.
    - ondemand / performance / powersave / userspace

    The passive governor depends on operation of parent driver with specific
    governos extremely and is not able to decide the new frequency by oneself.
    According to the decided new frequency of parent driver with governor,
    the passive governor uses it to decide the appropriate frequency for own
    device driver. The passive governor must need the following information
    from device tree:
    - the source clock and OPP tables
    - the instance of parent device

    For exameple,
    there are one more devfreq device drivers which need to change their source
    clock according to their utilization on runtime. But, they share the same
    power line (e.g., regulator). So, specific device driver is operated as parent
    with ondemand governor and then the rest device driver with passive governor
    is influenced by parent device.

    Suggested-by: Myungjoo Ham
    Signed-off-by: Chanwoo Choi
    [tjakobi: Reported RCU locking issue and cw00.choi fix it]
    Reported-by: Tobias Jakobi
    [linux.amoon: Reported possible recursive locking and cw00.choi fix it]
    Reported-by: Anand Moon
    Signed-off-by: MyungJoo Ham
    Acked-by: Krzysztof Kozlowski

    Chanwoo Choi
     
  • This patch adds the generic exynos bus frequency driver for AMBA AXI bus
    of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC
    have the common architecture for bus between DRAM and sub-blocks in SoC.
    This driver can support the generic bus frequency driver for Exynos SoCs.

    In devicetree, Each bus block has a bus clock, regulator, operation-point
    and devfreq-event devices which measure the utilization of each bus block.

    Signed-off-by: Chanwoo Choi
    [m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
    Tested-by: Markus Reichl
    Tested-by: Anand Moon
    Signed-off-by: MyungJoo Ham
    Acked-by: Krzysztof Kozlowski

    Chanwoo Choi
     

17 Mar, 2016

1 commit


11 Feb, 2015

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "We have a few new features this time, including a new SFI-based
    cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
    devfreq class for providing its governors with raw utilization data
    and a new ACPI driver for AMD SoCs.

    Still, the majority of changes here are reworks of existing code to
    make it more straightforward or to prepare it for implementing new
    features on top of it. The primary example is the rework of ACPI
    resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
    support for IOAPIC hotplug implemented on top of it, but there is
    quite a number of changes of this kind in the cpufreq core, ACPICA,
    ACPI EC driver, ACPI processor driver and the generic power domains
    core code too.

    The most active developer is Viresh Kumar with his cpufreq changes.

    Specifics:

    - Rework of the core ACPI resources parsing code to fix issues in it
    and make using resource offsets more convenient and consolidation
    of some resource-handing code in a couple of places that have grown
    analagous data structures and code to cover the the same gap in the
    core (Jiang Liu, Thomas Gleixner, Lv Zheng).

    - ACPI-based IOAPIC hotplug support on top of the resources handling
    rework (Jiang Liu, Yinghai Lu).

    - ACPICA update to upstream release 20150204 including an interrupt
    handling rework that allows drivers to install raw handlers for
    ACPI GPEs which then become entirely responsible for the given GPE
    and the ACPICA core code won't touch it (Lv Zheng, David E Box,
    Octavian Purdila).

    - ACPI EC driver rework to fix several concurrency issues and other
    problems related to events handling on top of the ACPICA's new
    support for raw GPE handlers (Lv Zheng).

    - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
    Subsystem) driver for Intel chips (Ken Xue).

    - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
    Nikula).

    - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
    510R) where the native backlight interface doesn't work correctly
    while the ACPI one does (Hans de Goede).

    - Rework of the ACPI processor driver's handling of idle states to
    make the code more straightforward and less bloated overall (Rafael
    J Wysocki).

    - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
    Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
    Bai).

    - PCI core power management modification to avoid resuming (some)
    runtime-suspended devices during system suspend if they are in the
    right states already (Rafael J Wysocki).

    - New SFI-based cpufreq driver for Intel platforms using SFI
    (Srinidhi Kasagar).

    - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
    Doug Anderson, Wolfram Sang).

    - SkyLake CPU support and other updates for the intel_pstate driver
    (Kristen Carlson Accardi, Srinivas Pandruvada).

    - cpufreq-dt driver cleanup (Markus Elfring).

    - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

    - Generic power domains core code fixes and cleanups (Ulf Hansson).

    - Operating Performance Points (OPP) core code cleanups and kernel
    documentation update (Nishanth Menon).

    - New dabugfs interface to make the list of PM QoS constraints
    available to user space (Nishanth Menon).

    - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

    - New devfreq class (devfreq_event) to provide raw utilization data
    to devfreq governors (Chanwoo Choi).

    - Assorted minor fixes and cleanups related to power management
    (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
    Machek, Todd E Brandt, Wonhong Kwon).

    - turbostat updates (Len Brown) and cpupower Makefile improvement
    (Sriram Raghunathan)"

    * tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission
    ACPI / video: Add disable_native_backlight quirk for Samsung 510R
    ACPI / PM: Remove unneeded nested #ifdef
    USB / PM: Remove unneeded #ifdef and associated dead code
    intel_pstate: provide option to only use intel_pstate with HWP
    ACPI / EC: Add GPE reference counting debugging messages
    ACPI / EC: Add query flushing support
    ACPI / EC: Refine command storm prevention support
    ACPI / EC: Add command flushing support.
    ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
    ACPI: add AMD ACPI2Platform device support for x86 system
    ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
    ACPI / EC: Update revision due to raw handler mode.
    ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
    ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
    ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
    ...

    Linus Torvalds
     

30 Jan, 2015

1 commit

  • This patch adds a new class in devfreq, devfreq_event, which provides
    raw data (e.g., memory bus utilization, GPU utilization) for devfreq
    governors.

    - devfreq_event device : Provides raw data for a governor of a devfreq device
    - devfreq device : Monitors device state and changes frequency/voltage
    of the device using the raw data from its
    devfreq_event device.

    A devfreq device dertermines performance states (normally the frequency
    and the voltage vlues) based on the results its designtated devfreq governor:
    e.g., ondemand, performance, powersave.

    In order to give such results required by a devfreq device, the devfreq
    governor requires data that indicates the performance requirement given
    to the devfreq device. The conventional (previous) implementatino of
    devfreq subsystem requires a devfreq device driver to implement its own
    mechanism to acquire performance requirement for its governor. However,
    there had been issues with such requirements:

    1. Although performance requirement of such devices is usually acquired
    from common devices (PMU/PPMU), we do not have any abstract structure to
    represent them properly.
    2. Such performance requirement devices (PMU/PPMU) are actual hardware
    pieces that may be represented by Device Tree directly while devfreq device
    itself is a virtual entity that are not considered to be represented by
    Device Tree according to Device Tree folks.

    In order to address such issues, a devferq_event device (represented by
    this patch) provides a template for device drivers representing
    performance monitoring unit, which gives the basic or raw data for
    preformance requirement, which in turn, is required by devfreq governors.

    The following description explains the feature of two kind of devfreq class:
    - devfreq class (existing)
    : devfreq consumer device use raw data from devfreq_event device for
    determining proper current system state and change voltage/frequency
    dynamically using various governors.

    - devfreq_event class (new)
    : Provide measured raw data to devfreq device for governor

    Cc: MyungJoo Ham
    Cc: Kyungmin Park
    Signed-off-by: Chanwoo Choi
    [Commit message rewritten & conflict resolved by MyungJoo]
    Signed-off-by: MyungJoo Ham

    Chanwoo Choi
     

29 Jan, 2015

1 commit

  • The ACTMON block can monitor several counters, providing averaging and firing
    interrupts based on watermarking configuration. This implementation monitors
    the MCALL and MCCPU counters to choose an appropriate frequency for the
    external memory clock.

    This patch is based on work by Alex Frid and Mikko
    Perttunen .

    Signed-off-by: Tomeu Vizoso
    Signed-off-by: MyungJoo Ham

    Tomeu Vizoso
     

07 Jan, 2015

1 commit

  • SRCU is not necessary to be compiled by default in all cases. For tinification
    efforts not compiling SRCU unless necessary is desirable.

    The current patch tries to make compiling SRCU optional by introducing a new
    Kconfig option CONFIG_SRCU which is selected when any of the components making
    use of SRCU are selected.

    If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.

    text data bss dec hex filename
    2007 0 0 2007 7d7 kernel/rcu/srcu.o

    Size of arch/powerpc/boot/zImage changes from

    text data bss dec hex filename
    831552 64180 23944 919676 e087c arch/powerpc/boot/zImage : before
    829504 64180 23952 917636 e0084 arch/powerpc/boot/zImage : after

    so the savings are about ~2000 bytes.

    Signed-off-by: Pranith Kumar
    CC: Paul E. McKenney
    CC: Josh Triplett
    CC: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]

    Pranith Kumar
     

29 Sep, 2014

2 commits

  • Export symbols from the PPMU driver needed to build the exynos bus
    driver as a module.

    Cc: MyungJoo Ham
    Cc: Kyungmin Park
    Cc: Kukjin Kim
    Cc: Bartlomiej Zolnierkiewicz
    Signed-off-by: Punit Agrawal
    Signed-off-by: MyungJoo Ham

    Punit Agrawal
     
  • The Kconfig symbol ARCH_HAS_OPP became redundant in v3.16: commit
    049d595a4db3 ("PM / OPP: Make OPP invisible to users in Kconfig")
    removed the only dependency that used it. Setting it had no effect
    anymore.

    So commit 78c5e0bb145d ("PM / OPP: Remove ARCH_HAS_OPP") removed it. For
    some reason that commit did not remove all select statements for that
    symbol. These statements are now useless. Remove one from devfreq too.

    Signed-off-by: Paul Bolle
    Signed-off-by: MyungJoo Ham

    Paul Bolle
     

23 Jul, 2014

1 commit

  • Since the OPP layer is a kernel library which has been converted to be
    directly selectable by its callers rather than user selectable and
    requiring architectures to enable it explicitly the ARCH_HAS_OPP symbol
    has become redundant and can be removed. Do so.

    Signed-off-by: Mark Brown
    Reviewed-by: Viresh Kumar
    Acked-by: Nishanth Menon
    Acked-by: Rob Herring
    Acked-by: Shawn Guo
    Acked-by: Simon Horman
    Signed-off-by: Rafael J. Wysocki

    Mark Brown
     

24 May, 2014

3 commits


28 Jan, 2014

1 commit

  • Exynos4 devfreq driver uses mach/map.h which is not available on
    multiplatform. Hence disable build on multiplatform for now.
    Without this patch we get the following build errors:
    drivers/devfreq/exynos/exynos4_bus.h:15:22: fatal error: mach/map.h: No such file or directory

    Signed-off-by: Sachin Kamat
    Signed-off-by: Rafael J. Wysocki

    Sachin Kamat
     

03 Jun, 2013

2 commits

  • Dependencies on CPU_EXYNOS4212 and CPU_EXYNOS4412 for the "ARM
    Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" were added in commit
    7b4050381127ae11fcfc74a106d715a5fbbf888a ("PM/Devfreq: Add Exynos4-bus
    device DVFS driver for Exynos4210/4212/4412."). The tree (at that time,
    v3.3, and currently) makes clear that this should have been dependencies
    on SOC_EXYNOS4212 and SOC_EXYNOS4412.

    Signed-off-by: Paul Bolle

    Paul Bolle
     
  • Exynos5-bus device devfreq driver monitors PPMU counters and
    adjusts operating frequencies and voltages with OPP. ASV should
    be used to provide appropriate voltages as per the speed group
    of the SoC rather than using a constant 1.025V.

    Signed-off-by: Abhilash Kesavan
    [myungjoo.ham@samsung.com: minor style update]
    Signed-off-by: MyungJoo Ham
    Cc: Jonghwan Choi
    Cc: Kukjin Kim

    Abhilash Kesavan
     

20 Nov, 2012

1 commit

  • Add GPL module license and remove the static build
    restrictions for building governors. This allows governors now
    to be loaded on a need basis and reloaded independently of kernel
    build

    Cc: Rajagopal Venkat
    Cc: MyungJoo Ham
    Cc: Kyungmin Park
    Cc: "Rafael J. Wysocki"
    Cc: Kevin Hilman
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org

    Signed-off-by: Nishanth Menon
    Acked-by: MyungJoo Ham
    Signed-off-by: MyungJoo Ham

    Nishanth Menon
     

16 Apr, 2012

1 commit


20 Dec, 2011

1 commit

  • Exynos4-bus device devfreq driver add DVFS capability for
    Exynos4210/4212/4412-Bus (memory). The driver monitors PPMU counters of memory
    controllers and adjusts operating frequencies and voltages with OPP.
    For Exynos4210, vdd_int is controlled. For exynos4412/4212, vdd_mif and
    vdd_int are controlled.

    Dependency (CONFIG_EXYNOS_ASV):
    Exynos4 ASV driver has been posted in the mailing list; however, it
    si not yet upstreamed. Although the current revision of Exynos4 ASV
    patch does not contain "CONFIG_EXYNOS_ASV", we have added the symbol
    to hide the dependent from compilers for now. As soon as Exynos4 ASV
    drivers are merged, the #ifdef statement will be removed or the
    name will be changed.

    However, enabling ASV is essential in most Exynos4 chips to reduce
    the power consumption of Exynos4210 because without ASV, this Devfreq
    driver assumes the worst case scenario, which consumes more power.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park

    ---
    Changes from v1
    - Support 4212 and 4412 as well as 4210.

    MyungJoo Ham
     

15 Nov, 2011

1 commit


02 Oct, 2011

2 commits

  • Four cpufreq-like governors are provided as examples.

    powersave: use the lowest frequency possible. The user (device) should
    set the polling_ms as 0 because polling is useless for this governor.

    performance: use the highest freqeuncy possible. The user (device)
    should set the polling_ms as 0 because polling is useless for this
    governor.

    userspace: use the user specified frequency stored at
    devfreq.user_set_freq. With sysfs support in the following patch, a user
    may set the value with the sysfs interface.

    simple_ondemand: simplified version of cpufreq's ondemand governor.

    When a user updates OPP entries (enable/disable/add), OPP framework
    automatically notifies devfreq to update operating frequency
    accordingly. Thus, devfreq users (device drivers) do not need to update
    devfreq manually with OPP entry updates or set polling_ms for powersave
    , performance, userspace, or any other "static" governors.

    Note that these are given only as basic examples for governors and any
    devices with devfreq may implement their own governors with the drivers
    and use them.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Reviewed-by: Mike Turquette
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    MyungJoo Ham
     
  • With OPPs, a device may have multiple operable frequency and voltage
    sets. However, there can be multiple possible operable sets and a system
    will need to choose one from them. In order to reduce the power
    consumption (by reducing frequency and voltage) without affecting the
    performance too much, a Dynamic Voltage and Frequency Scaling (DVFS)
    scheme may be used.

    This patch introduces the DVFS capability to non-CPU devices with OPPs.
    DVFS is a techique whereby the frequency and supplied voltage of a
    device is adjusted on-the-fly. DVFS usually sets the frequency as low
    as possible with given conditions (such as QoS assurance) and adjusts
    voltage according to the chosen frequency in order to reduce power
    consumption and heat dissipation.

    The generic DVFS for devices, devfreq, may appear quite similar with
    /drivers/cpufreq. However, cpufreq does not allow to have multiple
    devices registered and is not suitable to have multiple heterogenous
    devices with different (but simple) governors.

    Normally, DVFS mechanism controls frequency based on the demand for
    the device, and then, chooses voltage based on the chosen frequency.
    devfreq also controls the frequency based on the governor's frequency
    recommendation and let OPP pick up the pair of frequency and voltage
    based on the recommended frequency. Then, the chosen OPP is passed to
    device driver's "target" callback.

    When PM QoS is going to be used with the devfreq device, the device
    driver should enable OPPs that are appropriate with the current PM QoS
    requests. In order to do so, the device driver may call opp_enable and
    opp_disable at the notifier callback of PM QoS so that PM QoS's
    update_target() call enables the appropriate OPPs. Note that at least
    one of OPPs should be enabled at any time; be careful when there is a
    transition.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Reviewed-by: Mike Turquette
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    MyungJoo Ham