[Skiboot] [PATCH 16/22] FSP/LEDS: Move checkpoint status variable to led_set_cmd structure
Stewart Smith
stewart at linux.vnet.ibm.com
Wed Feb 18 07:43:46 AEDT 2015
Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:
> "fsp_led_data" structure contains ckpt_status variable which keeps
> current LED state before updating and if LED update fails then we
> use this to revert the LED state.
>
> We have introduced new strucutre (led_set_cmd) to queue up LED update
> requests. It make sense to move checkpoint status variable to this
> new structure.
>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
> hw/fsp/fsp-leds.c | 42 +++++++++++++++++++++++++-----------------
> hw/fsp/fsp-leds.h | 2 +-
> 2 files changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
> index 16c9b68..335a967 100644
> --- a/hw/fsp/fsp-leds.c
> +++ b/hw/fsp/fsp-leds.c
> @@ -244,14 +244,21 @@ enclosure:
> encl_led->excl_bit = encl_cec_led->excl_bit;
> }
>
> +/* Free SPCN command */
> +static inline void free_spcn_cmd(struct led_set_cmd *spcn_cmd)
> +{
> + lock(&spcn_cmd_lock);
> + free(spcn_cmd);
> + unlock(&spcn_cmd_lock);
> +}
I'm struggling to work out why this needs a lock (or a separate function
that just wraps free()). What am I missing?
More information about the Skiboot
mailing list