linux/arch/sparc/prom
David S. Miller bdcf81b658 sparc64: Fix lockdep warnings on reboot on Ultra-5
Inconsistently, the raw_* IRQ routines do not interact with and update
the irqflags tracing and lockdep state, whereas the raw_* spinlock
interfaces do.

This causes problems in p1275_cmd_direct() because we disable hardirqs
by hand using raw_local_irq_restore() and then do a raw_spin_lock()
which triggers a lockdep trace because the CPU's hw IRQ state doesn't
match IRQ tracing's internal software copy of that state.

The CPU's irqs are disabled, yet current->hardirqs_enabled is true.

====================
reboot: Restarting system
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3536 check_flags+0x7c/0x240()
DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)
Modules linked in: openpromfs
CPU: 0 PID: 1 Comm: systemd-shutdow Tainted: G        W      3.17.0-dirty #145
Call Trace:
 [000000000045919c] warn_slowpath_common+0x5c/0xa0
 [0000000000459210] warn_slowpath_fmt+0x30/0x40
 [000000000048f41c] check_flags+0x7c/0x240
 [0000000000493280] lock_acquire+0x20/0x1c0
 [0000000000832b70] _raw_spin_lock+0x30/0x60
 [000000000068f2fc] p1275_cmd_direct+0x1c/0x60
 [000000000068ed28] prom_reboot+0x28/0x40
 [000000000043610c] machine_restart+0x4c/0x80
 [000000000047d2d4] kernel_restart+0x54/0x80
 [000000000047d618] SyS_reboot+0x138/0x200
 [00000000004060b4] linux_sparc_syscall32+0x34/0x60
---[ end trace 5c439fe81c05a100 ]---
possible reason: unannotated irqs-off.
irq event stamp: 2010267
hardirqs last  enabled at (2010267): [<000000000049a358>] vprintk_emit+0x4b8/0x580
hardirqs last disabled at (2010266): [<0000000000499f08>] vprintk_emit+0x68/0x580
softirqs last  enabled at (2010046): [<000000000045d278>] __do_softirq+0x378/0x4a0
softirqs last disabled at (2010039): [<000000000042bf08>] do_softirq_own_stack+0x28/0x40
Resetting ...
====================

Use local_* variables of the hw IRQ interfaces so that IRQ tracing sees
all of our changes.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-10 15:49:16 -04:00
..
bootstr_32.c arch: sparc: prom: looping issue, need additional length check in the outside looping 2013-06-19 02:10:29 -07:00
bootstr_64.c sparc64: Increase size of boot string to 1024 bytes 2014-10-07 15:41:02 -04:00
cif.S sparc64: Get rid of indirect p1275 PROM call buffer. 2010-08-23 23:10:57 -07:00
console_32.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
console_64.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
init_32.c sparc32: Remove superfluous extern declarations for prom_*() functions 2012-06-27 01:27:45 -07:00
init_64.c sparc: Correct comments about prom_init() return values 2012-06-27 01:27:45 -07:00
Makefile sparc32: drop sun4c support 2012-05-11 19:27:44 -07:00
memory.c of/sparc: convert various prom_* functions to use phandle 2010-10-09 02:33:34 -06:00
misc_32.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
misc_64.c sparc64: fix sparse warnings in smp_64.c 2014-05-18 19:01:31 -07:00
mp.c sparc: Remove unnecessary semicolons 2011-06-07 16:06:34 -07:00
p1275.c sparc64: Fix lockdep warnings on reboot on Ultra-5 2014-10-10 15:49:16 -04:00
printf.c sparc: Write to prom console using indirect buffer. 2010-11-30 20:15:58 -08:00
ranges.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
tree_32.c Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2011-01-10 08:57:03 -08:00
tree_64.c sparc: remove inline marking of EXPORT_SYMBOL functions 2013-06-19 02:09:23 -07:00