Skip to content

Commit

Permalink
clocksource/drivers/pistachio: Prevent ftrace recursion
Browse files Browse the repository at this point in the history
Currently pistachio can be used as a scheduler clock. We properly marked
pistachio_read_sched_clock() as notrace but we then call another function
pistachio_clocksource_read_cycles() that _wasn't_ notrace.

Having a traceable function in the sched_clock() path leads to a recursion
within ftrace and a kernel crash.

Fix this by adding notrace attribute to the pistachio_clocksource_read_cycles()
function.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Jisheng Zhang authored and Daniel Lezcano committed Oct 27, 2015
1 parent d6df357 commit f8af0e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clocksource/time-pistachio.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static inline void gpt_writel(void __iomem *base, u32 value, u32 offset,
writel(value, base + 0x20 * gpt_id + offset);
}

static cycle_t pistachio_clocksource_read_cycles(struct clocksource *cs)
static cycle_t notrace
pistachio_clocksource_read_cycles(struct clocksource *cs)
{
struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs);
u32 counter, overflw;
Expand Down

0 comments on commit f8af0e9

Please sign in to comment.