Commit 14ad0c58d5df6e5911a5413abdc2a9be6a8acb51

Authored by Anton Blanchard
Committed by Benjamin Herrenschmidt
1 parent 56b4c99312

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>

Showing 2 changed files with 9 additions and 2 deletions Side-by-side Diff

arch/powerpc/include/asm/opal.h
... ... @@ -859,7 +859,7 @@
859 859 uint32_t addr, __be32 *data, uint32_t sz);
860 860  
861 861 int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id);
862   -int64_t opal_get_elog_size(uint64_t *log_id, uint64_t *size, uint64_t *elog_type);
  862 +int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type);
863 863 int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
864 864 int64_t opal_send_ack_elog(uint64_t log_id);
865 865 void opal_resend_pending_logs(void);
arch/powerpc/platforms/powernv/opal-elog.c
... ... @@ -238,17 +238,24 @@
238 238  
239 239 static void elog_work_fn(struct work_struct *work)
240 240 {
  241 + __be64 size;
  242 + __be64 id;
  243 + __be64 type;
241 244 uint64_t elog_size;
242 245 uint64_t log_id;
243 246 uint64_t elog_type;
244 247 int rc;
245 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 251 if (rc != OPAL_SUCCESS) {
249 252 pr_err("ELOG: Opal log read failed\n");
250 253 return;
251 254 }
  255 +
  256 + elog_size = be64_to_cpu(size);
  257 + log_id = be64_to_cpu(id);
  258 + elog_type = be64_to_cpu(type);
252 259  
253 260 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
254 261