aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2014-04-22 01:01:25 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-27 23:11:23 -0400
commit14ad0c58d5df6e5911a5413abdc2a9be6a8acb51 (patch)
tree323f23b7192a5468c0c7957e49deafa27e24a502
parent56b4c993124d15f3b198cc757ba49a0022b5d695 (diff)
powerpc/powernv: Fix little endian issues in OPAL error log code
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> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/opal.h2
-rw-r--r--arch/powerpc/platforms/powernv/opal-elog.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index cb7d52ed86d2..1a752ac8c0ba 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,
859 uint32_t addr, __be32 *data, uint32_t sz); 859 uint32_t addr, __be32 *data, uint32_t sz);
860 860
861int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id); 861int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id);
862int64_t opal_get_elog_size(uint64_t *log_id, uint64_t *size, uint64_t *elog_type); 862int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type);
863int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset); 863int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
864int64_t opal_send_ack_elog(uint64_t log_id); 864int64_t opal_send_ack_elog(uint64_t log_id);
865void opal_resend_pending_logs(void); 865void opal_resend_pending_logs(void);
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 7e3821e611a8..10268c41d830 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)
238 238
239static void elog_work_fn(struct work_struct *work) 239static void elog_work_fn(struct work_struct *work)
240{ 240{
241 __be64 size;
242 __be64 id;
243 __be64 type;
241 uint64_t elog_size; 244 uint64_t elog_size;
242 uint64_t log_id; 245 uint64_t log_id;
243 uint64_t elog_type; 246 uint64_t elog_type;
244 int rc; 247 int rc;
245 char name[2+16+1]; 248 char name[2+16+1];
246 249
247 rc = opal_get_elog_size(&log_id, &elog_size, &elog_type); 250 rc = opal_get_elog_size(&id, &size, &type);
248 if (rc != OPAL_SUCCESS) { 251 if (rc != OPAL_SUCCESS) {
249 pr_err("ELOG: Opal log read failed\n"); 252 pr_err("ELOG: Opal log read failed\n");
250 return; 253 return;
251 } 254 }
252 255
256 elog_size = be64_to_cpu(size);
257 log_id = be64_to_cpu(id);
258 elog_type = be64_to_cpu(type);
259
253 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); 260 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
254 261
255 if (elog_size >= OPAL_MAX_ERRLOG_SIZE) 262 if (elog_size >= OPAL_MAX_ERRLOG_SIZE)