1
0
Fork 0
alistair23-linux/arch/arc
Daniel Mentz 18b43e89d2 ARC: Call trace_hardirqs_on() before enabling irqs
trace_hardirqs_on_caller() in lockdep.c expects to be called before, not
after interrupts are actually enabled.

The following comment in kernel/locking/lockdep.c substantiates this
claim:

"
/*
 * We're enabling irqs and according to our state above irqs weren't
 * already enabled, yet we find the hardware thinks they are in fact
 * enabled.. someone messed up their IRQ state tracing.
 */
"

An example can be found in include/linux/irqflags.h:

	do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0)

Without this change, we hit the following DEBUG_LOCKS_WARN_ON.

[    7.760000] ------------[ cut here ]------------
[    7.760000] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2711 resume_user_mode_begin+0x48/0xf0
[    7.770000] DEBUG_LOCKS_WARN_ON(!irqs_disabled())
[    7.780000] Modules linked in:
[    7.780000] CPU: 0 PID: 1 Comm: init Not tainted 4.7.0-00003-gc668bb9-dirty #366
[    7.790000]
[    7.790000] Stack Trace:
[    7.790000]   arc_unwind_core.constprop.1+0xa4/0x118
[    7.800000]   warn_slowpath_fmt+0x72/0x158
[    7.800000]   resume_user_mode_begin+0x48/0xf0
[    7.810000] ---[ end trace 6f6a7a8fae20d2f0 ]---

Signed-off-by: Daniel Mentz <danielmentz@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2016-08-10 10:14:07 -07:00
..
boot Linux 4.7-rc5 2016-07-02 15:56:01 +10:00
configs ARC: [nsimosci] Enable ARC PGU on nSIM OSCI virtual platforms 2016-06-13 17:45:18 +02:00
include ARC: Call trace_hardirqs_on() before enabling irqs 2016-08-10 10:14:07 -07:00
kernel DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
lib ARCv2: lib: memcpy: use local symbols 2015-11-03 17:33:00 +05:30
mm dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
oprofile ARC: OProfile support 2013-02-15 23:16:00 +05:30
plat-axs10x ARC updates for 4.7-rc1 2016-05-19 09:46:18 -07:00
plat-eznps ARC: [plat-eznps] Use dedicated identity auxiliary register. 2016-05-09 09:32:33 +05:30
plat-sim ARC: remove extraneous header include 2015-11-14 13:11:38 +05:30
plat-tb10x arc: select GPIOLIB directly 2016-04-26 14:07:59 +02:00
Kbuild ARC: Build system: Makefiles, Kconfig, Linker script 2013-02-11 20:00:25 +05:30
Kconfig Revert "ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff" 2016-06-02 10:59:23 +05:30
Kconfig.debug ARC: With earlycon in use, retire EARLY_PRINTK 2015-05-11 11:20:21 +05:30
Makefile Disable "maybe-uninitialized" warning globally 2016-07-27 13:17:41 -07:00