Skip to content

Commit 4309cfe

Browse files
sudeep-hollaLorenzo Pieralisi
authored andcommitted
drivers: psci: annotate timer on stack to silence odebug messages
When DEBUG_OBJECTS config is enabled, we get the below odebug warnings: ODEBUG: object is on stack, but not annotated WARNING: CPU: 3 PID: 1304 at kernel/lib/debugobjects.c:300 __debug_object_init+0x1f0/0x458 CPU: 3 PID: 1304 Comm: psci_suspend_te Tainted: G W 4.9.0-06564-gf80f3f199260 #284 task: ffffe9e1b55a1600 task.stack: ffffe9e1b51c0000 PC is at __debug_object_init+0x1f0/0x458 LR is at __debug_object_init+0x1ec/0x458 Call trace: __debug_object_init+0x1f0/0x458 debug_object_activate+0x150/0x260 mod_timer+0xb4/0x4c0 suspend_test_thread+0x1cc/0x3c0 kthread+0x110/0x140 ret_from_fork+0x10/0x40 This patch annotates the timer on the stack using setup_timer_on_stack function to remove the above warnings. Cc: Kevin Brodsky <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent 0c744ea commit 4309cfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/firmware/psci_checker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ static int suspend_test_thread(void *arg)
270270
struct cpuidle_device *dev;
271271
struct cpuidle_driver *drv;
272272
/* No need for an actual callback, we just want to wake up the CPU. */
273-
struct timer_list wakeup_timer =
274-
TIMER_INITIALIZER(dummy_callback, 0, 0);
273+
struct timer_list wakeup_timer;
275274

276275
/* Wait for the main thread to give the start signal. */
277276
wait_for_completion(&suspend_threads_started);
@@ -287,6 +286,7 @@ static int suspend_test_thread(void *arg)
287286
pr_info("CPU %d entering suspend cycles, states 1 through %d\n",
288287
cpu, drv->state_count - 1);
289288

289+
setup_timer_on_stack(&wakeup_timer, dummy_callback, 0);
290290
for (i = 0; i < NUM_SUSPEND_CYCLE; ++i) {
291291
int index;
292292
/*

0 commit comments

Comments
 (0)