Skip to content

Commit ec81355

Browse files
sudeep-hollaopsiff
authored andcommitted
firmware: arm_ffa: Reject higher major version as incompatible
[ Upstream commit efff6a7 ] When the firmware compatibility was handled previously in the commit 8e3f9da ("firmware: arm_ffa: Handle compatibility with different firmware versions"), we only addressed firmware versions that have higher minor versions compared to the driver version which is should be considered compatible unless the firmware returns NOT_SUPPORTED. However, if the firmware reports higher major version than the driver supported, we need to reject it. If the firmware can work in a compatible mode with the driver requested version, it must return the same major version as requested. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Message-Id: <20250217-ffa_updates-v3-12-bd1d9de615e7@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 3da8088afd13a24ab1e2911c087966f107ba86bc)
1 parent eecda80 commit ec81355

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/firmware/arm_ffa/driver.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ static int ffa_version_check(u32 *version)
121121
return -EOPNOTSUPP;
122122
}
123123

124+
if (FFA_MAJOR_VERSION(ver.a0) > FFA_MAJOR_VERSION(FFA_DRIVER_VERSION)) {
125+
pr_err("Incompatible v%d.%d! Latest supported v%d.%d\n",
126+
FFA_MAJOR_VERSION(ver.a0), FFA_MINOR_VERSION(ver.a0),
127+
FFA_MAJOR_VERSION(FFA_DRIVER_VERSION),
128+
FFA_MINOR_VERSION(FFA_DRIVER_VERSION));
129+
return -EINVAL;
130+
}
131+
124132
if (ver.a0 < FFA_MIN_VERSION) {
125133
pr_err("Incompatible v%d.%d! Earliest supported v%d.%d\n",
126134
FFA_MAJOR_VERSION(ver.a0), FFA_MINOR_VERSION(ver.a0),

0 commit comments

Comments
 (0)