Skip to content

Commit cc146d1

Browse files
antonblanchardozbenh
authored andcommitted
powerpc/powernv: Fix little endian issues in OPAL flash code
With this patch I was able to update firmware on an LE kernel. Signed-off-by: Anton Blanchard <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent 298b34d commit cc146d1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

arch/powerpc/platforms/powernv/opal-flash.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ static DEFINE_MUTEX(image_data_mutex);
131131
*/
132132
static inline void opal_flash_validate(void)
133133
{
134-
struct validate_flash_t *args_buf = &validate_flash_data;
134+
long ret;
135+
void *buf = validate_flash_data.buf;
136+
__be32 size, result;
137+
138+
ret = opal_validate_flash(__pa(buf), &size, &result);
135139

136-
args_buf->status = opal_validate_flash(__pa(args_buf->buf),
137-
&(args_buf->buf_size),
138-
&(args_buf->result));
140+
validate_flash_data.status = ret;
141+
validate_flash_data.buf_size = be32_to_cpu(size);
142+
validate_flash_data.result = be32_to_cpu(result);
139143
}
140144

141145
/*

0 commit comments

Comments
 (0)