From: Cristian Marussi <cristian.marussi@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Cristian Marussi <cristian.marussi@arm.com>,
Xinqi Zhang <quic_xinqzhan@quicinc.com>,
Peng Fan <peng.fan@nxp.com>, Guomin Chen <guomin_chen@sina.com>
Subject: Re: [PATCH 3/3] firmware: arm_scmi: Emit modalias for SCMI devices
Date: Mon, 3 Feb 2025 09:33:23 +0000 [thread overview]
Message-ID: <Z6CNWOp8B_ghIrJt@pluto> (raw)
In-Reply-To: <20250131141822.514342-3-sudeep.holla@arm.com>
On Fri, Jan 31, 2025 at 02:18:22PM +0000, Sudeep Holla wrote:
> In order to enable libkmod lookups for SCMI device objects to their
> corresponding module, add 'modalias' to the base attribute of SCMI
> devices.
>
Hi Sudeep,
Indeed, as of today if you build the SCMI stack completely as modules, only the
core stack (scmi-core/scmi-module) and the needed SCMI transports are loaded
automatically, so this patch, I understand, is meant to add the missing bits
to enable autoloading also for the SCMI drivers that sits on top like
scmi-cpufreq etc..
In fact, I tried experimenting with something similar to your solution
recently to enable MODALIAS emission and full stack autoloading, BUT then
I realized it could have worked ONLY with an additional hack...
...the problem lays in the fact that since we wanted to allow Vendor
drivers and protocols to be easily added without changing the core (as
asked by vendors themslves AFAICR), we dont have a central static
devices-table hold by the SCMI bus core (as usual) but instead we let
SCMI drivers dynamically request protocol/devices that are needed...
...and this in turn means that the devices are created only when a driver
requires a specifc protocol/name pair (and a matching DT entry is found)
during its initalization at load time...so it's a chicken-egg problem
since the MODALIAS that will cause, say, scmi-cpufreq to be loaded will
be emitted only when the device for scmi-cpufeq will be created BUT that
currently happens only if the device was requested during the init/loading
of scmi-cpufreq itself...
...the dynamic request-device mechanism added to give vendors flexibility
does break the usual module autoloading capabilities AFAIU...
...indeed I tested this series with a full modularized SCMI stack and it
does NOT cause the full stack to be loaded...
Having said that, since this dynamic-request device mechanism was meant
to ease vendors additions, my hack was simply to pre-request all the
standard protocol devices at bus init...in that way the full stack does
finally autoload...I will post that 2 patches of mine as and RFC in
response to this for the sake of clarity...
Note that such a hack, or a better polished version of it, would NOT work
anyway for Vendor modules: if we want to keep such flexibility they still
have to be loaded manually...
Alternatively we could get rid of dynamic device creation as a whole and
revert to a more standard static central devicetable for all...not sure
really if the flexibility of device creation at runtime without keeping
a common central table is really needed/appreciated by the Vendors that
asked for it in first place :D
Thanks,
Cristian
next prev parent reply other threads:[~2025-02-03 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 14:18 [PATCH 1/3] firmware: arm_scmi: Relax duplicate name constraint across protocol ids Sudeep Holla
2025-01-31 14:18 ` [PATCH 2/3] firmware: arm_scmi: Add name and protocol id attributes Sudeep Holla
2025-02-03 6:25 ` Dhruva Gole
2025-01-31 14:18 ` [PATCH 3/3] firmware: arm_scmi: Emit modalias for SCMI devices Sudeep Holla
2025-02-03 9:33 ` Cristian Marussi [this message]
2025-02-03 10:01 ` [RFC PATCH 1/2] firmware: arm_scmi: Generate aliases for SCMI modules Cristian Marussi
2025-02-03 10:01 ` [RFC PATCH 2/2] firmware: arm_scmi: Add bus support for autoloading Cristian Marussi
2025-02-02 11:08 ` [PATCH 1/3] firmware: arm_scmi: Relax duplicate name constraint across protocol ids Peng Fan
2025-02-03 6:21 ` Dhruva Gole
2025-02-21 11:36 ` Sudeep Holla
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=Z6CNWOp8B_ghIrJt@pluto \
--to=cristian.marussi@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=guomin_chen@sina.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=peng.fan@nxp.com \
--cc=quic_xinqzhan@quicinc.com \
--cc=sudeep.holla@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;
as well as URLs for NNTP newsgroup(s).