09 Mar, 2021

1 commit

  • Currently the default behavior is to manually having the devfreq
    backend to register themselves as a devfreq cooling device.

    Instead of adding the code in the drivers for the thermal cooling
    device registering, let's provide a flag in the devfreq's profile to
    tell the common devfreq code to register the newly created devfreq as
    a cooling device.

    Suggested-by: Chanwoo Choi
    Signed-off-by: Daniel Lezcano
    Reviewed-by: Steven Price
    Reviewed-by: Lukasz Luba
    Signed-off-by: Chanwoo Choi

    Daniel Lezcano
     

04 Feb, 2021

1 commit


26 Oct, 2020

1 commit

  • The devfreq structure instance contains the governor_name and a governor
    instance. When need to show the governor name, better to use the name
    of devfreq_governor structure. So, governor_name variable in struct devfreq
    is a redundant and unneeded variable. Remove the redundant governor_name
    of struct devfreq and then use the name of devfreq_governor instance.

    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     

16 Oct, 2020

1 commit

  • The update_devfreq() is also documented at devfreq.c, which
    has a more complete note.

    So, drop the duplicated markup, in order to avoid this
    warning:
    .../Documentation/driver-api/device_link.rst: WARNING: Duplicate C declaration, also defined in 'driver-api/infrastructure'.
    Declaration is 'device_link_state'.

    (and to cause a problem with cross-references to it)

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

29 Sep, 2020

2 commits

  • Previously, devfreq core support 'devfreq' property in order to get
    the devfreq device by phandle. But, 'devfreq' property name is not proper
    on devicetree binding because this name doesn't mean the any h/w attribute.

    The devfreq core hand over the right to decide the property name
    for getting the devfreq device on devicetree. Each devfreq driver
    will decide the property name on devicetree binding and pass
    the their own property name to devfreq_get_devfreq_by_phandle function.

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

    Chanwoo Choi
     
  • Split off part of devfreq_get_devfreq_by_phandle into a separate
    function. This allows callers to fetch devfreq instances by enumerating
    devicetree instead of explicit phandles.

    Acked-by: Krzysztof Kozlowski
    Reviewed-by: Lukasz Luba
    Signed-off-by: Leonard Crestez
    [cw00.choi: Export devfreq_get_devfreq_by_node function and
    add function to devfreq.h when CONFIG_PM_DEVFREQ is enabled.]
    Signed-off-by: Chanwoo Choi

    Leonard Crestez
     

30 Jul, 2020

1 commit

  • Until now, the devfreq driver using polling mode like simple_ondemand
    governor have used only deferrable timer for reducing the redundant
    power consumption. It reduces the CPU wake-up from idle due to polling mode
    which check the status of Non-CPU device.

    But, it has a problem for Non-CPU device like DMC device with DMA operation.
    Some Non-CPU device need to do monitor continuously regardless of CPU state
    in order to decide the proper next status of Non-CPU device.

    So, add support the delayed timer for polling mode to support
    the repetitive monitoring. The devfreq driver and user can select
    the kind of timer on either deferrable and delayed timer.

    For example, change the timer type of DMC device
    based on Exynos5422-based Odroid-XU3 as following:

    - If want to use deferrable timer as following:
    echo deferrable > /sys/class/devfreq/10c20000.memory-controller/timer

    - If want to use delayed timer as following:
    echo delayed > /sys/class/devfreq/10c20000.memory-controller/timer

    Reviewed-by: Bartlomiej Zolnierkiewicz
    Reviewed-by: Lukasz Luba
    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     

25 Mar, 2020

2 commits

  • Mark "void *data" as literal, in order to avoid those doc warnings:

    ./include/linux/devfreq.h:156: WARNING: Inline emphasis start-string without end-string.
    ./include/linux/devfreq.h:259: WARNING: Inline emphasis start-string without end-string.
    ./include/linux/devfreq.h:279: WARNING: Inline emphasis start-string without end-string.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Chanwoo Choi

    Mauro Carvalho Chehab
     
  • Remove unneeded extern keyword from devfreq-related header file
    and adjust the indentation of function parameter to keep the
    consistency in header file

    Reviewed-by: Lukasz Luba
    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     

30 Dec, 2019

3 commits


09 Dec, 2019

2 commits

  • Switch the handling of min_freq and max_freq from sysfs to use the
    dev_pm_qos_request interface.

    Since PM QoS handles frequencies as kHz this change reduces the
    precision of min_freq and max_freq. This shouldn't introduce problems
    because frequencies which are not an integer number of kHz are likely
    not an integer number of Hz either.

    Try to ensure compatibility by rounding min values down and rounding
    max values up.

    Signed-off-by: Leonard Crestez
    Acked-by: Chanwoo Choi
    Reviewed-by: Matthias Kaehlcke
    Tested-by: Matthias Kaehlcke
    [cw00.choi: Return -EAGAIN instead of -EINVAL if dev_pm_qos is inactive]
    Signed-off-by: Chanwoo Choi

    Leonard Crestez
     
  • Register notifiers with the PM QoS framework in order to respond to
    requests for DEV_PM_QOS_MIN_FREQUENCY and DEV_PM_QOS_MAX_FREQUENCY.

    No notifiers are added by this patch but PM QoS constraints can be
    imposed externally (for example from other devices).

    Signed-off-by: Leonard Crestez
    Acked-by: Chanwoo Choi
    Reviewed-by: Matthias Kaehlcke
    Tested-by: Matthias Kaehlcke
    Signed-off-by: Chanwoo Choi

    Leonard Crestez
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

11 Dec, 2018

2 commits

  • This patch adds implementation for global suspend/resume for
    devfreq framework. System suspend will next use these functions.

    Suggested-by: Tobias Jakobi
    Suggested-by: Chanwoo Choi
    Signed-off-by: Lukasz Luba
    Reviewed-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Lukasz Luba
     
  • The patch prepares devfreq device for handling suspend/resume
    functionality. The new fields will store needed information during this
    process. Devfreq framework handles opp-suspend DT entry and there is no
    need of modyfications in the drivers code. It uses atomic variables to
    make sure no race condition affects the process.

    Suggested-by: Tobias Jakobi
    Suggested-by: Chanwoo Choi
    Signed-off-by: Lukasz Luba
    Reviewed-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Lukasz Luba
     

02 Oct, 2018

1 commit

  • Currently update_devfreq() is only visible to devfreq governors outside
    of devfreq.c. Make it public to allow drivers that adjust devfreq policies
    to cause a re-evaluation of the frequency after a policy change.

    Signed-off-by: Matthias Kaehlcke
    Reviewed-by: Brian Norris
    Reviewed-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Matthias Kaehlcke
     

26 Oct, 2017

3 commits

  • Prior to that, the devfreq device uses the governor name when adding
    the itself. In order to prevent the mistake used the wrong governor name,
    this patch defines the governor name as a constant and then uses them
    instead of using the string directly.

    Signed-off-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham
    Cc: Kukjin Kim
    Cc: Krzysztof Kozlowski
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org

    Chanwoo Choi
     
  • The commit a76caf55e5b35 ("thermal: Add devfreq cooling") allows
    the devfreq device to use the cooling device. When the cooling down
    are required, the devfreq_cooling.c disables the OPP entry with
    the dev_pm_opp_disable(). In result, 'available_frequencies'[1]
    sysfs node never came to show the all available frequencies.
    [1] /sys/class/devfreq/.../available_frequencies

    So, this patch uses the 'freq_table' in the 'struct devfreq_dev_profile'
    in order to show the all available frequencies.
    - If 'freq_table' is NULL, devfreq core initializes them by using OPP values.
    - If 'freq_table' is initialized, devfreq core just uses the 'freq_table'.

    And this patch adds some comment about the sort way of 'freq_table'.

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

    Chanwoo Choi
     
  • The commit a76caf55e5b35 ("thermal: Add devfreq cooling") is able
    to disable OPP as a cooling device. In result, both update_devfreq()
    and {min|max}_freq_show() have to consider the 'opp->available'
    status of each OPP.

    So, this patch adds the 'scaling_{min|max}_freq' to struct devfreq
    in order to indicate the available mininum and maximum frequency
    by adjusting OPP interface such as dev_pm_opp_{disable|enable}().
    The 'scaling_{min|max}_freq' are used for on both update_devfreq()
    and {min|max}_freq_show().

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

    Chanwoo Choi
     

28 Aug, 2017

1 commit


12 Apr, 2017

1 commit


31 Jan, 2017

1 commit

  • The devfreq using passive governor is not able to change the governor.
    So, the user can not change the governor through 'available_governor' sysfs
    entry. Also, the devfreq which don't use the passive governor is not able to
    change to 'passive' governor on the fly.

    Fixes: 996133119f57 ("PM / devfreq: Add new passive governor")
    Cc: stable@vger.kernel.org
    Signed-off-by: Chanwoo Choi
    Signed-off-by: MyungJoo Ham

    Chanwoo Choi
     

03 May, 2016

3 commits

  • 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 new DEVFREQ_TRANSITION_NOTIFIER notifier to send
    the notification when the frequency of device is changed.
    This notifier has two state as following:
    - DEVFREQ_PRECHANGE : Notify it before chaning the frequency of device
    - DEVFREQ_POSTCHANGE : Notify it after changed the frequency of device

    And this patch adds the resourced-managed function to release the resource
    automatically when error happen.

    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
     
  • This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function
    which can find the instance of devfreq device by using phandle ("devfreq").

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

    Chanwoo Choi
     

13 Jan, 2016

1 commit

  • This patch initialize the freq_table array of each devfreq device by using
    the devfreq_set_freq_table(). If freq_table is NULL, the devfreq framework
    is not able to support the frequency transtion information through sysfs.

    The OPP core uses the integer type for the number of opps in the opp list
    and uses the 'unsigned long' type for each frequency. So, this patch
    modifies the type of some variable as following:
    - the type of freq_table : unsigned int -> unsigned long
    - the type of max_state : unsigned int -> int

    - Corrected types, format strings, mutex usages by MyungJoo

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

    Chanwoo Choi
     

11 Sep, 2015

2 commits


20 Dec, 2014

1 commit

  • Having switched over all of the users of CONFIG_PM_RUNTIME to use
    CONFIG_PM directly, turn the latter into a user-selectable option
    and drop the former entirely from the tree.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Ulf Hansson
    Acked-by: Kevin Hilman

    Rafael J. Wysocki
     

24 May, 2014

2 commits


16 Nov, 2013

1 commit

  • Pull trivial tree updates from Jiri Kosina:
    "Usual earth-shaking, news-breaking, rocket science pile from
    trivial.git"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
    doc: usb: Fix typo in Documentation/usb/gadget_configs.txt
    doc: add missing files to timers/00-INDEX
    timekeeping: Fix some trivial typos in comments
    mm: Fix some trivial typos in comments
    irq: Fix some trivial typos in comments
    NUMA: fix typos in Kconfig help text
    mm: update 00-INDEX
    doc: Documentation/DMA-attributes.txt fix typo
    DRM: comment: `halve' -> `half'
    Docs: Kconfig: `devlopers' -> `developers'
    doc: typo on word accounting in kprobes.c in mutliple architectures
    treewide: fix "usefull" typo
    treewide: fix "distingush" typo
    mm/Kconfig: Grammar s/an/a/
    kexec: Typo s/the/then/
    Documentation/kvm: Update cpuid documentation for steal time and pv eoi
    treewide: Fix common typo in "identify"
    __page_to_pfn: Fix typo in comment
    Correct some typos for word frequency
    clk: fixed-factor: Fix a trivial typo
    ...

    Linus Torvalds
     

26 Oct, 2013

2 commits

  • Since Operating Performance Points (OPP) functions are specific
    to device specific power management, be specific and rename opp.h
    to pm_opp.h

    Reported-by: Randy Dunlap
    Signed-off-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     
  • Since Operating Performance Points (OPP) data structures are specific
    to device specific power management, be specific and rename opp_* data
    structures in OPP library with dev_pm_opp_* equivalent.

    Affected structures are:
    struct opp
    enum opp_event

    Minor checkpatch warning resulting of this change was fixed as well.

    Reported-by: Randy Dunlap
    Signed-off-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

14 Oct, 2013

1 commit


03 Jun, 2013

1 commit


02 Apr, 2013

1 commit


26 Nov, 2012

1 commit