summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/powernv/opal-async.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-07-04 07:51:44 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-08 12:53:26 +0300
commita203658b5ed37c11e5016d3fbbbab9ce018c1b78 (patch)
tree365f77c1da248c7c62e49fe58eb2daef9f17b73c /arch/powerpc/platforms/powernv/opal-async.c
parent68a2d80c80e1563b8dc942d4ffd5b3773b356bb6 (diff)
downloadlinux-a203658b5ed37c11e5016d3fbbbab9ce018c1b78.tar.xz
powerpc/opal: Wake up kopald polling thread before waiting for events
On some environments (prototype machines, some simulators, etc...) there is no functional interrupt source to signal completion, so we rely on the fairly slow OPAL heartbeat. In a number of cases, the calls complete very quickly or even immediately. We've observed that it helps a lot to wakeup the OPAL heartbeat thread before waiting for event in those cases, it will call OPAL immediately to collect completions for anything that finished fast enough. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-By: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-async.c')
-rw-r--r--arch/powerpc/platforms/powernv/opal-async.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-async.c b/arch/powerpc/platforms/powernv/opal-async.c
index bdc8c0c71d15..83bebeec0fea 100644
--- a/arch/powerpc/platforms/powernv/opal-async.c
+++ b/arch/powerpc/platforms/powernv/opal-async.c
@@ -117,6 +117,11 @@ int opal_async_wait_response(uint64_t token, struct opal_msg *msg)
return -EINVAL;
}
+ /* Wakeup the poller before we wait for events to speed things
+ * up on platforms or simulators where the interrupts aren't
+ * functional.
+ */
+ opal_wake_poller();
wait_event(opal_async_wait, test_bit(token, opal_async_complete_map));
memcpy(msg, &opal_async_responses[token], sizeof(*msg));