firmware: arm_scmi: Fix frequency truncation by promoting multiplier type
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 30 Nov 2023 20:43:42 +0000 (20:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:15 +0000 (18:45 +0100)
commit1ea9f8abe364e41dc0d942baf01b5020f5b343ae
treef895c8948d3efaee21fe32a6c79bda3c4f00d757
parentc3af26f536161a34b26cabc0228a8d8ab50bf4f3
firmware: arm_scmi: Fix frequency truncation by promoting multiplier type

[ Upstream commit 8e3c98d9187e09274fc000a7d1a77b070a42d259 ]

Fix the possible frequency truncation for all values equal to or greater
4GHz on 64bit machines by updating the multiplier 'mult_factor' to
'unsigned long' type. It is also possible that the multiplier itself can
be greater than or equal to 2^32. So we need to also fix the equation
computing the value of the multiplier.

Fixes: a9e3fbfaa0ff ("firmware: arm_scmi: add initial support for performance protocol")
Reported-by: Sibi Sankar <quic_sibis@quicinc.com>
Closes: https://lore.kernel.org/all/20231129065748.19871-3-quic_sibis@quicinc.com/
Cc: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231130204343.503076-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/arm_scmi/perf.c