linux-stable/drivers/firmware/arm_scmi
Sudeep Holla 77f5032e94 firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode
The multiplier is already promoted to unsigned long, however the
frequency calculations done when using level indexing mode doesn't
use the multiplier computed. It instead hardcodes the multiplier
value of 1000 at all the usage sites.

Clean that up by assigning the multiplier value of 1000 when using
the perf level indexing mode and update the frequency calculations to
use the multiplier instead. It should fix the possible frequency
truncation for all the values greater than or equal to 4GHz on 64-bit
machines.

Fixes: 31c7c1397a ("firmware: arm_scmi: Add v3.2 perf level indexing mode support")
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-2-sudeep.holla@arm.com
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2023-12-04 12:33:44 +00:00
..
base.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
bus.c firmware: arm_scmi: Remove duplicate include header inclusion 2023-03-06 08:42:33 +00:00
clock.c firmware: arm_scmi: Add support for clock parents 2023-10-08 21:16:30 +01:00
common.h firmware: arm_scmi: Add per-channel raw injection support 2023-01-20 11:41:37 +00:00
driver.c firmware: arm_scmi: Add qcom smc/hvc transport support 2023-10-09 22:07:13 +01:00
Kconfig pmdomain: arm: Add the SCMI performance domain 2023-09-21 16:35:14 +01:00
mailbox.c firmware: arm_scmi: Drop OF node reference in the transport channel setup 2023-07-19 18:25:21 +01:00
Makefile firmware: arm_scmi: Move power-domain driver to the pmdomain dir 2023-09-21 16:35:14 +01:00
msg.c firmware: arm_scmi: Add message passing abstractions for transports 2021-08-05 10:23:23 +01:00
notify.c firmware: arm_scmi: Fix kernel doc warnings about return values 2021-07-13 11:39:54 +01:00
notify.h firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle 2021-04-27 11:57:26 +01:00
optee.c firmware: Use of_property_present() for testing DT property presence 2023-04-04 21:51:23 +02:00
perf.c firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode 2023-12-04 12:33:44 +00:00
power.c firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary 2022-06-10 17:55:29 +01:00
powercap.c firmware: arm_scmi: Do not use !! on boolean when setting msg->flags 2023-09-27 13:17:53 +01:00
protocols.h firmware: arm_scmi: Add per-channel raw injection support 2023-01-20 11:41:37 +00:00
raw_mode.c firmware: arm_scmi: Fix signed error return values handling 2023-07-18 10:50:57 +01:00
raw_mode.h firmware: arm_scmi: Add per-channel raw injection support 2023-01-20 11:41:37 +00:00
reset.c firmware: arm_scmi: Fix the asynchronous reset requests 2022-08-23 12:21:37 +01:00
scmi_power_control.c firmware: arm_scmi: Add SCMI System Power Control driver 2022-07-04 14:28:42 +01:00
sensors.c firmware: arm_scmi: Harden accesses to the sensor domains 2022-08-22 18:02:59 +01:00
shmem.c firmware: arm_scmi: Harden shared memory access in fetch_notification 2023-01-03 16:50:30 +00:00
smc.c firmware: arm_scmi: Add qcom smc/hvc transport support 2023-10-09 22:07:13 +01:00
system.c firmware: arm_scmi: Add SCMI v3.1 System Power extensions 2022-07-04 14:28:42 +01:00
virtio.c firmware: arm_scmi: Use dedicated devices to initialize channels 2023-01-19 09:43:48 +00:00
voltage.c firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get 2022-06-12 19:59:55 +01:00