提交 2d6b63bb 编写于 作者: A Anton Blanchard 提交者: Benjamin Herrenschmidt

powerpc/powernv: Fix little endian issues in OPAL dump code

Signed-off-by: NAnton Blanchard <anton@samba.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 3441f04b
...@@ -868,8 +868,8 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); ...@@ -868,8 +868,8 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
int64_t opal_manage_flash(uint8_t op); int64_t opal_manage_flash(uint8_t op);
int64_t opal_update_flash(uint64_t blk_list); int64_t opal_update_flash(uint64_t blk_list);
int64_t opal_dump_init(uint8_t dump_type); int64_t opal_dump_init(uint8_t dump_type);
int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size); int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size);
int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type); int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type);
int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
int64_t opal_dump_ack(uint32_t dump_id); int64_t opal_dump_ack(uint32_t dump_id);
int64_t opal_dump_resend_notification(void); int64_t opal_dump_resend_notification(void);
......
...@@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = { ...@@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = {
.default_attrs = dump_default_attrs, .default_attrs = dump_default_attrs,
}; };
static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type) static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type)
{ {
__be32 id, size, type;
int rc; int rc;
*type = 0xffffffff;
rc = opal_dump_info2(id, size, type); type = cpu_to_be32(0xffffffff);
rc = opal_dump_info2(&id, &size, &type);
if (rc == OPAL_PARAMETER) if (rc == OPAL_PARAMETER)
rc = opal_dump_info(id, size); rc = opal_dump_info(&id, &size);
*dump_id = be32_to_cpu(id);
*dump_size = be32_to_cpu(size);
*dump_type = be32_to_cpu(type);
if (rc) if (rc)
pr_warn("%s: Failed to get dump info (%d)\n", pr_warn("%s: Failed to get dump info (%d)\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册