[Skiboot] [PATCH V4 2/6] opal/errorlog : Generalizes the error log write path to host

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri Aug 5 20:44:57 AEST 2016


On 07/26/2016 11:15 AM, Mukesh Ojha wrote:
> Movement of opal error log generic functions from fsp-elog-write.c to new
> file core/errorlog.c .

errorlog.c is not new file.

> Function declarations are kept in errorlog.h, which
> was there in fsp-elog.h earlier and fsp specific header files are kept in
> fsp-elog.h .
>
> Implementation of generic init routine for error log writing to host will
> be initialised independent of the platform on which it is going to run. It
> also involves a common memory buffer which will be used to copy the logs
> from opal to host buffer.
>
> Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
> ---
> Changes in V4:
>   - V3 1/6 becomes V4 2/6.
>   - Took Stewart's comment and moved generic write to host routine
>     to core/errorlog.c .
>   - Changes are rebased on master.
>
> Changes in V3:
>   -Change of letter case in the description.
>
> Changes in V2:
>   -No Changes.
>
>   core/errorlog.c            | 197 +++++++++++++++++++++++++++++++++++++++++++++
>   hw/fsp/fsp-elog-read.c     |  15 ----

Your description doesnt' match with what you are really doing. Dont' include 
code movement from read.c to errorlog.c in this patch.


>   hw/fsp/fsp-elog-write.c    | 179 ----------------------------------------
>   include/errorlog.h         |  26 +++++-
>   include/fsp-elog.h         |  31 +------
>   platforms/ibm-fsp/common.c |   4 +
>   6 files changed, 229 insertions(+), 223 deletions(-)
>
> diff --git a/core/errorlog.c b/core/errorlog.c
> index 3c320f4..d192cb6 100644
> --- a/core/errorlog.c
> +++ b/core/errorlog.c
> @@ -22,6 +22,7 @@
>   #include <skiboot.h>
>   #include <lock.h>
>   #include <errorlog.h>
> +#include <pel.h>
>   #include <pool.h>
>
>   /*
> @@ -38,9 +39,21 @@ static uint32_t sapphire_elog_id = 0xB0000000;
>
>   /* Pool to allocate elog messages from */
>   static struct pool elog_pool;
> +bool elog_enabled;

static bool?

>   static struct lock elog_lock = LOCK_UNLOCKED;
>   static bool elog_available = false;
>
> +static LIST_HEAD(elog_write_to_host_pending);
> +static LIST_HEAD(elog_write_to_host_processed);
> +
> +/* Log buffer size to write into PowerNV */
> +#define ELOG_WRITE_TO_HOST_BUFFER_SIZE  0x00004000
> +void *elog_write_to_host_buffer;
> +
> +static struct lock elog_write_to_host_lock = LOCK_UNLOCKED;
> +/* Manipulate this only with write_lock held */
> +static enum elog_head_state elog_write_to_host_head_state = ELOG_STATE_NONE;
> +
>   static struct errorlog *get_write_buffer(int opal_event_severity)
>   {
>   	struct errorlog *buf;
> @@ -210,6 +223,179 @@ void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...)
>   	}
>   }
>
> +/* This should be called with elog_write_to_host_lock lock */
> +static inline void fsp_elog_write_set_head_state(enum elog_head_state state)
> +{
> +	elog_set_head_state(true, state);

Looks like you are still keeping "elog_set_head_state" under fsp-elog-read.c .. 
We should move this to errorlog.c

-Vasant



More information about the Skiboot mailing list