firmware: arm_scmi: Dynamically allocate implemented protocols array
authorCristian Marussi <cristian.marussi@arm.com>
Wed, 30 Mar 2022 15:05:34 +0000 (16:05 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Thu, 28 Apr 2022 17:22:51 +0000 (18:22 +0100)
commit776b6c8a25a36b5f46ed182ed6514c208e76720d
tree78d2d101cc31f40680ef20d8a4204ad728e2bf99
parent3b0041f6e10e5bdbb646d98172be43e88734ed62
firmware: arm_scmi: Dynamically allocate implemented protocols array

Move away from a statically allocated array for holding the current set of
protocols implemented by the platform in favour of allocating it
dynamically based on the number of protocols effectively advertised by the
platform via BASE protocol exchanges.

While at that, rectify the BASE_DISCOVER_LIST_PROTOCOLS loop iterations to
terminate only when a number of protocols equal to the advertised ones has
been received, instead of looping till the platform returns no more
protocols descriptors. This new behaviour is better compliant with the
specification and it has been tested to work equally well against an SCMI
stack running on top of an official SCP firmware on a JUNO board.

Link: https://lore.kernel.org/r/20220330150551.2573938-6-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/base.c
drivers/firmware/arm_scmi/common.h
drivers/firmware/arm_scmi/driver.c