mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64: Only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled
@ 2023-05-23 14:39 Douglas Anderson
  2023-05-23 15:52 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Anderson @ 2023-05-23 14:39 UTC (permalink / raw)
  To: Andrew Morton, Arnd Bergmann
  Cc: Douglas Anderson, Catalin Marinas, Lecopzer Chen, Pingfan Liu,
	Sumit Garg, Will Deacon, linux-arm-kernel, linux-kernel

If you try to enable the arm64 perf-based hardlockup detector but you
don't enable CONFIG_ARM_PMU then you'll get an error:

arch/arm64/kernel/watchdog_hld.c: In function 'arch_perf_nmi_is_available':
arch/arm64/kernel/watchdog_hld.c:35:16: error: implicit declaration of function 'arm_pmu_irq_is_nmi' [-Werror=implicit-function-declaration]
   35 |         return arm_pmu_irq_is_nmi();

It doesn't make sense to enable HAVE_HARDLOCKUP_DETECTOR_PERF if the
PMU isn't enabled. Let's add a dependency. HW_PERF_EVENTS is a synonum
for ARM_PMU and makes the most logical sense here, so add the
dependency on that.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Closes: https://lore.kernel.org/r/20230522114922.1052421-1-arnd@kernel.org
Fixes: 02ea35ee19d9 ("arm64: enable perf events based hard lockup detector")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
This is an alternative fix to the one Arnd proposed. I think it's a
little cleaner / more correct.

I'm not sure the exact way to mark "Fixes" for things in Andrew's tree
these days. I don't think the git hash is stable? I wouldn't object to
this being squashed into the patch it's fixing.

 arch/arm64/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 3eacf40da850..0b055e6cda00 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -203,7 +203,8 @@ config ARM64
 	select HAVE_FUNCTION_ERROR_INJECTION
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_GCC_PLUGINS
-	select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
+	select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \
+		HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI
 	select HAVE_HW_BREAKPOINT if PERF_EVENTS
 	select HAVE_IOREMAP_PROT
 	select HAVE_IRQ_TIME_ACCOUNTING
-- 
2.40.1.698.g37aff9b760-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64: Only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled
  2023-05-23 14:39 [PATCH] arm64: Only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled Douglas Anderson
@ 2023-05-23 15:52 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2023-05-23 15:52 UTC (permalink / raw)
  To: Doug Anderson, Andrew Morton
  Cc: Catalin Marinas, Lecopzer Chen, Pingfan Liu, Sumit Garg,
	Will Deacon, linux-arm-kernel, linux-kernel

On Tue, May 23, 2023, at 16:39, Douglas Anderson wrote:
> If you try to enable the arm64 perf-based hardlockup detector but you
> don't enable CONFIG_ARM_PMU then you'll get an error:
>
> arch/arm64/kernel/watchdog_hld.c: In function 
> 'arch_perf_nmi_is_available':
> arch/arm64/kernel/watchdog_hld.c:35:16: error: implicit declaration of 
> function 'arm_pmu_irq_is_nmi' [-Werror=implicit-function-declaration]
>    35 |         return arm_pmu_irq_is_nmi();
>
> It doesn't make sense to enable HAVE_HARDLOCKUP_DETECTOR_PERF if the
> PMU isn't enabled. Let's add a dependency. HW_PERF_EVENTS is a synonum
> for ARM_PMU and makes the most logical sense here, so add the
> dependency on that.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Closes: https://lore.kernel.org/r/20230522114922.1052421-1-arnd@kernel.org
> Fixes: 02ea35ee19d9 ("arm64: enable perf events based hard lockup detector")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

Still build testing it with randconfigs, but I assume it's fine.

    Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-23 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 14:39 [PATCH] arm64: Only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled Douglas Anderson
2023-05-23 15:52 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®