From: Cristian Marussi <cristian.marussi@arm.com>
To: Johan Hovold <johan@kernel.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
sudeep.holla@arm.com, james.quinlan@broadcom.com,
f.fainelli@gmail.com, vincent.guittot@linaro.org,
peng.fan@oss.nxp.com, michal.simek@amd.com,
quic_sibis@quicinc.com, dan.carpenter@linaro.org, maz@kernel.org
Subject: Re: [RFC PATCH 0/3] Introduce SCMI Quirks framework
Date: Tue, 15 Apr 2025 14:55:33 +0100 [thread overview]
Message-ID: <Z_5lJA74OugEbB-S@pluto> (raw)
In-Reply-To: <Z-_dMev0v6P4UJ_i@hovoldconsulting.com>
On Fri, Apr 04, 2025 at 03:22:57PM +0200, Johan Hovold wrote:
> Hi Cristian,
>
> On Tue, Apr 01, 2025 at 01:25:42PM +0100, Cristian Marussi wrote:
>
> > with the increasing adoption of SCMI across arm64 ecosystems, we have to
> > start considering how to deal and take care of out-of-spec SCMI firmware
> > platforms that are actively deployed in the wild, in a consistent manner.
> >
> > This small series introduces a simple framework, based on static_keys,
> > that allows a user to:
> >
> > - define a quirk and its matching conditions; quirks can match based on:
> >
> > compatible / Vendor_ID / Sub_Vendor_ID / ImplVersion
> >
> > from the longest matching sequence down to the shortest.
> >
> > When the SCMI core stack boots it will enable the matching quirks
> > depending on the information gathered from the platform via Base
> > protocol: any NULL/0 match condition is ignored during matching and is
> > interpreted as ANY, so you can decide to match on a very specific
> > combination of compatibles and FW versions OR simply on a compatible.
> >
> > - define a quirk code-block: simply a block of code, meant to play the
> > magic quirk trick, defined in the proximity of where it will be used
> > and gated by an implicit quirk static-key associated with the defined
> > quirk
>
> > Any feedback and testing is very much welcome.
>
> I'm hitting the below lockdep splat when running with this series and
> the FC quirk enabled.
>
> Johan
>
>
> [ 8.399581] ======================================================
> [ 8.399582] WARNING: possible circular locking dependency detected
> [ 8.399583] 6.14.0 #103 Not tainted
> [ 8.399584] ------------------------------------------------------
> [ 8.399584] kworker/u49:5/165 is trying to acquire lock:
> [ 8.399586] ffff65d004d36320 (&info->protocols_mtx){+.+.}-{4:4}, at: scmi_get_protocol_instance+0x4c/0x5c0
> [ 8.399596]
> but task is already holding lock:
> [ 8.399596] ffff65d00a895348 (&ni->pending_mtx){+.+.}-{4:4}, at: __scmi_event_handler_get_ops+0x70/0x47c
> [ 8.399600]
> which lock already depends on the new lock.
>
> [ 8.399601]
> the existing dependency chain (in reverse order) is:
> [ 8.399601]
> -> #4 (&ni->pending_mtx){+.+.}-{4:4}:
Hi Johan,
I have reproduced this when running with LOCKDEP and quirks enabled:
it was due to the fact that static_branch_enable() takes a cpu_lock
internally and I was triggering all of this from Base protocol init
which takes a number of other mutexes...
I moved SCMI quirk initialiation after Base protocol initialization
in scmi_probe and it is gone...and indeed was not needed anyway so
early.
I'll post a new V1 for quirks in a short while including this change.
Thanks,
Cristian
prev parent reply other threads:[~2025-04-15 14:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 12:25 [RFC PATCH 0/3] Introduce SCMI Quirks framework Cristian Marussi
2025-04-01 12:25 ` [RFC PATCH 1/3] firmware: arm_scmi: Ensure that the message-id supports fastchannel Cristian Marussi
2025-04-03 8:15 ` Johan Hovold
2025-04-01 12:25 ` [RFC PATCH 2/3] firmware: arm_scmi: Add Quirks framework Cristian Marussi
2025-04-01 12:25 ` [RFC PATCH 3/3] [NOT FOR UPSTREAM] firmware: arm_scmi: quirk: Ignore FC bit in attributes Cristian Marussi
2025-04-03 8:25 ` Johan Hovold
2025-04-03 9:08 ` Cristian Marussi
2025-04-03 10:05 ` Johan Hovold
2025-04-04 13:33 ` Cristian Marussi
2025-04-04 13:22 ` [RFC PATCH 0/3] Introduce SCMI Quirks framework Johan Hovold
2025-04-04 13:30 ` Cristian Marussi
2025-04-15 13:55 ` Cristian Marussi [this message]
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=Z_5lJA74OugEbB-S@pluto \
--to=cristian.marussi@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=f.fainelli@gmail.com \
--cc=james.quinlan@broadcom.com \
--cc=johan@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=michal.simek@amd.com \
--cc=peng.fan@oss.nxp.com \
--cc=quic_sibis@quicinc.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).