]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: smccc: Fix check for ARCH_SOC_ID not implemented
authorMichael Kelley <mikelley@microsoft.com>
Fri, 19 Nov 2021 23:39:01 +0000 (15:39 -0800)
committerArnd Bergmann <arnd@arndb.de>
Mon, 22 Nov 2021 10:42:59 +0000 (11:42 +0100)
commit62e53c79cf09941b8205d0f2562c3099118439a1
tree1466db50d5e1e9171e45d69313f3d2e8741f793f
parent6ac87cbb2784592aa4b0e7218e18e8cb3b87a87a
firmware: smccc: Fix check for ARCH_SOC_ID not implemented

The ARCH_FEATURES function ID is a 32-bit SMC call, which returns
a 32-bit result per the SMCCC spec.  Current code is doing a 64-bit
comparison against -1 (SMCCC_RET_NOT_SUPPORTED) to detect that the
feature is unimplemented.  That check doesn't work in a Hyper-V VM,
where the upper 32-bits are zero as allowed by the spec.

Cast the result as an 'int' so the comparison works. The change also
makes the code consistent with other similar checks in this file.

Fixes: 9f2f8265547d ("firmware: smccc: Add ARCH_SOC_ID support")
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/firmware/smccc/soc_id.c