From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Sean Anderson <sean.anderson@linux.dev>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
Yeoreum Yun <yeoreum.yun@arm.com>,
Mike Leach <mike.leach@linaro.org>,
Linu Cherian <lcherian@marvell.com>,
linux-kernel@vger.kernel.org,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
James Clark <james.clark@linaro.org>
Subject: Re: [PATCH v3] coresight: Fix possible deadlock in coresight_panic_cb
Date: Tue, 16 Sep 2025 17:42:07 +0100 [thread overview]
Message-ID: <8f426702-4897-4177-aeae-4fe2b7155fae@arm.com> (raw)
In-Reply-To: <20250916163840.GL12516@e132581.arm.com>
On 16/09/2025 17:38, Leo Yan wrote:
> On Tue, Sep 16, 2025 at 05:09:01PM +0100, Suzuki Kuruppassery Poulose wrote:
>
> [...]
>
>>> From ea78dd22cbdd97f709c5991d5bd3be97be6e137e Mon Sep 17 00:00:00 2001
>>> From: Sean Anderson <sean.anderson@linux.dev>
>>> Date: Tue, 16 Sep 2025 16:03:58 +0100
>>> Subject: [PATCH] coresight: Fix possible deadlock in coresight_panic_cb()
>>>
>>> coresight_panic_cb() is called during a panic. It invokes
>>> bus_for_each_dev(), which then calls bus_to_subsys() and takes the
>>> 'bus_kset->list_lock'. If a panic occurs after the lock has been
>>> acquired, it can lead to a deadlock.
>>>
>>> Instead of using a common panic notifier to iterate the bus, this commit
>>> directly registers the TMC device's panic notifier. This avoids bus
>>> iteration and effectively eliminates the race condition that could cause
>>> the deadlock.
>>
>> Well, if you are going that far, why not register the notifier from
>> coresight-core ?
>
> I have thought this but gave up.
>
> When register a panic's notifier, it does not provide an argument for
> passing a private data. So the code below uses container_of() to convert
> notifier block pointer to the TMC driver data, as a result, the code is
> specific to TMC driver.
notifier_block in csdev ?
next prev parent reply other threads:[~2025-09-16 16:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 15:13 [PATCH v3] coresight: Fix possible deadlock in coresight_panic_cb Sean Anderson
2025-09-15 9:58 ` Leo Yan
2025-09-15 14:31 ` Sean Anderson
2025-09-16 16:00 ` Leo Yan
2025-09-16 16:09 ` Suzuki K Poulose
2025-09-16 16:38 ` Leo Yan
2025-09-16 16:42 ` Suzuki K Poulose [this message]
2025-09-16 16:55 ` Leo Yan
2025-09-16 16:14 ` Sean Anderson
2025-09-16 16:48 ` Leo Yan
2025-09-16 16:51 ` Sean Anderson
2025-09-16 17:17 ` Leo Yan
2025-09-17 8:31 ` Suzuki K Poulose
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=8f426702-4897-4177-aeae-4fe2b7155fae@arm.com \
--to=suzuki.poulose@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@linaro.org \
--cc=lcherian@marvell.com \
--cc=leo.yan@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=sean.anderson@linux.dev \
--cc=yeoreum.yun@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