Skip to content

Commit 84237e8

Browse files
bebarinogregkh
authored andcommitted
ARM: 7699/1: sched_clock: Add more notrace to prevent recursion
commit cea1509 upstream. cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns() is called by cyc_to_sched_clock(). I suspect that some compilers inline both of these functions into sched_clock() and so we've been getting away without having a notrace marking. It seems that my compiler isn't inlining cyc_to_sched_clock() though, so I'm hitting a recursion bug when I enable the function graph tracer, causing my system to crash. Marking these functions notrace fixes it. Technically cyc_to_ns() doesn't need the notrace because it's already marked inline, but let's just add it so that if we ever remove inline from that function it doesn't blow up. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Russell King <[email protected]> Signed-off-by: Jonghwan Choi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 19ffe4c commit 84237e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm/kernel/sched_clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void)
4545

4646
static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
4747

48-
static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
48+
static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
4949
{
5050
return (cyc * mult) >> shift;
5151
}
5252

53-
static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
53+
static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
5454
{
5555
u64 epoch_ns;
5656
u32 epoch_cyc;

0 commit comments

Comments
 (0)