Skip to content

Commit 7ca8fe9

Browse files
pmladekakpm00
authored andcommitted
watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH
The HAVE_ prefix means that the code could be enabled. Add another variable for HAVE_HARDLOCKUP_DETECTOR_ARCH without this prefix. It will be set when it should be built. It will make it compatible with the other hardlockup detectors. The change allows to clean up dependencies of PPC_WATCHDOG and HAVE_HARDLOCKUP_DETECTOR_PERF definitions for powerpc. As a result HAVE_HARDLOCKUP_DETECTOR_PERF has the same dependencies on arm, x86, powerpc architectures. Link: https://lkml.kernel.org/r/20230616150618.6073-7-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>
1 parent 47f4cb4 commit 7ca8fe9

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

arch/powerpc/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ config NMI_IPI
9090

9191
config PPC_WATCHDOG
9292
bool
93-
depends on HARDLOCKUP_DETECTOR
94-
depends on HAVE_HARDLOCKUP_DETECTOR_ARCH
93+
depends on HARDLOCKUP_DETECTOR_ARCH
9594
default y
9695
help
9796
This is a placeholder when the powerpc hardlockup detector
@@ -240,7 +239,7 @@ config PPC
240239
select HAVE_GCC_PLUGINS if GCC_VERSION >= 50200 # plugin support on gcc <= 5.1 is buggy on PPC
241240
select HAVE_GENERIC_VDSO
242241
select HAVE_HARDLOCKUP_DETECTOR_ARCH if PPC_BOOK3S_64 && SMP
243-
select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !HAVE_HARDLOCKUP_DETECTOR_ARCH
242+
select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
244243
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
245244
select HAVE_IOREMAP_PROT
246245
select HAVE_IRQ_TIME_ACCOUNTING

include/linux/nmi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <asm/irq.h>
1010

1111
/* Arch specific watchdogs might need to share extra watchdog-related APIs. */
12-
#if defined(CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH) || defined(CONFIG_HARDLOCKUP_DETECTOR_SPARC64)
12+
#if defined(CONFIG_HARDLOCKUP_DETECTOR_ARCH) || defined(CONFIG_HARDLOCKUP_DETECTOR_SPARC64)
1313
#include <asm/nmi.h>
1414
#endif
1515

lib/Kconfig.debug

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ config HARDLOCKUP_DETECTOR
10561056
depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_BUDDY || HAVE_HARDLOCKUP_DETECTOR_ARCH
10571057
imply HARDLOCKUP_DETECTOR_PERF
10581058
imply HARDLOCKUP_DETECTOR_BUDDY
1059+
imply HARDLOCKUP_DETECTOR_ARCH
10591060
select LOCKUP_DETECTOR
10601061

10611062
help
@@ -1101,6 +1102,14 @@ config HARDLOCKUP_DETECTOR_BUDDY
11011102
depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
11021103
select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
11031104

1105+
config HARDLOCKUP_DETECTOR_ARCH
1106+
bool
1107+
depends on HARDLOCKUP_DETECTOR
1108+
depends on HAVE_HARDLOCKUP_DETECTOR_ARCH
1109+
help
1110+
The arch-specific implementation of the hardlockup detector will
1111+
be used.
1112+
11041113
#
11051114
# Both the "perf" and "buddy" hardlockup detectors count hrtimer
11061115
# interrupts. This config enables functions managing this common code.

0 commit comments

Comments
 (0)