firmware: arm_scmi: Add protocol versioning checks
authorCristian Marussi <cristian.marussi@arm.com>
Fri, 1 Dec 2023 13:58:58 +0000 (13:58 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Fri, 1 Dec 2023 16:46:10 +0000 (16:46 +0000)
commitb5efc28a754d2e90b9d52ba5aaa051cc24a5c85d
tree4d8be46e4eb0b1298b8d1f85db303d53481d5cbb
parentc3f17d5f89fc72d7b170beaf393a8687ae938b19
firmware: arm_scmi: Add protocol versioning checks

Platform and agent supported protocols versions do not necessarily match.

When talking to an older SCMI platform, supporting only older protocol
versions, the kernel SCMI agent will downgrade the version of the used
protocol to match the platform and avoid compatibility issues.

In the case where the kernel/OSPM agent happens to communicate with a
newer platform which can support newer protocol versions unknown to
the agent, and potentially backward incompatible, the agent currently
carries on, silently, in a best-effort approach.

Note that the SCMI specification doesn't provide means to explicitly
detect the protocol versions used by the agents, neither it is required
to support multiple, older, protocol versions.

Add an explicit protocol version check to let the agent detect when this
version mismatch happens and warn the user about this condition.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231201135858.2367651-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/base.c
drivers/firmware/arm_scmi/clock.c
drivers/firmware/arm_scmi/driver.c
drivers/firmware/arm_scmi/perf.c
drivers/firmware/arm_scmi/power.c
drivers/firmware/arm_scmi/powercap.c
drivers/firmware/arm_scmi/protocols.h
drivers/firmware/arm_scmi/reset.c
drivers/firmware/arm_scmi/sensors.c
drivers/firmware/arm_scmi/system.c
drivers/firmware/arm_scmi/voltage.c