]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: arm_scmi: Support vendor protocol modules autoloading
authorCristian Marussi <cristian.marussi@arm.com>
Mon, 9 Dec 2024 16:49:55 +0000 (16:49 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 10 Dec 2024 10:30:45 +0000 (10:30 +0000)
commit54cf6e786caa29e125f34a3cf33bc7cfa3aa74da
tree05435da0bc7d093e5bd4bca6c1b10f9ab484edda
parente501bfde65581aad673e1022fdaf4e8ab928f9f2
firmware: arm_scmi: Support vendor protocol modules autoloading

SCMI vendor protocols namespace is shared amongst all vendors so that there
can be multiple implementation for the same protocol ID by different
vendors, exposing completely different functionalities and used by distinct
SCMI vendor drivers.

For these reasons, at runtime, when some driver asks for a protocol, the
proper implementation to use is chosen based on the SCMI vendor/subvendor/
impl_version data as advertised by the platform SCMI server and gathered
from the SCMI core during stack initialization: this enables proper runtime
selection of vendor protocols even when many different protocols from
different vendors are built into the same image via a common defconfig.

This same selection mechanism works similarly well even when all the vendor
protocols are compiled as loadable modules, as long as all such required
protocol modules have been previously loaded by some other means.

Add support for the automatic loading of vendor protocol modules, based on
protocol/vendor IDs, when an SCMI driver attempts to use such a protocol.

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZytnRc94iKUfMYH0@hovoldconsulting.com/
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20241209164957.1801886-2-cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/driver.c