From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
To: Anton Blanchard <anton@samba.org>,
benh@kernel.crashing.org, paulus@samba.org,
stewart@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 4/6] powerpc/powernv: Fix little endian issues in OPAL error log code
Date: Tue, 22 Apr 2014 13:40:38 +0530 [thread overview]
Message-ID: <535623FE.3030702@linux.vnet.ibm.com> (raw)
In-Reply-To: <1398142887-24109-4-git-send-email-anton@samba.org>
On 04/22/2014 10:31 AM, Anton Blanchard wrote:
> Fix little endian issues with the OPAL error log code.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
> ---
> arch/powerpc/include/asm/opal.h | 2 +-
> arch/powerpc/platforms/powernv/opal-elog.c | 9 ++++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index cb7d52e..1a752ac 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -859,7 +859,7 @@ int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
> uint32_t addr, __be32 *data, uint32_t sz);
>
> int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id);
> -int64_t opal_get_elog_size(uint64_t *log_id, uint64_t *size, uint64_t *elog_type);
> +int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type);
> int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
> int64_t opal_send_ack_elog(uint64_t log_id);
> void opal_resend_pending_logs(void);
> diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
> index 7e3821e..10268c4 100644
> --- a/arch/powerpc/platforms/powernv/opal-elog.c
> +++ b/arch/powerpc/platforms/powernv/opal-elog.c
> @@ -238,18 +238,25 @@ static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type)
>
> static void elog_work_fn(struct work_struct *work)
> {
> + __be64 size;
> + __be64 id;
> + __be64 type;
> uint64_t elog_size;
> uint64_t log_id;
> uint64_t elog_type;
> int rc;
> char name[2+16+1];
>
> - rc = opal_get_elog_size(&log_id, &elog_size, &elog_type);
> + rc = opal_get_elog_size(&id, &size, &type);
> if (rc != OPAL_SUCCESS) {
> pr_err("ELOG: Opal log read failed\n");
> return;
> }
>
> + elog_size = be64_to_cpu(size);
> + log_id = be64_to_cpu(id);
Anton,
Shouldn't we covert Log ID back to BE format in ACK function (elog_ack_store() ) ?
Rest looks good.
-Vasant
> + elog_type = be64_to_cpu(type);
> +
> BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
>
> if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
>
next prev parent reply other threads:[~2014-04-22 8:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 5:01 [PATCH 1/6] powerpc/powernv: Use uint64_t instead of size_t in OPAL APIs Anton Blanchard
2014-04-22 5:01 ` [PATCH 2/6] powerpc/powernv: Remove some OPAL function declaration duplication Anton Blanchard
2014-04-22 5:01 ` [PATCH 3/6] powerpc/powernv: Fix little endian issues with opal_do_notifier calls Anton Blanchard
2014-04-22 5:01 ` [PATCH 4/6] powerpc/powernv: Fix little endian issues in OPAL error log code Anton Blanchard
2014-04-22 8:10 ` Vasant Hegde [this message]
2014-04-22 5:01 ` [PATCH 5/6] powerpc/powernv: Create OPAL sglist helper functions and fix endian issues Anton Blanchard
2014-04-22 9:16 ` Vasant Hegde
2014-04-22 21:34 ` Anton Blanchard
2014-04-22 5:01 ` [PATCH 6/6] powerpc/powernv: Fix little endian issues in OPAL dump code Anton Blanchard
2014-04-22 8:32 ` Vasant Hegde
2014-04-22 21:31 ` Anton Blanchard
2014-04-23 4:36 ` Vasant Hegde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=535623FE.3030702@linux.vnet.ibm.com \
--to=hegdevasant@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=stewart@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).