04 Jun, 2014

1 commit

  • * pm-cpufreq: (28 commits)
    cpufreq: handle calls to ->target_index() in separate routine
    cpufreq: s5pv210: drop check for CONFIG_PM_VERBOSE
    cpufreq: intel_pstate: Remove unused member name of cpudata
    cpufreq: Break out early when frequency equals target_freq
    cpufreq: Tegra: drop wrapper around tegra_update_cpu_speed()
    cpufreq: imx6q: Remove unused include
    cpufreq: imx6q: Drop devm_clk/regulator_get usage
    cpufreq: powernow-k8: Suppress checkpatch warnings
    cpufreq: powernv: make local function static
    cpufreq: Enable big.LITTLE cpufreq driver on arm64
    cpufreq: nforce2: remove DEFINE_PCI_DEVICE_TABLE macro
    intel_pstate: Add CPU IDs for Broadwell processors
    cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
    PM / OPP: Move cpufreq specific OPP functions out of generic OPP library
    PM / OPP: Remove cpufreq wrapper dependency on internal data organization
    cpufreq: Catch double invocations of cpufreq_freq_transition_begin/end
    intel_pstate: Remove sample parameter in intel_pstate_calc_busy
    cpufreq: Kconfig: Fix spelling errors
    cpufreq: Make linux-pm@vger.kernel.org official mailing list
    cpufreq: exynos: Use dev_err/info function instead of pr_err/info
    ...

    Rafael J. Wysocki
     

27 May, 2014

1 commit

  • We don't have any protection against addition of duplicate OPPs currently and in
    case some code tries to add them, it will end up corrupting OPP tables.

    We need to handle some duplication cases separately as returning error might not
    be the right thing always. The new list of return values for dev_pm_opp_add()
    are:

    0: On success OR
    Duplicate OPPs (both freq and volt are same) and opp->available
    -EEXIST: Freq are same and volt are different OR
    Duplicate OPPs (both freq and volt are same) and !opp->available
    -ENOMEM: Memory allocation failure

    Acked-by: Nishanth Menon
    Signed-off-by: Chander Kashyap
    Signed-off-by: Inderpal Singh
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Chander Kashyap
     

20 May, 2014

1 commit


07 May, 2014

2 commits

  • CPUFreq specific helper functions for OPP (Operating Performance Points)
    now use generic OPP functions that allow CPUFreq to be be moved back
    into CPUFreq framework. This allows for independent modifications
    or future enhancements as needed isolated to just CPUFreq framework
    alone.

    Here, we just move relevant code and documentation to make this part of
    CPUFreq infrastructure.

    Cc: Kevin Hilman
    Signed-off-by: Nishanth Menon
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     
  • CPUFREQ custom functions for OPP (Operating Performance Points)
    currently exist inside the OPP library. These custom functions currently
    depend on internal data structures to pick up OPP information to create
    the cpufreq table. For example, the cpufreq table is created precisely
    in the same order of how OPP entries are stored inside the list implementation.

    This kind of tight interdependency is purely artificial since the same
    functionality can be achieved using the generic OPP functions
    meant to do the same. This interdependency also limits the independent
    modification of cpufreq and OPP library.

    So use the generic dev_pm_opp_find_freq_ceil function that achieves the
    table organization as we currently use.

    As a result of this, we dont need to use the internal device_opp
    structure anymore, and we hence we can switch over to rcu lock instead
    of the mutex holding the internal list lock.

    This breaking of dependency on internal data structure imposes no change
    to usage of these.

    NOTE: This change is a precursor to moving this cpufreq specific logic
    out of the generic library into cpufreq.

    Cc: Kevin Hilman
    Signed-off-by: Nishanth Menon
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

15 Feb, 2014

1 commit

  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    Cc: Len Brown
    Signed-off-by: Paul Gortmaker
    Acked-by: Pavel Machek
    Acked-by: Rafael J. Wysocki
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

26 Oct, 2013

3 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
     
  • Since Operating Performance Points (OPP) functions are specific to
    device specific power management, be specific and rename opp_*
    accessors in OPP library with dev_pm_opp_* equivalent.

    Affected functions are:
    opp_get_voltage
    opp_get_freq
    opp_get_opp_count
    opp_find_freq_exact
    opp_find_freq_floor
    opp_find_freq_ceil
    opp_add
    opp_enable
    opp_disable
    opp_get_notifier
    opp_init_cpufreq_table
    opp_free_cpufreq_table

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

    Nishanth Menon
     

06 Aug, 2013

1 commit


04 Jun, 2013

1 commit

  • The "index" field of struct cpufreq_frequency_table was never an
    index and isn't used at all by the cpufreq core. It only is useful
    for cpufreq drivers for their internal purposes.

    Many people nowadays blindly set it in ascending order with the
    assumption that the core will use it, which is a mistake.

    Rename it to "driver_data" as that's what its purpose is. All of its
    users are updated accordingly.

    [rjw: Changelog]
    Signed-off-by: Viresh Kumar
    Acked-by: Simon Horman
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

05 Apr, 2013

1 commit

  • commit dde8437 (PM / OPP: RCU reclaim) introduced rcu_head for
    struct opp. This aids freeing using kfree_rcu. However, we missed
    adding documentation for the same. This generates kernel doc warning:
    Warning(drivers/base/power/opp.c:70): No description found for
    parameter 'head'

    Add documentation as appropriate.

    [rjw: Changelog]
    Signed-off-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

02 Feb, 2013

2 commits


15 Nov, 2012

4 commits

  • The callback function of call_rcu() just calls a kfree(), so we
    can use kfree_rcu() instead of call_rcu() + callback function.

    dpatch engine is used to auto generate this patch.
    (https://github.com/weiyj/dpatch)

    Signed-off-by: Wei Yongjun
    Signed-off-by: Rafael J. Wysocki

    Wei Yongjun
     
  • Currently the opp_find* functions return -ENODEV when:
    a) it cant find a device (e.g. request for an OPP search on device
    which was not registered)
    b) When it cant find a match for the search strategy used

    This makes life a little in-efficient for users such as devfreq
    to make reasonable judgement before switching search strategies.

    So, standardize the return results as following:
    -EINVAL for bad pointer parameters
    -ENODEV when device cannot be found
    -ERANGE when search fails

    This has the following benefit for devfreq implementation:
    The search fails when an unregistered device pointer is provided.
    This is a trigger to change the search direction and search for
    a better fit, however, if we cannot differentiate between a valid
    search range failure Vs an unregistered device, second search goes
    through the same fail return condition. This can be avoided by
    appropriate handling of error return code.

    With this change, we also fix devfreq for the improved search
    strategy with updated error code.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Kevin Hilman
    Acked-by: MyungJoo Ham
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     
  • Export the OPP functions for use by driver modules.

    Cc: "Rafael J. Wysocki"
    Cc: Kevin Hilman
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org

    [nm@ti.com: expansion of functions exported]
    Signed-off-by: Nishanth Menon
    Signed-off-by: Liam Girdwood
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Liam Girdwood
     
  • synchronize_rcu() blocks the caller of opp_enable/disbale
    for a complete grace period. This blocking duration prevents
    any intensive use of the functions. Replace synchronize_rcu()
    by call_rcu() which will call our function for freeing the old
    opp element.

    The duration of opp_enable() and opp_disable() will be no more
    dependant of the grace period.

    Signed-off-by: Vincent Guittot
    Reviewed-by: Paul E. McKenney
    Signed-off-by: Rafael J. Wysocki

    Vincent Guittot
     

10 Sep, 2012

1 commit

  • With a lot of devices booting from device tree nowadays, it requires
    that OPP table can be initialized from device tree. The patch adds
    a helper function of_init_opp_table together with a binding doc for
    that purpose.

    Signed-off-by: Shawn Guo
    Acked-by: Rob Herring
    Signed-off-by: Rafael J. Wysocki

    Shawn Guo
     

12 Mar, 2012

1 commit

  • For files that are actively using linux/device.h, make sure
    that they call it out. This will allow us to clean up some
    of the implicit uses of linux/device.h within include/*
    without introducing build regressions.

    Yes, this was created by "cheating" -- i.e. the headers were
    cleaned up, and then the fallout was found and fixed, and then
    the two commits were reordered. This ensures we don't introduce
    build regressions into the git history.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

09 Nov, 2011

1 commit

  • Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

    [The semantic patch that makes this change is available
    in scripts/coccinelle/api/err_cast.cocci.

    More information about semantic patching is available at
    http://coccinelle.lip6.fr/]

    Signed-off-by: Thomas Meyer
    Signed-off-by: Rafael J. Wysocki

    Thomas Meyer
     

01 Oct, 2011

1 commit

  • The patch enables to register notifier_block for an OPP-device in order
    to get notified for any changes in the availability of OPPs of the
    device. For example, if a new OPP is inserted or enable/disable status
    of an OPP is changed, the notifier is executed.

    This enables the usage of opp_add, opp_enable, and opp_disable to
    directly take effect with any connected entities such as cpufreq or
    devfreq.

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

    MyungJoo Ham
     

27 Jul, 2011

1 commit


16 Jul, 2011

1 commit


15 Mar, 2011

1 commit

  • opp_find_freq_exact() documentation has is_available instead
    of available. This also fixes warning with the kernel-doc:
    scripts/kernel-doc drivers/base/power/opp.c >/dev/null
    Warning(drivers/base/power/opp.c:246): No description found for parameter 'available'
    Warning(drivers/base/power/opp.c:246): Excess function parameter 'is_available' description in 'opp_find_freq_exact'

    Signed-off-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

17 Oct, 2010

1 commit

  • SoCs have a standard set of tuples consisting of frequency and
    voltage pairs that the device will support per voltage domain. These
    are called Operating Performance Points or OPPs. The actual
    definitions of OPP varies over silicon versions. For a specific domain,
    we can have a set of {frequency, voltage} pairs. As the kernel boots
    and more information is available, a default set of these are activated
    based on the precise nature of device. Further on operation, based on
    conditions prevailing in the system (such as temperature), some OPP
    availability may be temporarily controlled by the SoC frameworks.

    To implement an OPP, some sort of power management support is necessary
    hence this library depends on CONFIG_PM.

    Contributions include:
    Sanjeev Premi for the initial concept:
    http://patchwork.kernel.org/patch/50998/
    Kevin Hilman for converting original design to device-based.
    Kevin Hilman and Paul Walmsey for cleaning up many of the function
    abstractions, improvements and data structure handling.
    Romit Dasgupta for using enums instead of opp pointers.
    Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
    cleanups.
    Linus Walleij for recommending this layer be made generic for usage
    in other architectures beyond OMAP and ARM.
    Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
    valuable improvements.

    Discussions and comments from:
    http://marc.info/?l=linux-omap&m=126033945313269&w=2
    http://marc.info/?l=linux-omap&m=125482970102327&w=2
    http://marc.info/?t=125809247500002&r=1&w=2
    http://marc.info/?l=linux-omap&m=126025973426007&w=2
    http://marc.info/?t=128152609200064&r=1&w=2
    http://marc.info/?t=128468723000002&r=1&w=2
    incorporated.

    v1: http://marc.info/?t=128468723000002&r=1&w=2

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon