linux/arch
Petr Mladek 0c68bda696 watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h
arch_touch_nmi_watchdog() needs a different implementation for various
hardlockup detector implementations. And it does nothing when
any hardlockup detector is not built at all.

arch_touch_nmi_watchdog() is declared via linux/nmi.h. And it must be
defined as an empty function when there is no hardlockup detector.
It is done directly in this header file for the perf and buddy detectors.
And it is done in the included asm/linux.h for arch specific detectors.

The reason probably is that the arch specific variants build the code
using another conditions. For example, powerpc64/sparc64 builds the code
when CONFIG_PPC_WATCHDOG is enabled.

Another reason might be that these architectures define more functions
in asm/nmi.h anyway.

However the generic code actually knows when the function will be
implemented. It happens when some full featured or the sparc64-specific
hardlockup detector is built.

In particular, CONFIG_HARDLOCKUP_DETECTOR can be enabled only when
a generic or arch-specific full featured hardlockup detector is available.
The only exception is sparc64 which can be built even when the global
HARDLOCKUP_DETECTOR switch is disabled.

The information about sparc64 is a bit complicated. The hardlockup
detector is built there when CONFIG_HAVE_NMI_WATCHDOG is set and
CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH is not set.

People might wonder whether this change really makes things easier.
The motivation is:

  + The current logic in linux/nmi.h is far from obvious.
    For example, arch_touch_nmi_watchdog() is defined as {} when
    neither CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER nor
    CONFIG_HAVE_NMI_WATCHDOG is defined.

  + The change synchronizes the checks in lib/Kconfig.debug and
    in the generic code.

  + It is a step that will help cleaning HAVE_NMI_WATCHDOG related
    checks.

The change should not change the existing behavior.

Link: https://lkml.kernel.org/r/20230616150618.6073-4-pmladek@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-06-19 16:25:29 -07:00
..
alpha syscalls: add sys_ni_posix_timers prototype 2023-06-09 17:44:25 -07:00
arc Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
arm init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
arm64 arm64: enable perf events based hard lockup detector 2023-06-09 17:44:22 -07:00
csky arch/csky patches for 6.4 2023-05-04 12:25:05 -07:00
hexagon Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
ia64 Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
loongarch Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
m68k m68k: Move signal frame following exception on 68020/030 2023-05-22 13:51:20 +02:00
microblaze init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
mips init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
nios2 - Nick Piggin's "shoot lazy tlbs" series, to improve the peformance of 2023-04-27 19:42:02 -07:00
openrisc Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
parisc init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
powerpc watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h 2023-06-19 16:25:29 -07:00
riscv init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
s390 thread_info: move function declarations to linux/thread_info.h 2023-06-09 17:44:16 -07:00
sh thread_info: move function declarations to linux/thread_info.h 2023-06-09 17:44:16 -07:00
sparc watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h 2023-06-19 16:25:29 -07:00
um um: harddog: fix modular build 2023-05-10 00:21:30 +02:00
x86 thread_info: move function declarations to linux/thread_info.h 2023-06-09 17:44:16 -07:00
xtensa Xtensa fixes for v6.4: 2023-05-23 15:21:34 -07:00
.gitignore
Kconfig watchdog/hardlockup: make the config checks more straightforward 2023-06-19 16:25:28 -07:00