05 May, 2016

2 commits

  • Functions dev_pm_opp_of_{cpumask_,}remove_table removes/frees all the
    static OPP entries associated with the device and/or all cpus(in case
    of cpumask) that are created from DT.

    However the OPP entries are populated reading from the firmware or some
    different method using dev_pm_opp_add are marked dynamic and can't be
    removed using above functions.

    This patch adds non DT/OF versions of dev_pm_opp_{cpumask_,}remove_table
    to support the above mentioned usecase.

    This is in preparation to make use of the same in scpi-cpufreq.c

    Signed-off-by: Sudeep Holla
    Acked-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Sudeep Holla
     
  • The new use of dev_pm_opp_set_sharing_cpus resulted in a harmless compiler
    warning with CONFIG_CPUMASK_OFFSTACK=y:

    drivers/cpufreq/mvebu-cpufreq.c: In function 'armada_xp_pmsu_cpufreq_init':
    include/linux/cpumask.h:550:25: error: passing argument 2 of 'dev_pm_opp_set_sharing_cpus' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

    The problem here is that cpumask_var_t gets passed by reference, but
    by declaring a 'const cpumask_var_t' argument, only the pointer is
    constant, not the actual mask. This is harmless because the function
    does not actually modify the mask.

    This patch changes the function prototypes for all of the related functions
    to pass a 'struct cpumask *' instead of 'cpumask_var_t', matching what
    most other such functions do in the kernel. This lets us mark all the
    other similar functions as taking a 'const' mask where possible,
    and it avoids the warning without any change in object code.

    Signed-off-by: Arnd Bergmann
    Fixes: 947bd567f7a5 (mvebu: Use dev_pm_opp_set_sharing_cpus() to mark OPP tables as shared)
    Acked-by: Pavel Machek
    Acked-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Arnd Bergmann
     

28 Apr, 2016

3 commits

  • OPP core allows a platform to mark OPP table as shared, when the
    platform isn't using operating-points-v2 bindings.

    And, so there should be a non DT way of finding out if the OPP table is
    shared or not.

    This patch adds dev_pm_opp_get_sharing_cpus(), which first tries to get
    OPP sharing information from the opp-table (in case it is already marked
    as shared), otherwise it uses the existing DT way of finding sharing
    information.

    Signed-off-by: Viresh Kumar
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • dev_pm_opp_set_sharing_cpus() isn't supposed to update the cpumask
    passed as its parameter, and so it should always have been marked
    'const'.

    Do it now.

    Signed-off-by: Viresh Kumar
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Some of the routines have used -ENOSYS for the cases where the
    functionality isn't implemented in the kernel. But ENOSYS is supposed to
    be used only for syscalls.

    Replace that with -ENOTSUPP, which specifically means that the operation
    isn't supported.

    While at it, replace exiting -EINVAL errors for similar cases to
    -ENOTSUPP.

    Signed-off-by: Viresh Kumar
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

25 Apr, 2016

1 commit


10 Feb, 2016

4 commits

  • This adds a routine, dev_pm_opp_set_rate(), responsible for configuring
    power-supply and clock source for an OPP.

    The OPP is found by matching against the target_freq passed to the
    routine. This shall replace similar code present in most of the OPP
    users and help simplify them a lot.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • In few use cases (like: cpufreq), it is desired to get the maximum
    latency for changing OPPs. Add support for that.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • In few use cases (like: cpufreq), it is desired to get the maximum
    voltage latency for changing OPPs. Add support for that.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • This allows the OPP core to request/free the regulator resource,
    attached to a device OPP. The regulator device is fetched using the name
    provided by the driver, while calling: dev_pm_opp_set_regulator().

    This will work for both OPP-v1 and v2 bindings.

    This is a preliminary step for moving the OPP switching logic into the
    OPP core.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

11 Dec, 2015

2 commits

  • OPP bindings (for few properties) allow a platform to choose a
    value/range among a set of available options. The options are present as
    opp--, where the platform needs to supply the string.

    The OPP properties which allow such an option are: opp-microvolt and
    opp-microamp.

    Add support to the OPP-core to parse these bindings, by introducing
    dev_pm_opp_{set|put}_prop_name() APIs.

    Signed-off-by: Viresh Kumar
    Tested-by: Lee Jones
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • OPP bindings allow a platform to enable OPPs based on the version of the
    hardware they are used for.

    Add support to the OPP-core to parse these bindings, by introducing
    dev_pm_opp_{set|put}_supported_hw() APIs.

    Signed-off-by: Viresh Kumar
    Tested-by: Lee Jones
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

15 Sep, 2015

2 commits


09 Sep, 2015

1 commit


07 Aug, 2015

3 commits

  • Add dev_pm_opp_is_turbo() helper to verify if an opp is to be used only
    for turbo mode or not.

    Reviewed-by: Stephen Boyd
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Bartlomiej Zolnierkiewicz
     
  • With "operating-points-v2" its possible to tell which devices share
    OPPs. We already have infrastructure to decode that information.

    This patch adds following APIs:
    - of_get_cpus_sharing_opps: Returns cpumask of CPUs sharing OPPs (only
    valid with v2 bindings).
    - of_cpumask_init_opp_table: Initializes OPPs for all CPUs present in
    cpumask.
    - of_cpumask_free_opp_table: Frees OPPs for all CPUs present in cpumask.

    - set_cpus_sharing_opps: Sets which CPUs share OPPs (only valid with old
    OPP bindings, as this information isn't present in DT).

    Reviewed-by: Stephen Boyd
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • With "operating-points-v2" bindings, clock-latency is defined per OPP.
    Users of this value expect a single value which defines the latency to
    switch to any clock rate. Find maximum clock-latency-ns from the OPP
    table to service requests from such users.

    Reviewed-by: Stephen Boyd
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

30 Nov, 2014

1 commit

  • OPPs are created statically (from DT) or dynamically. Currently we don't free
    OPPs that are created statically, when the module unloads. And so if the module
    is inserted back again, we get warning for duplicate OPPs as the same were
    already present.

    Also, there might be a need to remove dynamic OPPs in future and so API for that
    is also added.

    This patch adds helper APIs to remove/free existing static and dynamic OPPs.

    Because the OPPs are used both under RCU and SRCU, we have to wait for grace
    period of both. And so are using kfree_rcu() from within call_srcu().

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

07 May, 2014

1 commit

  • 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
     

26 Oct, 2013

1 commit