Skip to content

Commit e95d8ea

Browse files
kelleymharndb
authored andcommitted
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: 821b67f ("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>
1 parent 4fd932a commit e95d8ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/firmware/smccc/soc_id.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int __init smccc_soc_init(void)
5050
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
5151
ARM_SMCCC_ARCH_SOC_ID, &res);
5252

53-
if (res.a0 == SMCCC_RET_NOT_SUPPORTED) {
53+
if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) {
5454
pr_info("ARCH_SOC_ID not implemented, skipping ....\n");
5555
return 0;
5656
}

0 commit comments

Comments
 (0)