Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: iav@iav.lv
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Douglas Anderson <dianders@chromium.org>,
	Petr Mladek <pmladek@suse.com>,
	Feng Tang <feng.tang@linux.alibaba.com>
Subject: Re: [PATCH RFC 03/10] coresight: cpu-debug: Publish the per-CPU data under debug_lock
Date: Fri, 4 Dec 2026 17:04:08 +0000	[thread overview]
Message-ID: <20261204170408.GF3159023@e132581.arm.com> (raw)
In-Reply-To: <20261127-b4-coresight-cpu-debug-lockup-v1-3-69d3ad1e0fc8@iav.lv>

On Fri, Nov 27, 2026 at 08:38:40AM +0200, Igor Velkov via B4 Relay wrote:

[...]

> Store the pointer once the device is known to be usable, and change it
> only under debug_lock, which the knob holds while it takes or drops the
> runtime PM references of the published devices.

The problem is the duplicate check per_cpu(debug_drvdata, cpu) still
runs outside debug_lock in __debug_probe().

Maybe it is good to go a bit further:

- Call debug_func_init() from debug_init() and debug_func_exit() from
  debug_exit(). The debugfs knob and notifier would then exist for the
  lifetime of the driver. That would let us drop debug_count and avoid
  racing debugfs setup in probe against teardown in remove.

- In __debug_probe(), after the SMP call succeeds and the hardware
  checks pass, take debug_lock, check if the CPU slot is duplicated,
  and publish drvdata before unlocking.

Thanks,
Leo


  reply	other threads:[~2026-12-04 17:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204170408.GF3159023@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=coresight@lists.linaro.org \
    --cc=dianders@chromium.org \
    --cc=feng.tang@linux.alibaba.com \
    --cc=iav@iav.lv \
    --cc=james.clark@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox