[Skiboot] [PATCH v1] core/ipmi: Provide the dequeue message interface

Alistair Popple alistair at popple.id.au
Wed Jul 1 16:42:59 AEST 2015


Looks good, although I just noticed a potential issue in bt_del_ipmi_msg (and 
by extension your fsp_ipmi_dequeue_msg). We should check that the message is 
in the queue by using list_del_from() instead of just calling list_del() and 
hoping that (bt|fsp)_msg->link points to the right place.

Acked-by: Alistair Popple <alistair at popple.id.au>

On Wed, 1 Jul 2015 11:50:18 Neelesh Gupta wrote:
> Add a wrapper for the client to be able to invoke the backend
> dequeue message function.
> 
> Signed-off-by: Neelesh Gupta <neelegup at linux.vnet.ibm.com>
> Cc: Alistair Popple <alistair at popple.id.au>
> ---
>  core/ipmi.c    |   13 +++++++++++++
>  include/ipmi.h |    3 +++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/core/ipmi.c b/core/ipmi.c
> index 9d91c26..60e9640 100644
> --- a/core/ipmi.c
> +++ b/core/ipmi.c
> @@ -119,6 +119,19 @@ int ipmi_queue_msg(struct ipmi_msg *msg)
>  	return msg->backend->queue_msg(msg);
>  }
>  
> +int ipmi_dequeue_msg(struct ipmi_msg *msg)
> +{
> +	if (!ipmi_present())
> +		return OPAL_HARDWARE;
> +
> +	if (!msg) {
> +		prerror("%s: Attempting to dequeue NULL message\n", __func__);
> +		return OPAL_PARAMETER;
> +	}
> +
> +	return msg->backend->dequeue_msg(msg);
> +}
> +
>  void ipmi_cmd_done(uint8_t cmd, uint8_t netfn, uint8_t cc, struct ipmi_msg 
*msg)
>  {
>  	msg->cc = cc;
> diff --git a/include/ipmi.h b/include/ipmi.h
> index 77e4b9a..f25b747 100644
> --- a/include/ipmi.h
> +++ b/include/ipmi.h
> @@ -207,6 +207,9 @@ int ipmi_queue_msg_head(struct ipmi_msg *msg);
>   * messages callback has been called. */
>  void ipmi_queue_msg_sync(struct ipmi_msg *msg);
>  
> +/* Removes the message from the list, queued previously */
> +int ipmi_dequeue_msg(struct ipmi_msg *msg);
> +
>  /* Process a completed message */
>  void ipmi_cmd_done(uint8_t cmd, uint8_t netfn, uint8_t cc, struct ipmi_msg 
*msg);
>  
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
> 



More information about the Skiboot mailing list