tree:
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/wip
head: d3c0e0b4756e5f332791eaf9b35e54e44aae25a6
commit: cf9c2ec7ff73bb35292ef2a660a73c4cada3cb68 [2/8] cpuidle: Make
CPUIDLE_FLAG_TLB_FLUSHED generic
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout cf9c2ec7ff73bb35292ef2a660a73c4cada3cb68
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/cpuidle/cpuidle.c: In function 'cpuidle_enter_state':
> drivers/cpuidle/cpuidle.c:234:3: error: implicit declaration of
function 'leave_mm' [-Werror=implicit-function-declaration]
234 |
leave_mm(dev->cpu);
| ^~~~~~~~
cc1: some warnings being treated as errors
#
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue locking/wip
git checkout cf9c2ec7ff73bb35292ef2a660a73c4cada3cb68
vim +/leave_mm +234 drivers/cpuidle/cpuidle.c
201
202 /**
203 * cpuidle_enter_state - enter the state and update stats
204 * @dev: cpuidle device for this cpu
205 * @drv: cpuidle driver for this cpu
206 * @index: index into the states table in @drv of the state to enter
207 */
208 int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
209 int index)
210 {
211 int entered_state;
212
213 struct cpuidle_state *target_state = &drv->states[index];
214 bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP);
215 ktime_t time_start, time_end;
216
217 /*
218 * Tell the time framework to switch to a broadcast timer because our
219 * local timer will be shut down. If a local timer is used from another
220 * CPU as a broadcast timer, this call may fail if it is not available.
221 */
222 if (broadcast && tick_broadcast_enter()) {
223 index = find_deepest_state(drv, dev, target_state->exit_latency_ns,
224 CPUIDLE_FLAG_TIMER_STOP, false);
225 if (index < 0) {
226 default_idle_call();
227 return -EBUSY;
228 }
229 target_state = &drv->states[index];
230 broadcast = false;
231 }
232
233 if (target_state->flags & CPUIDLE_FLAG_TLB_FLUSHED)
234 leave_mm(dev->cpu);
235
236 /* Take note of the planned idle state. */
237 sched_idle_set_state(target_state);
238
239 trace_cpu_idle(index, dev->cpu);
240 time_start = ns_to_ktime(local_clock());
241
242 rcu_idle_enter();
243 stop_critical_timings();
244 entered_state = target_state->enter(dev, drv, index);
245 start_critical_timings();
246 rcu_idle_exit();
247
248 sched_clock_idle_wakeup_event();
249 time_end = ns_to_ktime(local_clock());
250 trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
251
252 /* The cpu is no longer idle or about to enter idle. */
253 sched_idle_set_state(NULL);
254
255 if (broadcast) {
256 if (WARN_ON_ONCE(!irqs_disabled()))
257 local_irq_disable();
258
259 tick_broadcast_exit();
260 }
261
262 if (!cpuidle_state_is_coupled(drv, index))
263 local_irq_enable();
264
265 if (entered_state >= 0) {
266 s64 diff, delay = drv->states[entered_state].exit_latency_ns;
267 int i;
268
269 /*
270 * Update cpuidle counters
271 * This can be moved to within driver enter routine,
272 * but that results in multiple copies of same code.
273 */
274 diff = ktime_sub(time_end, time_start);
275
276 dev->last_residency_ns = diff;
277 dev->states_usage[entered_state].time_ns += diff;
278 dev->states_usage[entered_state].usage++;
279
280 if (diff < drv->states[entered_state].target_residency_ns) {
281 for (i = entered_state - 1; i >= 0; i--) {
282 if (dev->states_usage[i].disable)
283 continue;
284
285 /* Shallower states are enabled, so update. */
286 dev->states_usage[entered_state].above++;
287 break;
288 }
289 } else if (diff > delay) {
290 for (i = entered_state + 1; i < drv->state_count; i++) {
291 if (dev->states_usage[i].disable)
292 continue;
293
294 /*
295 * Update if a deeper state would have been a
296 * better match for the observed idle duration.
297 */
298 if (diff - delay >= drv->states[i].target_residency_ns)
299 dev->states_usage[entered_state].below++;
300
301 break;
302 }
303 }
304 } else {
305 dev->last_residency_ns = 0;
306 }
307
308 return entered_state;
309 }
310
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org