[COMMON] kernel: watchdog: detect hard lockups without NMIs using secondary cpus
authorHyunki Koo <hyunki00.koo@samsung.com>
Sun, 25 Feb 2018 05:55:21 +0000 (14:55 +0900)
committerDonghyeok Choe <d7271.choe@samsung.com>
Wed, 16 May 2018 08:37:19 +0000 (17:37 +0900)
commit6ff42c2cbd75fa01ceabb7caa6285ab0247f1dfd
treeaa97967344e9a9bd9e85fef45e1a7a9b6bf35cdb
parentd68ddd1dd81b404741edcfbfec594c5daaf25338
[COMMON] kernel: watchdog: detect hard lockups without NMIs using secondary cpus

Emulate NMIs on systems where they are not available by using timer
interrupts on other cpus.  Each cpu will use its softlockup hrtimer
to check that the next cpu is processing hrtimer interrupts by
verifying that a counter is increasing.

This patch is useful on systems where the hardlockup detector is not
available due to a lack of NMIs, for example most ARM SoCs.
Without this patch any cpu stuck with interrupts disabled can
cause a hardware watchdog reset with no debugging information,
but with this patch the kernel can detect the lockup and panic,
which can result in useful debugging info.

Change-Id: I0363ee438625863f466dd07ef4b14d8094822840
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
Signed-off-by: Changki Kim <changki.kim@samsung.com>
include/linux/nmi.h
kernel/watchdog.c
lib/Kconfig.debug