Hi Guys,
This patchset add APIs in OPP layer to allow OPPs transitioning from
within OPP layer. Currently all OPP users need to replicate the same
code to switch between OPPs. While the same can be handled easily by
OPP-core.
The first 7 patches update the OPP core to introduce the new APIs and
the next Nine patches update cpufreq-dt for the same.
11 out of 17 are already Reviewed by Stephen, only few are left :)
I hope this is the last version of the series :)
Testing:
- Tested on exynos 5250-arndale (dual-cortex-A15)
- Tested for both Old-V1 bindings and New V2 bindings
- Tested with regulator names as: 'cpu-supply' and 'cpu0-supply'
- Tested with Unsupported supply ranges as well, to check the
opp-disable logic
V2->V3:
- Very minor updates.
- find_supply_name() doesn't return an error value now, and so its
callers don't check for it.
- And so we don't need to initialize name to NULL
Viresh Kumar (16):
PM / OPP: get/put regulators from OPP core
PM / OPP: Disable OPPs that aren't supported by the regulator
PM / OPP: Introduce dev_pm_opp_get_max_volt_latency()
PM / OPP: Introduce dev_pm_opp_get_max_transition_latency()
PM / OPP: Parse clock-latency and voltage-tolerance for v1 bindings
PM / OPP: Manage device clk
PM / OPP: Add dev_pm_opp_set_rate()
cpufreq: dt: Convert few pr_debug/err() calls to dev_dbg/err()
cpufreq: dt: Rename 'need_update' to 'opp_v1'
cpufreq: dt: OPP layers handles clock-latency for V1 bindings as well
cpufreq: dt: Pass regulator name to the OPP core
cpufreq: dt: Unsupported OPPs are already disabled
cpufreq: dt: Reuse dev_pm_opp_get_max_transition_latency()
cpufreq: dt: Use dev_pm_opp_set_rate() to switch frequency
cpufreq: dt: No need to fetch voltage-tolerance
cpufreq: dt: No need to allocate resources anymore
drivers/base/power/opp/core.c | 420 ++++++++++++++++++++++++++++++++++++++++++
drivers/base/power/opp/opp.h | 13 ++
drivers/cpufreq/cpufreq-dt.c | 300 +++++++++++-------------------
include/linux/pm_opp.h | 27 +++
4 files changed, 565 insertions(+), 195 deletions(-)
--
2.7.1.370.gb2aa7f8
Hi,
The main feedback I got for the V3 series came from Kevin, who suggested
that we should reuse OPP tables for genpd devices as well, instead of
creating a new table type. And that's what this version is trying to do.
Some platforms have the capability to configure the performance state of
their power domains. The process of configuring the performance state is
pretty much platform dependent and we may need to work with a wide range
of configurables. For some platforms, like Qcom, it can be a positive
integer value alone, while in other cases it can be voltage levels, etc.
The power-domain framework until now was only designed for the idle
state management of the device and this needs to change in order to
reuse the power-domain framework for active state management of the
devices.
This series adapts the genpd and OPP frameworks to allow OPP tables to
be used for the genpd devices as well.
The first 2 patches update the DT bindings of the power-domains and OPP
tables. And the other 7 patches implement the details in QoS, genpd and
OPP frameworks.
This is tested currently by hacking the kernel a bit with virtual
power-domains for the dual A15 exynos platform. The earlier version of
patches was also tested by Rajendra Nayak (Qcom) on *real* Qualcomm
hardware for which this work is getting done. And so this version should
work as well.
Here is sample DT and C code we need to write for platforms:
DT:
---
/ {
domain_opp_table: opp_table0 {
compatible = "operating-points-v2";
opp@1 {
domain-performance-state = <1>;
opp-microvolt = <975000 970000 985000>;
};
opp@2 {
domain-performance-state = <2>;
opp-microvolt = <1075000 1000000 1085000>;
};
};
foo_domain: power-controller@12340000 {
compatible = "foo,power-controller";
reg = <0x12340000 0x1000>;
#power-domain-cells = <0>;
operating-points-v2 = <&domain_opp_table>;
}
cpu0_opp_table: opp_table1 {
compatible = "operating-points-v2";
opp-shared;
opp@1000000000 {
opp-hz = /bits/ 64 <1000000000>;
domain-performance-state = <1>;
};
opp@1100000000 {
opp-hz = /bits/ 64 <1100000000>;
domain-performance-state = <2>;
};
opp@1200000000 {
opp-hz = /bits/ 64 <1200000000>;
domain-performance-state = <2>;
};
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
clocks = <&clk_controller 0>;
clock-names = "cpu";
operating-points-v2 = <&cpu0_opp_table>;
power-domains = <&foo_domain>;
};
};
};
Driver code:
------------
static int pd_performance(struct generic_pm_domain *domain, unsigned int state)
{
struct dev_pm_opp *opp;
opp = dev_pm_opp_find_dps(&domain->dev, state, true);
/* Use OPP and state in platform specific way */
return 0;
}
static const struct of_device_id pm_domain_of_match[] __initconst = {
{ .compatible = "foo,genpd", },
{ },
};
static int __init genpd_test_init(void)
{
struct device *dev = get_cpu_device(0);
struct device_node *np;
const struct of_device_id *match;
int n;
int ret;
for_each_matching_node_and_match(np, pm_domain_of_match, &match) {
pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1,
GFP_KERNEL);
if (!pd.name) {
of_node_put(np);
return -ENOMEM;
}
pd.set_performance_state = pd_performance;
pm_genpd_init(&pd, NULL, false);
of_genpd_add_provider_simple(np, &pd);
}
ret = dev_pm_domain_attach(dev, false);
return ret;
}
Pushed here as well:
https://git.linaro.org/people/viresh.kumar/linux.git/log/?h=opp/genpd-perfo…
V3->V4:
- Use OPP table for genpd devices as well.
- Add struct device to genpd, in order to reuse OPP infrastructure.
- Based over: https://marc.info/?l=linux-kernel&m=148972988002317&w=2
- Fixed examples in DT document to have voltage in target,min,max order.
V2->V3:
- Based over latest pm/linux-next
- Bindings and code are merged together
- Lots of updates in bindings
- the performance-states node is present within the power-domain now,
instead of its phandle.
- performance-level property is replaced by "reg".
- domain-performance-state property of the consumers contain an
integer value now instead of phandle.
- Lots of updates to the code as well
- Patch "PM / QOS: Add default case to the switch" is merged with
other patches and the code is changed a bit as well.
- Don't pass 'type' to dev_pm_qos_add_notifier(), rather handle all
notifiers with a single list. A new patch is added for that.
- The OPP framework patch can be applied now and has proper SoB from
me.
- Dropped "PM / domain: Save/restore performance state at runtime
suspend/resume".
- Drop all WARN().
- Tested-by Rajendra nayak.
V1->V2:
- Based over latest pm/linux-next
- It is mostly a resend of what is sent earlier as this series hasn't
got any reviews so far and Rafael suggested that its better I resend
it.
- Only the 4/6 patch got an update, which was shared earlier as reply to
V1 as well. It has got several fixes for taking care of power domain
hierarchy, etc.
--
viresh
Viresh Kumar (9):
PM / OPP: Allow OPP table to be used for power-domains
PM / Domains: Use OPP tables for power-domains
PM / QOS: Keep common notifier list for genpd constraints
PM / QOS: Add DEV_PM_QOS_PERFORMANCE request
PM / OPP: Add support to parse OPP table for power-domains
PM / OPP: Add dev_pm_opp_find_dps() helper
PM / domain: Register for PM QOS performance notifier
PM / Domain: Add struct device to genpd
PM / Domain: Add support to parse domain's OPP table
Documentation/devicetree/bindings/opp/opp.txt | 73 ++++++-
.../devicetree/bindings/power/power_domain.txt | 42 ++++
Documentation/power/pm_qos_interface.txt | 2 +-
drivers/base/power/domain.c | 183 ++++++++++++++--
drivers/base/power/opp/core.c | 229 +++++++++++++++++++--
drivers/base/power/opp/debugfs.c | 9 +-
drivers/base/power/opp/of.c | 80 ++++++-
drivers/base/power/opp/opp.h | 14 ++
drivers/base/power/qos.c | 36 +++-
include/linux/pm_domain.h | 6 +
include/linux/pm_opp.h | 8 +
include/linux/pm_qos.h | 17 ++
kernel/power/qos.c | 2 +-
13 files changed, 646 insertions(+), 55 deletions(-)
--
2.12.0.432.g71c3a4f4ba37
Now extcon-usb-gpio only supports for GPIO egdge trigger, but VBUS/ID
gpios' detection can be triggered by the level trigger on some platforms.
Thus intoduce one property 'extcon-gpio,level-trigger' to identify this
situation.
Signed-off-by: Baolin Wang <baolin.wang(a)linaro.org>
---
.../devicetree/bindings/extcon/extcon-usb-gpio.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
index dfc14f7..191504b 100644
--- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
+++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
@@ -9,6 +9,9 @@ Required properties:
Either one of id-gpio or vbus-gpio must be present. Both can be present as well.
- id-gpio: gpio for USB ID pin. See gpio binding.
- vbus-gpio: gpio for USB VBUS pin.
+- extcon-gpio,level-trigger: Boolean, set this gpio's interrupt flag to
+level trigger. If not specified defaults to false, gpio's interrupt flag
+defaults to edge trigger.
Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below:
extcon_usb1 {
--
1.7.9.5
Hi,
This is based of the work done by Steve Muckle [1] before he left Linaro
and most of the patches are still under his authorship. I have done
couple of improvements (detailed in individual patches) and removed the
late callback support [2] as I wasn't sure of the value it adds. We can
include it separately if others feel it is required. This series is
based on pm/linux-next with patches [3] and [4] applied on top of it.
With Android UI and benchmarks the latency of cpufreq response to
certain scheduling events can become very critical. Currently, callbacks
into schedutil are only made from the scheduler if the target CPU of the
event is the same as the current CPU. This means there are certain
situations where a target CPU may not run schedutil for some time.
One testcase to show this behavior is where a task starts running on
CPU0, then a new task is also spawned on CPU0 by a task on CPU1. If the
system is configured such that new tasks should receive maximum demand
initially, this should result in CPU0 increasing frequency immediately.
Because of the above mentioned limitation though this does not occur.
This is verified using ftrace with the sample [5] application.
This patchset updates the scheduler to call cpufreq callbacks for remote
CPUs as well and updates schedutil governor to deal with it. An
additional flag is added to cpufreq policies to avoid sending IPIs to
remote CPUs to update the frequency, if CPUs on the platform can change
frequency of any other CPU.
This series is tested with couple of usecases (Android: hackbench,
recentfling, galleryfling, vellamo, Ubuntu: hackbench) on ARM hikey
board (64 bit octa-core, single policy). Only galleryfling showed minor
improvements, while others didn't had much deviation.
The reason being that this patchset only targets a corner case, where
following are required to be true to improve performance and that
doesn't happen too often with these tests:
- Task is migrated to another CPU.
- The task has maximum demand initially, and should take the CPU to
higher OPPs.
- And the target CPU doesn't call into schedutil until the next tick,
without this patchset.
--
viresh
[1] https://git.linaro.org/people/steve.muckle/kernel.git/log/?h=pmwg-integrati…
[2] https://git.linaro.org/people/steve.muckle/kernel.git/commit/?h=pmwg-integr…
[3] https://marc.info/?l=linux-kernel&m=148766093718487&w=2
[4] https://marc.info/?l=linux-kernel&m=148903231720432&w=2
[5] http://pastebin.com/7LkMSRxE
Steve Muckle (8):
sched: cpufreq: add cpu to update_util_data
irq_work: add irq_work_queue_on for !CONFIG_SMP
sched: cpufreq: extend irq work to support fast switches
sched: cpufreq: remove smp_processor_id() in remote paths
sched: cpufreq: detect, process remote callbacks
cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs
intel_pstate: ignore scheduler cpufreq callbacks on remote CPUs
sched: cpufreq: enable remote sched cpufreq callbacks
Viresh Kumar (1):
cpufreq: Add dvfs_possible_from_any_cpu policy flag
drivers/cpufreq/cpufreq-dt.c | 1 +
drivers/cpufreq/cpufreq_governor.c | 2 +-
drivers/cpufreq/intel_pstate.c | 3 ++
include/linux/cpufreq.h | 9 +++++
include/linux/irq_work.h | 7 ++++
include/linux/sched/cpufreq.h | 1 +
kernel/sched/cpufreq.c | 1 +
kernel/sched/cpufreq_schedutil.c | 80 +++++++++++++++++++++++++++++---------
kernel/sched/fair.c | 6 ++-
kernel/sched/sched.h | 3 +-
10 files changed, 90 insertions(+), 23 deletions(-)
--
2.7.1.410.g6faf27b
Hi Guys,
The cpu_cooling driver is designed to use CPU frequency scaling to avoid
high thermal states for a platform. But it wasn't glued really well with
cpufreq core.
This series tries to improve interactions between cpufreq core and
cpu_cooling driver and does some fixes/cleanups to the cpu_cooling
driver.
I am a bit confused about which tree this series should go through, PM
or thermal.
This series has dependency on few other patches which are already merged
in the PM [1] tree and thermal [2] tree. As this is 4.12 material, all
of this should go through only one tree to avoid conflicts.
I assume that one of Rafael and Rui have to drop the existing patch(es)
from their trees and let the other one apply all of these. I would let
you guys decide on that. Sorry for the trouble.
I have tested it on ARM 32 (exynos) and 64 bit (hikey) boards and have
pushed them for 0-day build bot and kernel CI testing as well. We should
know if something is broken with these.
@Javi: It would be good if you can give them a test, specially because
of your work on the "power" specific bits in the driver.
Pushed here as well:
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git thermal/cooling
--
viresh
[1] https://marc.info/?l=linux-kernel&m=148946890403271&w=2
[2] https://marc.info/?l=linux-kernel&m=148644060126593&w=2
Viresh Kumar (17):
thermal: cpu_cooling: Avoid accessing potentially freed structures
thermal: cpu_cooling: rearrange globals
thermal: cpu_cooling: Replace cpufreq_device with cpufreq_dev
thermal: cpu_cooling: replace cool_dev with cdev
thermal: cpu_cooling: remove cpufreq_cooling_get_level()
thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()
thermal: cpu_cooling: use cpufreq_policy to register cooling device
cpufreq: create cpufreq_table_count_valid_entries()
thermal: cpu_cooling: store cpufreq policy
thermal: cpu_cooling: OPPs are registered for all CPUs
thermal: cpu_cooling: get rid of 'allowed_cpus'
thermal: cpu_cooling: merge frequency and power tables
thermal: cpu_cooling: create structure for idle time stats
thermal: cpu_cooling: get_level() can't fail
thermal: cpu_cooling: don't store cpu_dev in cpufreq_dev
thermal: cpu_cooling: 'freq' can't be zero in cpufreq_state2power()
thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device
drivers/cpufreq/arm_big_little.c | 2 +-
drivers/cpufreq/cpufreq-dt.c | 2 +-
drivers/cpufreq/cpufreq_stats.c | 13 +-
drivers/cpufreq/dbx500-cpufreq.c | 2 +-
drivers/cpufreq/mt8173-cpufreq.c | 4 +-
drivers/cpufreq/qoriq-cpufreq.c | 3 +-
drivers/thermal/cpu_cooling.c | 530 ++++++++-------------
drivers/thermal/imx_thermal.c | 22 +-
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 22 +-
include/linux/cpu_cooling.h | 32 +-
include/linux/cpufreq.h | 14 +
11 files changed, 272 insertions(+), 374 deletions(-)
--
2.7.1.410.g6faf27b