Voltage tolerance isn't necessarily same on both sides of the target
voltage and regulator_set_voltage_tol() wouldn't be suitable in such
cases.
Add another routine regulator_set_voltage_triplet(), which accepts
target, min and max voltages as arguments.
This first tries to set the voltage between the target voltage and the
upper limit, then fall back on the full range. The idea behind this is
to set regulator's voltage as close to the target voltage, as possible.
Based on regulator_set_voltage_tol().
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
V2->V3:
- Improve commit log, with how its useful at regulator API level.
- Compare regulator_set_voltage() == 0, instead of
!regulator_set_voltage().
V1->V2:
- Change the order of arguments to regulator_set_voltage_triplet() to
min/target/max instead of target/min/max.
include/linux/regulator/consumer.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f8a689ed62a5..e325d4606b62 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -552,6 +552,16 @@ static inline int regulator_count_voltages(struct regulator *regulator)
}
#endif
+static inline int regulator_set_voltage_triplet(struct regulator *regulator,
+ int min_uV, int target_uV,
+ int max_uV)
+{
+ if (regulator_set_voltage(regulator, target_uV, max_uV) == 0)
+ return 0;
+
+ return regulator_set_voltage(regulator, min_uV, max_uV);
+}
+
static inline int regulator_set_voltage_tol(struct regulator *regulator,
int new_uV, int tol_uV)
{
--
2.4.0
Dear All,
Please consider the patch, It is related to HMP force up migration. It will avoid sending of unnecessary interrupts to CPUs of faster domain hence increase performance.
--------------------------------------------------------------------------------------------------
>From 2d48749ac30a2c0a2ef77132f303d69605c3dd3f Mon Sep 17 00:00:00 2001
From: rahulkhandelwal <rahul.khandelwal(a)spreadtrum.com>
Date: Fri, 14 Aug 2015 16:36:17 +0800
Subject: [PATCH 1/1] HMP: Do not send IPI if core already waked up
It is possible that we are sending IPI to a cpu in faster domain which is
already waked up by other CPU in smaller domain.
HMP select the idle CPU using hmp_domain_min_load. Based on that HMP send IPI
to the idle cpu in faster domain. There could be some latency by the core to
wake up and set wake_for_idle_pull = 0. Next smaller cpu again check for
idle CPU in faster domain and send IPI to already waked up CPU.
For example: In Octacore system, 0-3 are slower CPUs and 4-7 are faster CPUs.
CPU0 and CPU1 has heavy tasks and CPU4 is idle.
CPU0 execute hmp_force_up_migration find CPU4 as idle, it send IPI to CPU4
and return. After that CPU1 got the chance to run hmp_force_up_migration,
it again find CPU4 as idle, send IPI to CPU4, which is not required.
Signed-off-by: rahulkhandelwal <rahul.khandelwal(a)spreadtrum.com>
---
kernel/sched/fair.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1baf641..388836c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7200,6 +7200,11 @@ static void hmp_force_up_migration(int this_cpu)
}
p = task_of(curr);
if (hmp_up_migration(cpu, &target_cpu, curr)) {
+ if (cpu_rq(target_cpu)->wake_for_idle_pull == 1) {
+ raw_spin_unlock_irqrestore(&target->lock, flags);
+ spin_unlock(&hmp_force_migration);
+ return;
+ }
cpu_rq(target_cpu)->wake_for_idle_pull = 1;
raw_spin_unlock_irqrestore(&target->lock, flags);
spin_unlock(&hmp_force_migration);
--
1.7.9.5
Tree/Branch: next-20150825
Git describe: next-20150825
Commit: 512450361e Add linux-next specific files for 20150825
Build Time: 6 min 39 sec
Passed: 7 / 9 ( 77.78 %)
Failed: 2 / 9 ( 22.22 %)
Errors: 2
Warnings: 13
Section Mismatches: 0
Failed defconfigs:
arm64-allmodconfig
arm-allmodconfig
Errors:
arm64-allmodconfig
../scripts/sign-file.c:20:25: fatal error: openssl/bio.h: No such file or directory
../scripts/extract-cert.c:23:25: fatal error: openssl/bio.h: No such file or directory
arm-allmodconfig
../scripts/sign-file.c:20:25: fatal error: openssl/bio.h: No such file or directory
../scripts/extract-cert.c:23:25: fatal error: openssl/bio.h: No such file or directory
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
2 warnings 0 mismatches : arm64-allnoconfig
1 warnings 0 mismatches : arm64-allmodconfig
10 warnings 0 mismatches : arm-multi_v5_defconfig
14 warnings 0 mismatches : arm-multi_v7_defconfig
3 warnings 0 mismatches : x86_64-defconfig
3 warnings 0 mismatches : arm-allmodconfig
3 warnings 0 mismatches : arm-allnoconfig
2 warnings 0 mismatches : arm64-defconfig
-------------------------------------------------------------------------------
Errors summary: 2
2 ../scripts/sign-file.c:20:25: fatal error: openssl/bio.h: No such file or directory
2 ../scripts/extract-cert.c:23:25: fatal error: openssl/bio.h: No such file or directory
Warnings Summary: 13
10 <stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
6 <stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
6 <stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
3 ../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
3 ../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
2 ../drivers/dma/ipu/ipu_irq.c:305:22: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
2 ../block/blk-merge.c:91:9: warning: 'bvprv.bv_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../sound/soc/tegra/tegra20_spdif.c:361:24: warning: unused variable 'spdif' [-Wunused-variable]
1 ../net/bluetooth/mgmt.c:6643:8: warning: 'r192' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../net/bluetooth/mgmt.c:6643:8: warning: 'h192' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../kernel/sched/rt.c:68:13: warning: 'push_irq_work_func' declared 'static' but never defined [-Wunused-function]
1 ../include/asm-generic/memory_model.h:52:52: warning: 'bvprv.bv_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm204.c:975:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allnoconfig : PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
../kernel/sched/rt.c:68:13: warning: 'push_irq_work_func' declared 'static' but never defined [-Wunused-function]
-------------------------------------------------------------------------------
arm64-allmodconfig : FAIL, 2 errors, 1 warnings, 0 section mismatches
Errors:
../scripts/sign-file.c:20:25: fatal error: openssl/bio.h: No such file or directory
../scripts/extract-cert.c:23:25: fatal error: openssl/bio.h: No such file or directory
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
-------------------------------------------------------------------------------
arm-multi_v5_defconfig : PASS, 0 errors, 10 warnings, 0 section mismatches
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
../block/blk-merge.c:91:9: warning: 'bvprv.bv_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
../drivers/dma/ipu/ipu_irq.c:305:22: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : PASS, 0 errors, 14 warnings, 0 section mismatches
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
../block/blk-merge.c:91:9: warning: 'bvprv.bv_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
../net/bluetooth/mgmt.c:6643:8: warning: 'r192' may be used uninitialized in this function [-Wmaybe-uninitialized]
../net/bluetooth/mgmt.c:6643:8: warning: 'h192' may be used uninitialized in this function [-Wmaybe-uninitialized]
../sound/soc/tegra/tegra20_spdif.c:361:24: warning: unused variable 'spdif' [-Wunused-variable]
../drivers/dma/ipu/ipu_irq.c:305:22: warning: 'irq' may be used uninitialized in this function [-Wmaybe-uninitialized]
../drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm204.c:975:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
-------------------------------------------------------------------------------
x86_64-defconfig : PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/linux/blkdev.h:1368:21: warning: 'bvprv.bv_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/asm-generic/memory_model.h:52:52: warning: 'bvprv.bv_page' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm-allmodconfig : FAIL, 2 errors, 3 warnings, 0 section mismatches
Errors:
../scripts/sign-file.c:20:25: fatal error: openssl/bio.h: No such file or directory
../scripts/extract-cert.c:23:25: fatal error: openssl/bio.h: No such file or directory
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
-------------------------------------------------------------------------------
arm-allnoconfig : PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1301:2: warning: #warning syscall mlock2 not implemented [-Wcpp]
<stdin>:1304:2: warning: #warning syscall membarrier not implemented [-Wcpp]
-------------------------------------------------------------------------------
arm64-defconfig : PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
<stdin>:1298:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
x86_64-allnoconfig