diff options
author | Anton Blanchard <anton@samba.org> | 2014-04-22 01:01:27 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-27 23:11:24 -0400 |
commit | 2d6b63bbdd7a649ea17fae19f8bab07d4b292a09 (patch) | |
tree | f2645d5a95f7c8089dfb5b53b4048348f74455ac /arch/powerpc | |
parent | 3441f04b4b62758a798f9fbbf2047dfedf0329a5 (diff) |
powerpc/powernv: Fix little endian issues in OPAL dump code
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/opal.h | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-dump.c | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index afb0fedd1214..66ad7a74116f 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -868,8 +868,8 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); | |||
868 | int64_t opal_manage_flash(uint8_t op); | 868 | int64_t opal_manage_flash(uint8_t op); |
869 | int64_t opal_update_flash(uint64_t blk_list); | 869 | int64_t opal_update_flash(uint64_t blk_list); |
870 | int64_t opal_dump_init(uint8_t dump_type); | 870 | int64_t opal_dump_init(uint8_t dump_type); |
871 | int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size); | 871 | int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size); |
872 | int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type); | 872 | int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type); |
873 | int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); | 873 | int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); |
874 | int64_t opal_dump_ack(uint32_t dump_id); | 874 | int64_t opal_dump_ack(uint32_t dump_id); |
875 | int64_t opal_dump_resend_notification(void); | 875 | int64_t opal_dump_resend_notification(void); |
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c index f0b472427c57..788a1977b9a5 100644 --- a/arch/powerpc/platforms/powernv/opal-dump.c +++ b/arch/powerpc/platforms/powernv/opal-dump.c | |||
@@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = { | |||
209 | .default_attrs = dump_default_attrs, | 209 | .default_attrs = dump_default_attrs, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type) | 212 | static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type) |
213 | { | 213 | { |
214 | __be32 id, size, type; | ||
214 | int rc; | 215 | int rc; |
215 | *type = 0xffffffff; | ||
216 | 216 | ||
217 | rc = opal_dump_info2(id, size, type); | 217 | type = cpu_to_be32(0xffffffff); |
218 | 218 | ||
219 | rc = opal_dump_info2(&id, &size, &type); | ||
219 | if (rc == OPAL_PARAMETER) | 220 | if (rc == OPAL_PARAMETER) |
220 | rc = opal_dump_info(id, size); | 221 | rc = opal_dump_info(&id, &size); |
222 | |||
223 | *dump_id = be32_to_cpu(id); | ||
224 | *dump_size = be32_to_cpu(size); | ||
225 | *dump_type = be32_to_cpu(type); | ||
221 | 226 | ||
222 | if (rc) | 227 | if (rc) |
223 | pr_warn("%s: Failed to get dump info (%d)\n", | 228 | pr_warn("%s: Failed to get dump info (%d)\n", |