* [PATCH] ARM: ensure all sched_clock() implementations are notrace marked
@ 2010-12-16 8:18 Russell King - ARM Linux
2010-12-16 15:12 ` Rabin Vincent
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-12-16 8:18 UTC (permalink / raw)
To: linux-arm-kernel
ftrace requires sched_clock() to be notrace. Ensure that all
implementations are so marked.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/mach-ixp4xx/common.c | 2 +-
arch/arm/mach-mmp/time.c | 2 +-
arch/arm/mach-pxa/time.c | 2 +-
arch/arm/mach-sa1100/generic.c | 2 +-
arch/arm/mach-tegra/timer.c | 2 +-
arch/arm/plat-iop/time.c | 2 +-
arch/arm/plat-omap/counter_32k.c | 2 +-
arch/arm/plat-orion/time.c | 2 +-
arch/arm/plat-versatile/sched-clock.c | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 82fc003..e0b91d8 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -424,7 +424,7 @@ static void __init ixp4xx_clocksource_init(void)
/*
* sched_clock()
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
cycle_t cyc = ixp4xx_get_cycles(NULL);
struct clocksource *cs = &clocksource_ixp4xx;
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 0c0ab09..a2ea33d 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -75,7 +75,7 @@ static inline uint32_t timer_read(void)
return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0));
}
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(timer_read());
return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR;
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index caf92c0..b8d9dff 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -51,7 +51,7 @@ static void __init set_oscr2ns_scale(unsigned long oscr_rate)
oscr2ns_scale++;
}
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR;
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 3c1fcd6..33b4969 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -119,7 +119,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
*
* ( * 1E9 / 3686400 => * 78125 / 288)
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(OSCR);
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index b49f2f5..19a6f7e 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -110,7 +110,7 @@ static struct clocksource tegra_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
}
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index cd6d54f..2bb7db4 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -52,7 +52,7 @@ static struct clocksource iop_clocksource = {
/*
* IOP sched_clock() implementation via its clocksource.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
cycle_t cyc = iop_clocksource_read(NULL);
struct clocksource *cs = &iop_clocksource;
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 8f149f5..0de0583 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -109,7 +109,7 @@ static struct clocksource clocksource_32k = {
* Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
clocksource_32k.mult, clocksource_32k.shift);
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 11e2583..123f96f 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -55,7 +55,7 @@ static u32 ticks_per_jiffy;
static unsigned long tclk2ns_scale;
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
index 9696ddc..42efd14 100644
--- a/arch/arm/plat-versatile/sched-clock.c
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -42,7 +42,7 @@
* long as there is always less than 89 seconds between successive
* calls to this function.
*/
-unsigned long long sched_clock(void)
+unsigned long long notrace sched_clock(void)
{
unsigned long long v = cnt32_to_63(readl(REFCOUNTER));
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: ensure all sched_clock() implementations are notrace marked
2010-12-16 8:18 [PATCH] ARM: ensure all sched_clock() implementations are notrace marked Russell King - ARM Linux
@ 2010-12-16 15:12 ` Rabin Vincent
2010-12-16 15:57 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Rabin Vincent @ 2010-12-16 15:12 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 16, 2010 at 1:48 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> ftrace requires sched_clock() to be notrace. ?Ensure that all
> implementations are so marked.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
It does seem better to have all of them explicity annotated anyway, even
if it not required in most of the cases because they include
<linux/sched.h> and the annotation in the declaration takes effect.
Note that in order for this to be fully effective, all functions called
from sched_clock() need to be notrace too. OMAP and u300 miss this.
The following patches fix them up; perhaps you can fold them into this
one. If not, I will rebase them later after this series is merged:
http://www.spinics.net/lists/arm-kernel/msg104616.html
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg38911.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: ensure all sched_clock() implementations are notrace marked
2010-12-16 15:12 ` Rabin Vincent
@ 2010-12-16 15:57 ` Russell King - ARM Linux
2010-12-16 16:22 ` Rabin Vincent
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-12-16 15:57 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 16, 2010 at 08:42:23PM +0530, Rabin Vincent wrote:
> On Thu, Dec 16, 2010 at 1:48 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > ftrace requires sched_clock() to be notrace. ?Ensure that all
> > implementations are so marked.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>
> It does seem better to have all of them explicity annotated anyway, even
> if it not required in most of the cases because they include
> <linux/sched.h> and the annotation in the declaration takes effect.
Firstly, we shouldn't be relying upon that, and secondly, everywhere which
defines sched_clock() should already be including linux/sched.h to avoid
the sparse error. It sounds like there's also an exercise to make sure
that is the case.
> Note that in order for this to be fully effective, all functions called
> from sched_clock() need to be notrace too. OMAP and u300 miss this.
Yes, OMAP still suffers from this.
However, I assume you haven't looked at the u300 sched_clock conversion
patch which is part of a follow-on series on lakml? It sorts u300 out
in that regard.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: ensure all sched_clock() implementations are notrace marked
2010-12-16 15:57 ` Russell King - ARM Linux
@ 2010-12-16 16:22 ` Rabin Vincent
2010-12-16 17:03 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Rabin Vincent @ 2010-12-16 16:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 16, 2010 at 9:27 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Dec 16, 2010 at 08:42:23PM +0530, Rabin Vincent wrote:
>> On Thu, Dec 16, 2010 at 1:48 PM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > ftrace requires sched_clock() to be notrace. ?Ensure that all
>> > implementations are so marked.
>> >
>> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>>
>> It does seem better to have all of them explicity annotated anyway, even
>> if it not required in most of the cases because they include
>> <linux/sched.h> and the annotation in the declaration takes effect.
>
> Firstly, we shouldn't be relying upon that, and secondly, everywhere which
> defines sched_clock() should already be including linux/sched.h to avoid
> the sparse error. ?It sounds like there's also an exercise to make sure
> that is the case.
Yes. I believe I identified all the ones which weren't including the
header in the last notrace series I sent out (versatile, plat-iop, omap,
and u300 IIRC), but there's been some changes in various platforms'
sched_clocks() and of course new platforms since then.
>
>> Note that in order for this to be fully effective, all functions called
>> from sched_clock() need to be notrace too. ?OMAP and u300 miss this.
>
> Yes, OMAP still suffers from this.
>
> However, I assume you haven't looked at the u300 sched_clock conversion
> patch which is part of a follow-on series on lakml? ?It sorts u300 out
> in that regard.
Yes, I now see U300 no longer needs the notrace addition. It still
could do with the #include <linux/sched.h> addition though, which was
also being done as part of that patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: ensure all sched_clock() implementations are notrace marked
2010-12-16 16:22 ` Rabin Vincent
@ 2010-12-16 17:03 ` Russell King - ARM Linux
0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2010-12-16 17:03 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 16, 2010 at 09:52:56PM +0530, Rabin Vincent wrote:
> Yes, I now see U300 no longer needs the notrace addition. It still
> could do with the #include <linux/sched.h> addition though, which was
> also being done as part of that patch.
Okay, added to u300, tegra, iop, and omap which weren't including
linux/sched.h explicitly.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-12-16 17:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 8:18 [PATCH] ARM: ensure all sched_clock() implementations are notrace marked Russell King - ARM Linux
2010-12-16 15:12 ` Rabin Vincent
2010-12-16 15:57 ` Russell King - ARM Linux
2010-12-16 16:22 ` Rabin Vincent
2010-12-16 17:03 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).