From c5e6208da8b541858083e3464cd186e8bc705bc7 Mon Sep 17 00:00:00 2001 From: Manoj Vishwanathan Date: Tue, 26 Jan 2021 17:38:42 -0800 Subject: [PATCH] cpuidle: lpm-levels: removing trace calls in idle LOCKDEP complains about a potential "suspicious RCU usage" in calling trace calls in cpu-idle. Change-Id: I59711a4a9bded246cac8b433bd1756269a17e153 Signed-off-by: Manoj Vishwanathan --- drivers/cpuidle/lpm-levels.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c index f2316faadf74..57e6a2611567 100644 --- a/drivers/cpuidle/lpm-levels.c +++ b/drivers/cpuidle/lpm-levels.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2006-2007 Adam Belay * Copyright (C) 2009 Intel Corporation */ @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1445,8 +1446,8 @@ static void update_history(struct cpuidle_device *dev, int idx) history->mode[history->hptr] = idx; - trace_cpu_pred_hist(history->mode[history->hptr], - history->resi[history->hptr], history->hptr, tmr); + RCU_NONIDLE(trace_cpu_pred_hist(history->mode[history->hptr], + history->resi[history->hptr], history->hptr, tmr)); if (history->nsamp < MAXSAMPLES) history->nsamp++; @@ -1472,7 +1473,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev, cpu_prepare(cpu, idx, true); cluster_prepare(cpu->parent, cpumask, idx, true, start_time); - trace_cpu_idle_enter(idx); + RCU_NONIDLE(trace_cpu_idle_enter(idx)); lpm_stats_cpu_enter(idx, start_time); if (need_resched() || is_IPI_pending(cpumask_of(dev->cpu))) @@ -1494,7 +1495,7 @@ exit: cpu_unprepare(cpu, idx, true); dev->last_residency = ktime_us_delta(ktime_get(), start); update_history(dev, idx); - trace_cpu_idle_exit(idx, ret); + RCU_NONIDLE(trace_cpu_idle_exit(idx, ret)); if (lpm_prediction && cpu->lpm_prediction) { histtimer_cancel(); clusttimer_cancel();