Commit 6175c8fd authored by Russell Currey's avatar Russell Currey Committed by Greg Kroah-Hartman

powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages

commit c88c5d43 upstream.

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: default avatarRussell Currey <ruscur@russell.cc>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b2cd42d3
...@@ -35,7 +35,7 @@ int64_t opal_console_read(int64_t term_number, __be64 *length, ...@@ -35,7 +35,7 @@ int64_t opal_console_read(int64_t term_number, __be64 *length,
uint8_t *buffer); uint8_t *buffer);
int64_t opal_console_write_buffer_space(int64_t term_number, int64_t opal_console_write_buffer_space(int64_t term_number,
__be64 *length); __be64 *length);
void opal_console_flush(void); int64_t opal_console_flush(int64_t term_number);
int64_t opal_rtc_read(__be32 *year_month_day, int64_t opal_rtc_read(__be32 *year_month_day,
__be64 *hour_minute_second_millisecond); __be64 *hour_minute_second_millisecond);
int64_t opal_rtc_write(uint32_t year_month_day, int64_t opal_rtc_write(uint32_t year_month_day,
......
...@@ -27,6 +27,7 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper, ...@@ -27,6 +27,7 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper,
enum kmsg_dump_reason reason) enum kmsg_dump_reason reason)
{ {
int i; int i;
int64_t ret;
/* /*
* Outside of a panic context the pollers will continue to run, * 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, ...@@ -36,7 +37,13 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper,
return; return;
if (opal_check_token(OPAL_CONSOLE_FLUSH)) { 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 { } else {
/* /*
* If OPAL_CONSOLE_FLUSH is not implemented in the firmware, * If OPAL_CONSOLE_FLUSH is not implemented in the firmware,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment