29 Sep, 2020

4 commits

  • It's safe to enable the ACTMON clock at any time during driver probing,
    even if we don't know the state of hardware, because it's used only for
    collecting and processing stats, and interrupt is kept disabled. This
    allows us to slightly improve code which performs initial hardware
    resetting by making use of a single reset_control_reset() instead of
    assert/deassert pair. Secondly, a potential error of the reset-control
    API is handled nicely now.

    Signed-off-by: Dmitry Osipenko
    Signed-off-by: Chanwoo Choi

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

    The devfreq-event core hand over the rights to decide the property name
    for getting the devfreq-event device on devicetree. Each devfreq-event driver
    will decide the property name on devicetree binding and then pass
    the their own property name to devfreq_event_get_edev_by_phandle function.

    And change the prototype of devfreq_event_get_edev_count function
    because of used deprecated 'devfreq-events' property.

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

    Chanwoo Choi
     
  • 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
     

23 Sep, 2020

2 commits


30 Jul, 2020

6 commits

  • Fix the wrong grammar at the end of code line by using semicolon.

    Cc: stable vger.kernel.org
    Fixes: 490a421bc575 ("PM / devfreq: Add debugfs support with devfreq_summary file")
    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     
  • The commit 66d0e797bf09 ("Revert "PM / devfreq: Modify the device name
    as devfreq(X) for sysfs"") roll back the device name from 'devfreqX'
    to device name explained in DT. After applied commit 66d0e797bf09,
    the indentation of devfreq_summary debugfs node was broken.

    So, fix indentaion of devfreq_summary debugfs node as following:

    For example on Exynos5422-based Odroid-XU3 board,
    $ cat /sys/kernel/debug/devfreq/devfreq_summary
    dev parent_dev governor polling_ms cur_freq_Hz min_freq_Hz max_freq_Hz
    ------------------------------ ------------------------------ --------------- ---------- ------------ ------------ ------------
    10c20000.memory-controller null simple_ondemand 0 413000000 165000000 825000000
    soc:bus_wcore null simple_ondemand 50 88700000 88700000 532000000
    soc:bus_noc soc:bus_wcore passive 0 66600000 66600000 111000000
    soc:bus_fsys_apb soc:bus_wcore passive 0 111000000 111000000 222000000
    soc:bus_fsys soc:bus_wcore passive 0 75000000 75000000 200000000
    soc:bus_fsys2 soc:bus_wcore passive 0 75000000 75000000 200000000
    soc:bus_mfc soc:bus_wcore passive 0 83250000 83250000 333000000
    soc:bus_gen soc:bus_wcore passive 0 88700000 88700000 266000000
    soc:bus_peri soc:bus_wcore passive 0 66600000 66600000 66600000
    soc:bus_g2d soc:bus_wcore passive 0 83250000 83250000 333000000
    soc:bus_g2d_acp soc:bus_wcore passive 0 0 66500000 266000000
    soc:bus_jpeg soc:bus_wcore passive 0 0 75000000 300000000
    soc:bus_jpeg_apb soc:bus_wcore passive 0 0 83250000 166500000
    soc:bus_disp1_fimd soc:bus_wcore passive 0 0 120000000 200000000
    soc:bus_disp1 soc:bus_wcore passive 0 0 120000000 300000000
    soc:bus_gscl_scaler soc:bus_wcore passive 0 0 150000000 300000000
    soc:bus_mscl soc:bus_wcore passive 0 0 84000000 666000000

    Cc: stable@vger.kernel.org
    Fixes: 66d0e797bf09 ("Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"")
    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     
  • The sysfs attr interface used eithere 'df' or 'devfreq' for devfreq instance
    name. In order to keep the consistency and to improve the readabilty,
    unify the instance name as 'df'. Add add the missing conditional statement
    to prevent the fault.

    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     
  • 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
     
  • The word 'descriptor' is misspelled throughout the tree.

    Fix it up accordingly:
    decriptors -> descriptors

    Signed-off-by: Kieran Bingham
    Signed-off-by: Chanwoo Choi

    Kieran Bingham
     
  • Booting a recent kernel on a rk3399-based system (nanopc-t4),
    equipped with a recent u-boot and ATF results in an Oops due
    to a NULL pointer dereference.

    This turns out to be due to the rk3399-dmc driver looking for
    an *undocumented* property (rockchip,pmu), and happily using
    a NULL pointer when the property isn't there.

    Instead, make most of what was brought in with 9173c5ceb035
    ("PM / devfreq: rk3399_dmc: Pass ODT and auto power down parameters
    to TF-A.") conditioned on finding this property in the device-tree,
    preventing the driver from exploding.

    Cc: stable@vger.kernel.org
    Fixes: 9173c5ceb035 ("PM / devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A.")
    Signed-off-by: Marc Zyngier
    Signed-off-by: Chanwoo Choi

    Marc Zyngier
     

28 May, 2020

7 commits

  • Instead of warning when mutex_is_locked(), just use the lockdep
    framework. The code is smaller and checks could be disabled for
    production environments (it is useful only during development).

    Put asserts at beginning of function, even before validating arguments.

    The behavior of update_devfreq() is now changed because lockdep assert
    will only print a warning, not return with EINVAL.

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

    Krzysztof Kozlowski
     
  • Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc().

    The proper pointer to be passed as argument to PTR_ERR() is
    priv->icc_pdev.

    This bug was detected with the help of Coccinelle.

    Fixes: 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device")
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Dong Aisheng
    [cw00.choi: Edit the patch title from 'imx' to 'imx-bus']
    Signed-off-by: Chanwoo Choi

    Gustavo A. R. Silva
     
  • GCC produces this warning when kernel compiled using `make W=1`:

    warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
    772 | strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);

    The strncpy doesn't take care of NULL-termination of the destination
    buffer, while the strscpy does.

    Signed-off-by: Dmitry Osipenko
    Signed-off-by: Chanwoo Choi

    Dmitry Osipenko
     
  • There is no single device which can represent the imx interconnect.
    Instead of adding a virtual one just make the main &noc act as the
    global interconnect provider.

    The imx interconnect provider driver will scale the NOC and DDRC based
    on bandwidth request. More scalable nodes can be added in the future,
    for example for audio/display/vpu/gpu NICs.

    Signed-off-by: Leonard Crestez
    Tested-by: Martin Kepplinger
    Acked-by: Chanwoo Choi
    Signed-off-by: Chanwoo Choi

    Leonard Crestez
     
  • Add initial support for dynamic frequency switching on pieces of the imx
    interconnect fabric.

    All this driver does is set a clk rate based on an opp table, it does
    not map register areas.

    Signed-off-by: Leonard Crestez
    Tested-by: Martin Kepplinger
    Acked-by: Chanwoo Choi
    Signed-off-by: Chanwoo Choi

    Leonard Crestez
     
  • The function “platform_get_irq” can log an error already.
    Thus omit a redundant message for the exception handling in the
    calling function.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Reviewed-by: Dmitry Osipenko
    Signed-off-by: Chanwoo Choi

    Markus Elfring
     
  • We're taking into account both HW memory-accesses + CPU activity based on
    current CPU's frequency. For memory-accesses there is a kind of hysteresis
    in a form of "boosting" which is managed by the tegra30-devfreq driver.
    If current HW memory activity is higher than activity judged based of the
    CPU's frequency, then there is no need to schedule cpufreq_update_work
    because the result of the work will be a NO-OP. And thus,
    tegra_actmon_cpufreq_contribution() should return 0, meaning that at the
    moment CPU frequency doesn't contribute anything to the final decision
    about required memory clock rate.

    Signed-off-by: Dmitry Osipenko
    Signed-off-by: Chanwoo Choi

    Dmitry Osipenko
     

25 Mar, 2020

5 commits


24 Feb, 2020

1 commit

  • This reverts commit 4585fbcb5331fc910b7e553ad3efd0dd7b320d14.

    The name changing as devfreq(X) breaks some user space applications,
    such as Android HAL from Unisoc and Hikey [1].
    The device name will be changed unexpectly after every boot depending
    on module init sequence. It will make trouble to setup some system
    configuration like selinux for Android.

    So we'd like to revert it back to old naming rule before any better
    way being found.

    [1] https://lkml.org/lkml/2018/5/8/1042

    Cc: John Stultz
    Cc: Greg Kroah-Hartman
    Cc: stable@vger.kernel.org
    Signed-off-by: Orson Zhai
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Chanwoo Choi

    Orson Zhai
     

16 Jan, 2020

1 commit

  • Add debugfs interface to provide debugging information of devfreq device.
    It contains 'devfreq_summary' entry to show the summary of registered
    devfreq devices as following and the additional debugfs file will be added.
    - /sys/kernel/debug/devfreq/devfreq_summary

    [Detailed description of each field of 'devfreq_summary' debugfs file]
    - dev_name : Device name of h/w
    - dev : Device name made by devfreq core
    - parent_dev : If devfreq device uses the passive governor,
    show parent devfreq device name. Otherwise, show 'null'.
    - governor : Devfreq governor name
    - polling_ms : If devfreq device uses the simple_ondemand governor,
    polling_ms is necessary for the period. (unit: millisecond)
    - cur_freq_Hz : Current frequency (unit: Hz)
    - min_freq_Hz : Minimum frequency (unit: Hz)
    - max_freq_Hz : Maximum frequency (unit: Hz)

    [For example on Exynos5422-based Odroid-XU3 board]
    $ cat /sys/kernel/debug/devfreq/devfreq_summary
    dev_name dev parent_dev governor polling_ms cur_freq_Hz min_freq_Hz max_freq_Hz
    ------------------------------ ---------- ---------- --------------- ---------- ------------ ------------ ------------
    10c20000.memory-controller devfreq0 null simple_ondemand 0 165000000 165000000 825000000
    soc:bus_wcore devfreq1 null simple_ondemand 50 532000000 88700000 532000000
    soc:bus_noc devfreq2 devfreq1 passive 0 111000000 66600000 111000000
    soc:bus_fsys_apb devfreq3 devfreq1 passive 0 222000000 111000000 222000000
    soc:bus_fsys devfreq4 devfreq1 passive 0 200000000 75000000 200000000
    soc:bus_fsys2 devfreq5 devfreq1 passive 0 200000000 75000000 200000000
    soc:bus_mfc devfreq6 devfreq1 passive 0 333000000 83250000 333000000
    soc:bus_gen devfreq7 devfreq1 passive 0 266000000 88700000 266000000
    soc:bus_peri devfreq8 devfreq1 passive 0 66600000 66600000 66600000
    soc:bus_g2d devfreq9 devfreq1 passive 0 333000000 83250000 333000000
    soc:bus_g2d_acp devfreq10 devfreq1 passive 0 266000000 66500000 266000000
    soc:bus_jpeg devfreq11 devfreq1 passive 0 300000000 75000000 300000000
    soc:bus_jpeg_apb devfreq12 devfreq1 passive 0 166500000 83250000 166500000
    soc:bus_disp1_fimd devfreq13 devfreq1 passive 0 200000000 120000000 200000000
    soc:bus_disp1 devfreq14 devfreq1 passive 0 300000000 120000000 300000000
    soc:bus_gscl_scaler devfreq15 devfreq1 passive 0 300000000 150000000 300000000
    soc:bus_mscl devfreq16 devfreq1 passive 0 666000000 84000000 666000000

    [lkp: Reported the build error]
    Reported-by: kbuild test robot
    Signed-off-by: Chanwoo Choi

    Chanwoo Choi
     

06 Jan, 2020

1 commit

  • Fix up inconsistent usage of upper and lowercase letters in "Exynos"
    name.

    "EXYNOS" is not an abbreviation but a regular trademarked name.
    Therefore it should be written with lowercase letters starting with
    capital letter.

    The lowercase "Exynos" name is promoted by its manufacturer Samsung
    Electronics Co., Ltd., in advertisement materials and on website.

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

    Krzysztof Kozlowski
     

31 Dec, 2019

1 commit


30 Dec, 2019

12 commits