Skip to content

Commit abe5b41

Browse files
committed
MIPS: delay: Fix use of current_cpu_data in preemptable code.
This may lead to warnings like: BUG: using smp_processor_id() in preemptible [00000000] code: reboot/1989 caller is __udelay+0x14/0x70 Call Trace: [<ffffffff8110ad28>] dump_stack+0x8/0x34 [<ffffffff812dde04>] debug_smp_processor_id+0xf4/0x110 [<ffffffff812d90bc>] __udelay+0x14/0x70 [<ffffffff81378274>] md_notify_reboot+0x12c/0x148 [<ffffffff81161054>] notifier_call_chain+0x64/0xc8 [<ffffffff811614dc>] __blocking_notifier_call_chain+0x64/0xc0 [<ffffffff8115566c>] kernel_restart_prepare+0x1c/0x38 [<ffffffff811556cc>] kernel_restart+0x14/0x50 [<ffffffff8115581c>] SyS_reboot+0x10c/0x1f0 [<ffffffff81103684>] handle_sysn32+0x44/0x84 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent b1cea3b commit abe5b41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/mips/lib/delay.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ EXPORT_SYMBOL(__delay);
4141

4242
void __udelay(unsigned long us)
4343
{
44-
unsigned int lpj = current_cpu_data.udelay_val;
44+
unsigned int lpj = raw_current_cpu_data.udelay_val;
4545

4646
__delay((us * 0x000010c7ull * HZ * lpj) >> 32);
4747
}
4848
EXPORT_SYMBOL(__udelay);
4949

5050
void __ndelay(unsigned long ns)
5151
{
52-
unsigned int lpj = current_cpu_data.udelay_val;
52+
unsigned int lpj = raw_current_cpu_data.udelay_val;
5353

5454
__delay((ns * 0x00000005ull * HZ * lpj) >> 32);
5555
}

0 commit comments

Comments
 (0)