diff options
author | Russell Currey <ruscur@russell.cc> | 2016-01-13 04:04:32 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-01-13 04:35:17 +0300 |
commit | c88c5d43732a0356f99e5e4d1ad62ab1ea516b81 (patch) | |
tree | bd70a2cb061347c113c4960e027bbbd40d69ba43 /arch/powerpc/platforms/powernv/opal-kmsg.c | |
parent | 2f10f1a7884e97a68e52c4b6f7866e29cf3fe7e6 (diff) | |
download | linux-c88c5d43732a0356f99e5e4d1ad62ab1ea516b81.tar.xz |
powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages
The recently added OPAL API call, OPAL_CONSOLE_FLUSH, originally took no
parameters and returned nothing. The call was updated to accept the
terminal number to flush, and returned various values depending on the
state of the output buffer.
The prototype has been updated and its usage in the OPAL kmsg dumper has
been modified to support its new behaviour as an incremental flush.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-kmsg.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-kmsg.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-kmsg.c b/arch/powerpc/platforms/powernv/opal-kmsg.c index bd3b2ee1ba1d..6f1214d4de92 100644 --- a/arch/powerpc/platforms/powernv/opal-kmsg.c +++ b/arch/powerpc/platforms/powernv/opal-kmsg.c @@ -27,6 +27,7 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason) { int i; + int64_t ret; /* * Outside of a panic context the pollers will continue to run, @@ -36,7 +37,13 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper, return; if (opal_check_token(OPAL_CONSOLE_FLUSH)) { - opal_console_flush(); + ret = opal_console_flush(0); + + if (ret == OPAL_UNSUPPORTED || ret == OPAL_PARAMETER) + return; + + /* Incrementally flush until there's nothing left */ + while (opal_console_flush(0) != OPAL_SUCCESS); } else { /* * If OPAL_CONSOLE_FLUSH is not implemented in the firmware, |