Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/10] coresight: cpu-debug: Sample CPUs that ignore a backtrace request
@ 2026-11-27  6:38 Igor Velkov via B4 Relay
  2026-11-27  6:38 ` [PATCH RFC 01/10] Documentation: coresight: cpu-debug: Fix the module parameter name Igor Velkov via B4 Relay
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-11-27  6:38 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Leo Yan, Andrew Morton,
	Alexander Shishkin
  Cc: coresight, linux-arm-kernel, linux-doc, linux-kernel,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, Douglas Anderson,
	Petr Mladek, Feng Tang, Igor Velkov

A CPU locked up with interrupts masked does not answer a backtrace IPI
unless the IPI is an NMI. This series samples its PC through the
external debug interface where nmi_trigger_cpumask_backtrace() gives up
on it, as discussed with Leo [1], and removes the panic notifier: a
panic alone no longer prints the dump, panic_sys_info=all_bt gives it
for the CPUs that do not respond.

Patches 1-4 fix the driver as it is: the documentation, two runtime PM
issues, and an unbounded loop hit at panic today and on a running
system after patch 8. They do not depend on the rest and can go
separately with Fixes: tags. Patch 5 adds the EDPRSR.R check that 8
relies on, 6 prepares 8, 7 adds the notification to lib/nmi_backtrace.c,
8 adds the hook, 9 removes the panic notifier, 10 lowers the log level.

lib/nmi_backtrace.c has no maintainer entry. I would expect the series
to go through the coresight tree with an ack for patch 7, or patch 7
through mm-nonmm first, whichever you prefer.

Tested on RK3399 (helios64), the series applied on 7.4-rc4, buddy hard
lockup detector, no pseudo-NMI: LKDTM HARDLOCKUP on an A53 and on an A72
gives "EDPCSR: lkdtm_HARDLOCKUP+0x14/0x38". SysRq-l with a CPU spinning
in an IPI handler dumps that CPU and the system keeps running; so does
a panic with panic_sys_info=all_bt. With pseudo-NMI the CPU answers and
nothing is dumped. Not tested: the idle path, the notifier in NMI
context, other SoCs, ACPI; arm32 is only built.

In every run idle_cpu() was 0 for the stuck CPU at the time of the
notification, also for a CPU that entered the spin from its idle task
with all movable tasks moved away, so the idle path was never taken. A
test module running the register sequence of debug_read_regs() on an
idle core raises an SError on RK3399. Should the idle path (with the
EDPRCR power request) and skip_idle stay? Without them patch 7 needs
only the cpumask, debug_force_cpu_powered_up() goes away, and a CPU is
sampled only if EDPRSR shows it accessible. skip_idle defaults to 0 as
proposed in [1]; on RK3399 it would have to be 1.

[1] https://lore.kernel.org/r/20261118104917.GW9176@e132581.arm.com

---
Igor Velkov (10):
      Documentation: coresight: cpu-debug: Fix the module parameter name
      coresight: cpu-debug: Make the enable parameter read-only in sysfs
      coresight: cpu-debug: Publish the per-CPU data under debug_lock
      coresight: cpu-debug: Bound the power up retries
      coresight: cpu-debug: Do not sample a core that is in reset
      coresight: cpu-debug: Factor out debug_read_pcsr()
      lib/nmi_backtrace: notify about CPUs that ignore a backtrace request
      coresight: cpu-debug: Dump CPUs that ignore a backtrace request
      coresight: cpu-debug: Remove the panic notifier
      coresight: cpu-debug: Print the dump at the warning level

 Documentation/admin-guide/kernel-parameters.txt    |  10 +
 .../trace/coresight/coresight-cpu-debug.rst        |  55 +++--
 drivers/hwtracing/coresight/Kconfig                |   8 +-
 drivers/hwtracing/coresight/coresight-cpu-debug.c  | 244 +++++++++++++--------
 include/linux/nmi.h                                |  28 +++
 lib/nmi_backtrace.c                                |  56 +++++
 6 files changed, 283 insertions(+), 118 deletions(-)
---
base-commit: b7d7462c7f973b65de511db6bebb99fb29946ed8
change-id: 20261127-b4-coresight-cpu-debug-lockup-ee2cf8fc5260

Best regards,
-- 
Igor Velkov <iav@iav.lv>




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

end of thread, other threads:[~2026-12-04 17:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27  6:38 [PATCH RFC 00/10] coresight: cpu-debug: Sample CPUs that ignore a backtrace request Igor Velkov via B4 Relay
2026-11-27  6:38 ` [PATCH RFC 01/10] Documentation: coresight: cpu-debug: Fix the module parameter name Igor Velkov via B4 Relay
2026-11-27 20:41   ` Randy Dunlap
2026-12-04 16:03   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 02/10] coresight: cpu-debug: Make the enable parameter read-only in sysfs Igor Velkov via B4 Relay
2026-12-04 16:11   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 03/10] coresight: cpu-debug: Publish the per-CPU data under debug_lock Igor Velkov via B4 Relay
2026-12-04 17:04   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 04/10] coresight: cpu-debug: Bound the power up retries Igor Velkov via B4 Relay
2026-12-04 17:28   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 05/10] coresight: cpu-debug: Do not sample a core that is in reset Igor Velkov via B4 Relay
2026-12-04 17:33   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 06/10] coresight: cpu-debug: Factor out debug_read_pcsr() Igor Velkov via B4 Relay
2026-12-04 17:38   ` Leo Yan
2026-11-27  6:38 ` [PATCH RFC 07/10] lib/nmi_backtrace: notify about CPUs that ignore a backtrace request Igor Velkov via B4 Relay
2026-11-27  6:38 ` [PATCH RFC 08/10] coresight: cpu-debug: Dump " Igor Velkov via B4 Relay
2026-11-27  6:38 ` [PATCH RFC 09/10] coresight: cpu-debug: Remove the panic notifier Igor Velkov via B4 Relay
2026-11-27  6:38 ` [PATCH RFC 10/10] coresight: cpu-debug: Print the dump at the warning level Igor Velkov via B4 Relay

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