audk/ArmPkg/Drivers/ArmScmiDxe
Sudeep Holla b98e2113b5 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>
2023-02-06 13:56:24 +00:00
..
ArmScmiBaseProtocolPrivate.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmScmiClockProtocolPrivate.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmScmiDxe.inf ArmPkg: Fix Ecc error 10014 in ArmScmiDxe 2021-04-15 19:53:39 +00:00
ArmScmiPerformanceProtocolPrivate.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Scmi.c ArmPkg: Remove duplicated words 2022-09-05 13:52:51 +00:00
ScmiBaseProtocol.c ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ScmiClockProtocol.c ArmPkg/ArmScmiDxe: Fix the calculation of RequiredArraySize 2023-02-06 13:56:24 +00:00
ScmiDxe.c ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ScmiDxe.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ScmiPerformanceProtocol.c ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ScmiPrivate.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00