The ahead of 3 patches removed the load_idx of cpu_load.
The 4th patch fixed a incorrect cpu_load assign for nohz_full
performance testing result is comming soon.
Any comments are appreciated!
Regards
Alex
Hi,
Here is version 4 of fix to armv7-m build failure in
sigreturn_codes.S. The difference with version 3 is
fixed formating and renamed internally used macro
as per Dave's comments on [3].
Solution is based on .org directive Dave's suggestion
on last email in [1].
It uses conditional compilation and it uses .org
directive to keep sigreturn_codes layout.
Note I did not use ARM and THUMB macros because
those switch between CONFIG_THUMB2_KERNEL and not.
On v7a kernel we need both arm and thumb snipets
regardless of CONFIG_THUMB2_KERNEL setting.
And conditional compilation only kicks in with
CONFIG_CPU_THUMBONLY, for that local ARM_INSTR
macro is created.
Version 3 [3] conditional compilation and .org directive.
Pretty much the same code but incorrectly formated. Please
look at [3] for details.
Version 2 [2] tried to use '.acrh armv4t' directive
to allow both arm and thumb2 opcodes, but solution
deemed to be too fragile.
Version 1 [1] used conditional compilation and added
thumb2 nop instructions in CONFIG_CPU_THUMBONLY
Fix was tested
linux-next with efm32_defconfig build (along with few other fixes)
rmk-next BE/LE vexpress build/boot and LTP rt_sigaction0? tests run
Uwe tested version 1 and 3 with efm32
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210393.…
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210949.…
[3] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/212307.…
Victor Kamensky (1):
ARM: signal: fix armv7-m build issue in sigreturn_codes.S
arch/arm/kernel/sigreturn_codes.S | 40 ++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
--
1.8.1.4
Hi Rafael,
These are V2 of my CPUIdle cleanup series.. Few patches are dropped as they
required further modifications. Last one is rewritten as suggested by Daniel.
Most of them are already Acked by Daniel.
Viresh Kumar (16):
cpuidle: fix indentation of cpumask
cpuidle: Fix comments in cpuidle core
cpuidle: make __cpuidle_get_cpu_driver() inline
cpuidle: make __cpuidle_device_init() return void
cpuidle: make __cpuidle_driver_init() return void
cpuidle: rearrange code in __cpuidle_driver_init()
cpuidle: rearrange __cpuidle_register_device() to keep minimal exit
points
cpuidle: merge two if() statements for checking error cases
cpuidle: reduce code duplication inside cpuidle_idle_call()
cpuidle: replace multiline statements with single line in
cpuidle_idle_call()
cpuidle: call cpuidle_get_driver() from after taking
cpuidle_driver_lock
cpuidle: use drv instead of cpuidle_driver in show_current_driver()
cpuidle: free all state kobjects from cpuidle_free_state_kobj()
cpuidle: don't calculate time-diff if entered_state < 0
cpuidle: don't call poll_idle_init() for every cpu
cpuidle: remove cpuidle_unregister_governor()
Documentation/cpuidle/governor.txt | 1 -
drivers/cpuidle/coupled.c | 2 +-
drivers/cpuidle/cpuidle.c | 95 ++++++++++----------------------------
drivers/cpuidle/driver.c | 69 ++++++++++++++++++++-------
drivers/cpuidle/governor.c | 43 -----------------
drivers/cpuidle/sysfs.c | 30 ++++++------
include/linux/cpuidle.h | 8 +---
7 files changed, 94 insertions(+), 154 deletions(-)
--
1.7.12.rc2.18.g61b472e
This script bisects kernel for build/boot/func regressions on
appointed board, run it under target kernel source tree.
If kernel friendly for network, it is a fully automatic bisect
script, otherwise it is a semi-automatic scripts.
It will be better if has some way to automatic hardware reset board
power. Or has some way send command via serial.
Usage:
$./bisect.sh -g v3.11~2 -b v3.11 -t func 2>&1 | tee func.log
Any comments are appreciated!
--
Thanks
Alex
Hi Thomas,
This was earlier discussed here (Well, Not much :)):
https://lkml.org/lkml/2012/11/6/160
I am floating the idea again to get more attention on this patch. This is just
an idea for now, haven't seen much testing..
Migration of timers from idle cores to non-idle ones for power saving is very
well working and really saves a lot of power for us. What's currently not
working is the migration of running timers Or timers which re-arms themselves.
There are complications with migrating timers which schedules themselves again
from their handler. del_timer_sync() can't detect that the timer's handler
yet has not finished.
__mod_timer migrates the timer with following code:
...
spin_lock(&old_base->lock);
...
timer_set_base(timer, NULL);
spin_unlock(&old_base->lock); ->A
spin_lock(&new_base->lock); ->B
timer_set_base(timer, new_base);
...
After the unlock at time A, old_base->running_timer may get updated to the next
timer in queue. After lock at time B, lock_timer_base() will return new_base
where another timer might be running timer at that point of time.
Whereas, del_timer_sync() depends on below code to check if a timer's handler is
currently running or not.
if (base->running_timer != timer)
Because there is window where timer's handler would be running and at the same
time it wasn't marked as running timer for any of the bases (well, it matters
only for its current base, i.e. new_base). del_timer_sync() wouldn't know this
and will go on and delete the timer, whose handler is currently running.
The new approach tries to mark such timers with wait_for_migration_to_complete
flag (can be named better and some memory can be saved as PeterZ suggested),
which will be used in del_timer_sync() to see if the timer is currently
migrating and so isn't marked as running_timer of its base.
Benefits: Well, obviously saving power for a core which is being interrupted
again and again in its idle loop by this timer event. Which will also prevent
the core to go in deeper idle states if possible.
Please share your feedback on this approach.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
include/linux/timer.h | 1 +
kernel/timer.c | 29 +++++++++++++----------------
2 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 8c5a197..ad00ebe 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -20,6 +20,7 @@ struct timer_list {
void (*function)(unsigned long);
unsigned long data;
+ int wait_for_migration_to_complete;
int slack;
diff --git a/kernel/timer.c b/kernel/timer.c
index 6582b82..30a93e6 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -748,21 +748,15 @@ __mod_timer(struct timer_list *timer, unsigned long expires,
new_base = per_cpu(tvec_bases, cpu);
if (base != new_base) {
- /*
- * We are trying to schedule the timer on the local CPU.
- * However we can't change timer's base while it is running,
- * otherwise del_timer_sync() can't detect that the timer's
- * handler yet has not finished. This also guarantees that
- * the timer is serialized wrt itself.
- */
- if (likely(base->running_timer != timer)) {
- /* See the comment in lock_timer_base() */
- timer_set_base(timer, NULL);
- spin_unlock(&base->lock);
- base = new_base;
- spin_lock(&base->lock);
- timer_set_base(timer, base);
- }
+ if (base->running_timer == timer)
+ timer->wait_for_migration_to_complete = 1;
+
+ /* See the comment in lock_timer_base() */
+ timer_set_base(timer, NULL);
+ spin_unlock(&base->lock);
+ base = new_base;
+ spin_lock(&base->lock);
+ timer_set_base(timer, base);
}
timer->expires = expires;
@@ -992,7 +986,8 @@ int try_to_del_timer_sync(struct timer_list *timer)
base = lock_timer_base(timer, &flags);
- if (base->running_timer != timer) {
+ if ((base->running_timer != timer) &&
+ !timer->wait_for_migration_to_complete) {
timer_stats_timer_clear_start_info(timer);
ret = detach_if_pending(timer, base, true);
}
@@ -1185,6 +1180,8 @@ static inline void __run_timers(struct tvec_base *base)
call_timer_fn(timer, fn, data);
spin_lock_irq(&base->lock);
}
+ if (timer->wait_for_migration_to_complete)
+ timer->wait_for_migration_to_complete = 0;
}
}
base->running_timer = NULL;
--
1.7.12.rc2.18.g61b472e
commit 46a310b ([CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has
incorrect value.) tries to handle case where policy->cur does not match any
entry in freq_table.
As indicated in the above commit, the exact match search of freq_table_get index
will return a -1 which is stored in stat->last_index. However, as a result of
the above commit, cpufreq_stat_notifier_trans which updates the statistics,
fails to update any *further* valid transitions that take place as
stat->last_index is -1 as the condition occurs at boot and never solved.
To fix this issue, lets create another entry for time_in_state and trans_table
that will tell the user that CPU was running on unknown frequency for some time.
This is how the output looks like on my thinkpad (Removed some entries to keep
it simple):
$ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
2800000 46
2600000 138
1200000 65
1000000 152
800000 34803
unknown 0
$ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
From : To
: 2801000 2800000 2600000 2400000 2200000 2000000 unknown
2801000: 0 15 20 9 13 17 0
2800000: 13 0 4 1 0 1 0
2600000: 26 1 0 5 1 1 0
2400000: 11 0 6 0 1 1 0
2200000: 8 1 5 3 0 0 0
2000000: 11 1 2 1 2 0 0
unknown: 0 0 0 0 0 0 0
Reported-by: Carlos Hernandez <ceh(a)ti.com>
Reported-and-tested-by: Nishanth Menon <nm(a)ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
drivers/cpufreq/cpufreq_stats.c | 45 ++++++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 4cf0d28..ebb21cd 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -72,9 +72,13 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
return 0;
cpufreq_stats_update(stat->cpu);
for (i = 0; i < stat->state_num; i++) {
- len += sprintf(buf + len, "%u %llu\n", stat->freq_table[i],
- (unsigned long long)
- jiffies_64_to_clock_t(stat->time_in_state[i]));
+ if (stat->freq_table[i] == -1)
+ return sprintf(buf + len, "unknown");
+ else
+ return sprintf(buf + len, "%u", stat->freq_table[i]);
+
+ len += sprintf(buf + len, " %llu\n", (unsigned long long)
+ jiffies_64_to_clock_t(stat->time_in_state[i]));
}
return len;
}
@@ -94,8 +98,12 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
for (i = 0; i < stat->state_num; i++) {
if (len >= PAGE_SIZE)
break;
- len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
- stat->freq_table[i]);
+ if (stat->freq_table[i] == -1)
+ len += snprintf(buf + len, PAGE_SIZE - len, "%9s ",
+ "unknown");
+ else
+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
+ stat->freq_table[i]);
}
if (len >= PAGE_SIZE)
return PAGE_SIZE;
@@ -106,8 +114,12 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
if (len >= PAGE_SIZE)
break;
- len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",
- stat->freq_table[i]);
+ if (stat->freq_table[i] == -1)
+ len += snprintf(buf + len, PAGE_SIZE - len, "%9s: ",
+ "unknown");
+ else
+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",
+ stat->freq_table[i]);
for (j = 0; j < stat->state_num; j++) {
if (len >= PAGE_SIZE)
@@ -145,10 +157,12 @@ static struct attribute_group stats_attr_group = {
static int freq_table_get_index(struct cpufreq_stats *stat, unsigned int freq)
{
int index;
- for (index = 0; index < stat->max_state; index++)
+ for (index = 0; index < stat->max_state - 1; index++)
if (stat->freq_table[index] == freq)
return index;
- return -1;
+
+ /* Last state is INVALID, to mark out of table frequency */
+ return stat->max_state - 1;
}
/* should be called late in the CPU removal sequence so that the stats
@@ -222,6 +236,9 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
count++;
}
+ /* An extra entry for Invalid frequencies */
+ count++;
+
alloc_size = count * sizeof(int) + count * sizeof(u64);
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
@@ -243,9 +260,13 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy,
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
- if (freq_table_get_index(stat, freq) == -1)
+ if (freq_table_get_index(stat, freq) == stat->max_state - 1)
stat->freq_table[j++] = freq;
}
+
+ /* Mark Invalid freq as max value to indicate Invalid freq */
+ stat->freq_table[j++] = -1;
+
stat->state_num = j;
spin_lock(&cpufreq_stats_lock);
stat->last_time = get_jiffies_64();
@@ -315,10 +336,6 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
old_index = stat->last_index;
new_index = freq_table_get_index(stat, freq->new);
- /* We can't do stat->time_in_state[-1]= .. */
- if (old_index == -1 || new_index == -1)
- return 0;
-
cpufreq_stats_update(freq->cpu);
if (old_index == new_index)
--
1.7.12.rc2.18.g61b472e
As the title
Best regards
Wally Mao(毛卫洋)
ARM China Field Application Engineer
-----------------------------------------------------------------------------------------------------------------------
Tel: +8610-82603572 ext:26 Fax: +8610-82603573
Mobile: +86-18618145074
Address: Room 602, Ideal Plaza,58 West Road, North 4th Ring Road, Haidian District, Beijing 100080
北京市海淀区北四环西路58号理想国际大厦602室(100080)
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
Hi,
Here is version 3 of fix to armv7-m build failure in
sigreturn_codes.S. It is based on .org directive
Dave's suggestion on last email in [1].
It uses conditional compilation and it uses .org
directive to keep sigreturn_codes layout.
Note I did not use ARM and THUMB macros because
those switch between CONFIG_THUMB2_KERNEL and not.
On v7a kernel we need both arm and thumb snipets
regardless of CONFIG_THUMB2_KERNEL setting.
And conditional compilation only kicks in with
CONFIG_CPU_THUMBONLY, for that local ARM_INSTR
macro is created.
Version 1 [1] used conditional compilation and added
thumb2 nop instructions in CONFIG_CPU_THUMBONLY
Version 2 [2] tried to use '.acrh armv4t' directive
to allow both arm and thumb2 opcodes, but solution
deemed to be too fragile.
Fix was tested
linux-next with efm32_defconfig build (along with few other fixes)
rmk-next BE/LE arndale build/boot and LTP rt_sigaction0? tests run
Dave, I've added your name with Suggested-by tag, please
let me know if it is not OK with you, I'll remove it then.
Uwe, is it possible for you to test that this fix runs on
efm32? Sorry, for multiple requests.
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210393.…
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210949.…
Victor Kamensky (1):
ARM: signal: fix armv7-m build issue in sigreturn_codes.S
arch/arm/kernel/sigreturn_codes.S | 40 ++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
--
1.8.1.4
The 'u64 last_update' variable isn't used now, remove it to save a
bit space.
Signed-off-by: Alex Shi <alex.shi(a)linaro.org>
---
include/linux/sched.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6f7ffa4..ac68802 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -831,8 +831,6 @@ struct sched_domain {
unsigned int balance_interval; /* initialise to 1. units in ms. */
unsigned int nr_balance_failed; /* initialise to 0 */
- u64 last_update;
-
/* idle_balance() stats */
u64 max_newidle_lb_cost;
unsigned long next_decay_max_lb_cost;
--
1.8.1.2
ARM_PATCH_PHYS_VIRT is enabled by default for clps711x systems
Introduction of this config as default will enable phy-to-virt and
virt-to-phy translation function at boot and module loading time
and enforce dynamic reallocation of memory.
This config is mutually exclusive to XIP_KERNEL, which is used in
systems with NOR flash devices
Requesting platform maintainers to evaluate the changes on the
board and comment on the changes, as I dont have the board for
testing.
Signed-off-by: panchaxari <panchaxari.prasannamurthy(a)linaro.org>
Cc: Linus Walleij <linus.walleij(a)linaro.org>
Tested-by: Alexander Shiyan <shc_work(a)mail.ru>
Cc: Russell King <linux(a)arm.linux.org.uk>
Cc: Olof Johansson <olof(a)lixom.net>
Cc: linux-arm-kernel(a)lists.infradead.org
V1->V2
Re-orderd the config according to alphabetical sorting order.
---
arch/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1ad6fb6..1b5a182 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -371,6 +371,7 @@ config ARCH_AT91
config ARCH_CLPS711X
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
select ARCH_REQUIRE_GPIOLIB
+ select ARM_PATCH_PHYS_VIRT
select AUTO_ZRELADDR
select CLKDEV_LOOKUP
select CLKSRC_MMIO
--
1.7.10.4
Hi,
Here is proposal for armv7-m build failure in sigreturn_codes.S. The
armv7-m build issue was discussed in [1].
Proposed solution is based on conditional compilation. If
CONFIG_CPU_THUMBONLY is set instead of arm opcodes nops in thumb mode
are used. I've tried to wrap conditional compilation as nice as I
found possible. Other suggestions/approaches are welcome.
Fix was tested:
linux-next with efm32_defconfig build (along with few other fixes)
rmk-next BE/LE arndale build/boot and LTP rt_sigaction0? tests run
Uwe, is it possible for you to test that the fix runs on efm32. Also
if the platform can run LTP, you give a spin to LTP rt_sigaction0?
tests that would be great. It is known that this tests covers code
under change.
If folks don't like this fix, I have another variant as I mention
in [1] that backs out 574e2b5111e13827da501771b27d92e6e3f2e3d7
(ARM: signal: sigreturn_codes should be endian neutral to work in BE8)
and use asm/opcodes to byteswap manually crafted instructions.
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/209334.…
Victor Kamensky (1):
ARM: signal: fix armv7-m build issue in sigreturn_codes.S
arch/arm/kernel/sigreturn_codes.S | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
--
1.8.1.4
CC to kernel mailing list.
What's you expected result for twd?
On 11/14/2013 08:36 AM, Shaojie Sun wrote:
> Hi all
> When I enble NO_HZ_FULL and NO_HZ_FULL_ALL option in K3V2 board.
> I find that the twd interrupt will be trigged in a large time pre
> second.
> In our landing team branch, we used lsk branch.
>
> Do you find this bugs on your board? And how to resolve it?
>
>
>>> cat /proc/interrupts
>
> CPU0 CPU1
> 29: 293 395 GIC twd
>
--
Thanks
Alex
Double ! or !! are normally required to get 0 or 1 out of a expression. A
comparision always returns 0 or 1 and hence there is no need to apply double !
over it again.
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
kernel/power/suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 62ee437..90b3d93 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -39,7 +39,7 @@ static const struct platform_suspend_ops *suspend_ops;
static bool need_suspend_ops(suspend_state_t state)
{
- return !!(state > PM_SUSPEND_FREEZE);
+ return state > PM_SUSPEND_FREEZE;
}
static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head);
--
1.7.12.rc2.18.g61b472e
Hi,
Here is version 2 of fix to armv7-m build failure in sigreturn_codes.S.
It is based on Dave's suggestion on [1]. Basically it set
arch to arm4t explicitly if CONFIG_CPU_THUMBONLY is set.
That enables both arm and thumb opcodes and code merged with
the rest of image.
Version 1 [2] used conditional compilation.
Fix was tested
linux-next with efm32_defconfig build (along with few other fixes)
rmk-next BE/LE arndale build/boot and LTP rt_sigaction0? tests run
Dave, I've added your name with Suggested-by tag, please
let me know if it is not OK with you, I'll remove it then.
Uwe, is it possible for you to test that this fix runs on
efm32? Sorry, for multiple requests.
To address concern about fragility of proposed solution
I looked binutils bfd/elf32-arm.c
https://sourceware.org/git/?p=binutils.git;a=blob;f=bfd/elf32-arm.c;h=5af16…
Attributes merge deals with couple things:
Tag_CPU_arch: tag_cpu_arch_combine function deals with it
and from its tables it seems that v4t is compatible with
any latter version and resulting value will come from
latter version. I.e v4t and v7 (v7m) would merge fine.
Tag_CPU_arch_profile: since in case of '.arch armv4t'
profile attribute is not generated it is merged fine
with any other profile. Unlike in case of
'.arch armv7a' and '.arch armv7m' profile values would
be 'Application' and 'Microcontroller' and those
conflict.
Above logic seems to be universal, so other linkers
may follow it too. So it seems it is good to use
'.arch armv4t' with armv7m code.
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210631.…
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210393.…
Victor Kamensky (1):
ARM: signal: fix armv7-m build issue in sigreturn_codes.S
arch/arm/kernel/sigreturn_codes.S | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--
1.8.1.4
ARM_PATCH_PHYS_VIRT is enabled by default for clps711x systems
Introduction of this config as default will enable phy-to-virt and
virt-to-phy translation function at boot and module loading time
and enforce dynamic reallocation of memory.
This config is mutually exclusive to XIP_KERNEL, which is used in
systems with NOR flash devices
Requesting platform maintainers to evaluate the changes on the
board and comment on the changes, as I dont have the board for
testing.
Signed-off-by: panchaxari <panchaxari.prasannamurthy(a)linaro.org>
Cc: Linus Walleij <linux.walleij(a)linaro.org>
Cc: Alexander Shiyan <shc_work(a)mail.ru>
Cc: Russell King <linux(a)arm.linux.org.uk>
Cc: Olof Johansson <olof(a)lixom.net>
Cc: linux-arm-kernel(a)lists.infradead.org
---
arch/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1ad6fb6..dff1c81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -372,6 +372,7 @@ config ARCH_CLPS711X
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
select ARCH_REQUIRE_GPIOLIB
select AUTO_ZRELADDR
+ select ARM_PATCH_PHYS_VIRT
select CLKDEV_LOOKUP
select CLKSRC_MMIO
select COMMON_CLK
--
1.7.10.4
From: Jean Pihet <jean.pihet(a)newoldbits.com>
This patch implements the functions required for the perf registers API,
allowing the perf tool to interface kernel register dumps with libunwind
in order to provide userspace backtracing.
Only the general purpose user space registers are exported, i.e.:
PERF_REG_ARM_X0,
...
PERF_REG_ARM_X28,
PERF_REG_ARM_FP,
PERF_REG_ARM_LR,
PERF_REG_ARM_SP,
PERF_REG_ARM_PC
and not the PERF_REG_ARM_V* registers.
Dependencies:
. if present, libunwind >= 1.1 is needed to prevent a segfault when
parsing the dwarf info,
. libunwind needs to be configured with --enable-debug-frame. Note:
--enable-debug-frame is automatically selected on ARM, NOT on ARM64.
The generated perf binary has been tested on ARMv8 (using the
foundation model simulator) and x86_64, using the following commands:
perf record -g [fp,dwarf] -- <binary>
perf report --sort symbol --call-graph --stdio
Jean Pihet (2):
ARM64: perf: add support for perf registers API
ARM64: perf: wire up perf_regs and unwind support
arch/arm64/Kconfig | 2 +
arch/arm64/include/uapi/asm/Kbuild | 1 +
arch/arm64/include/uapi/asm/perf_regs.h | 40 ++++++++++++++
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/perf_regs.c | 29 ++++++++++
tools/perf/arch/arm64/Makefile | 7 +++
tools/perf/arch/arm64/include/perf_regs.h | 88 +++++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/dwarf-regs.c | 81 ++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/unwind.c | 82 ++++++++++++++++++++++++++++
tools/perf/config/Makefile | 6 +++
10 files changed, 337 insertions(+)
create mode 100644 arch/arm64/include/uapi/asm/perf_regs.h
create mode 100644 arch/arm64/kernel/perf_regs.c
create mode 100644 tools/perf/arch/arm64/Makefile
create mode 100644 tools/perf/arch/arm64/include/perf_regs.h
create mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
create mode 100644 tools/perf/arch/arm64/util/unwind.c
--
1.7.11.7
hi all:
I use arm cortex A9 smp with GIC v1 system.
And my kernel is 3.8.13.
I have some questions:
1. From GIc v1 spec, we can modify irq priority.
(ICDIPRn, Interrupt Priority Rigisters)
how could we do that in kernel? Did kernel provide any API of Irq
to reach that goal?
2. From Gic V1 spec, we can assign 1 irq to multi-core.
(ICDIPTRn, Interrupt Processor Targets Registers)
Is there similar API in kernel to let 1 irq possibility to be
handled by multi-cores?
Appreciate your help in advance,
With a recent change "d4019f0 cpufreq: move freq change notifications to cpufreq
core" few variables (r & ret) are removed by mistake and hence these warnings:
drivers/cpufreq/omap-cpufreq.c: In function omap_target:
drivers/cpufreq/omap-cpufreq.c:64:2: error: ret undeclared (first use in this function)
drivers/cpufreq/omap-cpufreq.c:64:2: note: each undeclared identifier is reported only once for each function it appears in
drivers/cpufreq/omap-cpufreq.c:94:3: error: r undeclared (first use in this function)
drivers/cpufreq/omap-cpufreq.c:116:1: warning: control reaches end of non-void function [-Wreturn-type]
Lets fix them by declaring those variables again.
Reported-by: Sebastian Capella <sebastian.capella(a)linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
drivers/cpufreq/omap-cpufreq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index be6d143..a0acd0b 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -53,6 +53,7 @@ static unsigned int omap_getspeed(unsigned int cpu)
static int omap_target(struct cpufreq_policy *policy, unsigned int index)
{
+ int r, ret;
struct dev_pm_opp *opp;
unsigned long freq, volt = 0, volt_old = 0, tol = 0;
unsigned int old_freq, new_freq;
--
1.7.12.rc2.18.g61b472e
Copying a function with memcpy() and then trying to execute the
result isn't trivially portable to Thumb.
This patch modifies the kexec soft restart code to copy its
assembler trampoline relocate_new_kernel() using fncpy() instead,
so that relocate_new_kernel can be in the same ISA as the rest of
the kernel without problems.
Signed-off-by: Dave Martin <Dave.Martin(a)arm.com>
---
Changes since v1:
* Move ENDPROC() after relocate_new_kernel's literals, to be
consistent the location of relocate_new_kernel_end and with the way
GCC sets ELF symbol sizes for functions. This is just a tidyup,
with no functional impact.
arch/arm/kernel/machine_kexec.c | 17 ++++++++++-------
arch/arm/kernel/relocate_kernel.S | 8 ++++++--
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 57221e3..f0d180d 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -14,11 +14,12 @@
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
+#include <asm/fncpy.h>
#include <asm/mach-types.h>
#include <asm/smp_plat.h>
#include <asm/system_misc.h>
-extern const unsigned char relocate_new_kernel[];
+extern void relocate_new_kernel(void);
extern const unsigned int relocate_new_kernel_size;
extern unsigned long kexec_start_address;
@@ -142,6 +143,8 @@ void machine_kexec(struct kimage *image)
{
unsigned long page_list;
unsigned long reboot_code_buffer_phys;
+ unsigned long reboot_entry = (unsigned long)relocate_new_kernel;
+ unsigned long reboot_entry_phys;
void *reboot_code_buffer;
/*
@@ -168,16 +171,16 @@ void machine_kexec(struct kimage *image)
/* copy our kernel relocation code to the control code page */
- memcpy(reboot_code_buffer,
- relocate_new_kernel, relocate_new_kernel_size);
+ reboot_entry = fncpy(reboot_code_buffer,
+ reboot_entry,
+ relocate_new_kernel_size);
+ reboot_entry_phys = (unsigned long)reboot_entry +
+ (reboot_code_buffer_phys - (unsigned long)reboot_code_buffer);
-
- flush_icache_range((unsigned long) reboot_code_buffer,
- (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
printk(KERN_INFO "Bye!\n");
if (kexec_reinit)
kexec_reinit();
- soft_restart(reboot_code_buffer_phys);
+ soft_restart(reboot_entry_phys);
}
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index d0cdedf..9585896 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -2,10 +2,12 @@
* relocate_kernel.S - put the kernel image in place to boot
*/
+#include <linux/linkage.h>
#include <asm/kexec.h>
- .globl relocate_new_kernel
-relocate_new_kernel:
+ .align 3 /* not needed for this code, but keeps fncpy() happy */
+
+ENTRY(relocate_new_kernel)
ldr r0,kexec_indirection_page
ldr r1,kexec_start_address
@@ -79,6 +81,8 @@ kexec_mach_type:
kexec_boot_atags:
.long 0x0
+ENDPROC(relocate_new_kernel)
+
relocate_new_kernel_end:
.globl relocate_new_kernel_size
--
1.7.9.5
Automated DT boot report for various ARM defconfigs.
Tree/Branch: queue
Git describe: v3.11.8-13-g6fe7f75
Failed boot tests (console logs at the end)
===========================================
omap4-panda: FAIL: omap2plus_defconfig
omap4-panda: FAIL: multi_v7_defconfig
Full Report
===========
omap2plus_defconfig
-------------------
omap3-beagle-xm PASS: 0 min 52.6 sec
am335x-bone PASS: 0 min 26.5 sec
omap4-panda FAIL: 1 min 43.5 sec
omap4-panda-es PASS: 1 min 3.0 sec
omap3-tobi,3730storm PASS: 0 min 24.4 sec
omap3-tobi,3530overo PASS: 0 min 21.8 sec
tegra_defconfig
---------------
tegra30-beaver PASS: 0 min 15.5 sec
imx_v6_v7_defconfig
-------------------
imx6dl-wandboard,wand-dual PASS: 0 min 15.9 sec
imx6dl-wandboard,wand-solo PASS: 0 min 15.6 sec
mvebu_defconfig
---------------
armada-xp-openblocks-ax3-4 PASS: 0 min 22.0 sec
armada-370-mirabox PASS: 0 min 19.9 sec
exynos_defconfig
----------------
exynos5250-arndale PASS: 0 min 29.8 sec
multi_v7_defconfig
------------------
tegra30-beaver PASS: 0 min 16.7 sec
omap3-beagle-xm PASS: 0 min 52.7 sec
armada-370-mirabox PASS: 0 min 20.5 sec
am335x-bone PASS: 0 min 33.6 sec
armada-xp-openblocks-ax3-4 PASS: 0 min 22.7 sec
sun4i-a10-cubieboard PASS: 0 min 12.8 sec
imx6dl-wandboard,wand-solo PASS: 0 min 16.1 sec
omap4-panda FAIL: 1 min 43.5 sec
omap4-panda-es PASS: 1 min 6.2 sec
omap3-tobi,3730storm PASS: 0 min 19.8 sec
imx6dl-wandboard,wand-dual PASS: 0 min 16.3 sec
omap3-tobi,3530overo PASS: 0 min 20.0 sec
sama5_defconfig
---------------
sama5d35ek PASS: 0 min 17.2 sec
Console logs for failures
=========================
omap2plus_defconfig
-------------------
omap4-panda: FAIL: last 24 lines of boot log:
---------------------------------------------
Panda #if test -n ${initenv}; then run initenv; fi
if test -n ${initenv}; then run initenv; fi
Panda # if test -n ${preboot}; then run preboot; fi
if test -n ${preboot}; then run preboot; fi
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
scanning usb for ethernet devices... 1 Ethernet Device(s) found
Panda # setenv autoload no; setenv autoboot no
setenv autoload no; setenv autoboot no
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # ~$off
# PYBOOT: Exception: u-boot: ERROR: timeout getting DHCP address.
# PYBOOT: Time: 103.45 seconds.
# PYBOOT: Result: FAIL
multi_v7_defconfig
------------------
omap4-panda: FAIL: last 24 lines of boot log:
---------------------------------------------
Panda # if test -n ${initenv}; then run initenv; fi
if test -n ${initenv}; then run initenv; fi
Panda # if test -n ${preboot}; then run preboot; fi
if test -n ${preboot}; then run preboot; fi
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
scanning usb for ethernet devices... 1 Ethernet Device(s) found
Panda # setenv autoload no; setenv autoboot no
setenv autoload no; setenv autoboot no
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # dhcp
dhcp
Waiting for Ethernet connection... unable to connect.
Panda # ~$off
# PYBOOT: Exception: u-boot: ERROR: timeout getting DHCP address.
# PYBOOT: Time: 103.52 seconds.
# PYBOOT: Result: FAIL