diff options
author | Anton Blanchard <anton@samba.org> | 2014-03-28 09:33:33 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-07 04:34:27 +0400 |
commit | bb4398e1de739a13e06589fc04cbb2267ba59800 (patch) | |
tree | f2e47b907f4b5275ee708988ca7899349424f4b7 /arch/powerpc/platforms/powernv/opal-async.c | |
parent | 32b941b79394435c1b6d688abfe762c5b3c82afa (diff) | |
download | linux-bb4398e1de739a13e06589fc04cbb2267ba59800.tar.xz |
powerpc/powernv: Fix endian issues with OPAL async code
OPAL defines opal_msg as a big endian struct so we have to
byte swap it on little endian builds.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-async.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-async.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-async.c b/arch/powerpc/platforms/powernv/opal-async.c index cd0c1354d404..32e2adfa5320 100644 --- a/arch/powerpc/platforms/powernv/opal-async.c +++ b/arch/powerpc/platforms/powernv/opal-async.c @@ -125,14 +125,15 @@ static int opal_async_comp_event(struct notifier_block *nb, { struct opal_msg *comp_msg = msg; unsigned long flags; + uint64_t token; if (msg_type != OPAL_MSG_ASYNC_COMP) return 0; - memcpy(&opal_async_responses[comp_msg->params[0]], comp_msg, - sizeof(*comp_msg)); + token = be64_to_cpu(comp_msg->params[0]); + memcpy(&opal_async_responses[token], comp_msg, sizeof(*comp_msg)); spin_lock_irqsave(&opal_async_comp_lock, flags); - __set_bit(comp_msg->params[0], opal_async_complete_map); + __set_bit(token, opal_async_complete_map); spin_unlock_irqrestore(&opal_async_comp_lock, flags); wake_up(&opal_async_wait); |