]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/ArmScmiDxe: Fix the calculation of RequiredArraySize
authorSudeep Holla <sudeep.holla@arm.com>
Fri, 3 Feb 2023 14:23:38 +0000 (14:23 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 6 Feb 2023 13:56:24 +0000 (13:56 +0000)
commitb98e2113b53fa9c7474a820bcd94fffb352acdf6
tree7f2396d6e95971a961245fd23eb603246b95cd11
parent9d669016d968b0f3e17ce7df16ae51d85b0adfcf
ArmPkg/ArmScmiDxe: Fix the calculation of RequiredArraySize

As per the SCMI specification, section CLOCK_DESCRIBE_RATES mentions
that the value of num_rates_flags[11:0] in the response must be 3 if
the return format is the triplet. Due to the buggy firmware, this was
not noticed for long time. The firmware is now fixed resulting in
ClockDescribeRates() to fail with "Buffer Too Small" error as the
RequiredArraySize gets miscalculated as 72 instead of 24.

Fix the issue by reusing the logic for both the return format which
must work if num_rates_flags has correct value as expected from the
specification.

Cc: Girish Pathak <girish.pathak@arm.com>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
Reported-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c