diff options
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-kmsg.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-kmsg.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-kmsg.c b/arch/powerpc/platforms/powernv/opal-kmsg.c index fd2bbf4fd6dc..55691950d981 100644 --- a/arch/powerpc/platforms/powernv/opal-kmsg.c +++ b/arch/powerpc/platforms/powernv/opal-kmsg.c @@ -12,7 +12,6 @@ */ #include <linux/kmsg_dump.h> -#include <linux/delay.h> #include <asm/opal.h> #include <asm/opal-api.h> @@ -24,11 +23,9 @@ * may not be completely printed. This function does not actually dump the * message, it just ensures that OPAL completely flushes the console buffer. */ -static void force_opal_console_flush(struct kmsg_dumper *dumper, +static void kmsg_dump_opal_console_flush(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason) { - s64 rc; - /* * Outside of a panic context the pollers will continue to run, * so we don't need to do any special flushing. @@ -36,37 +33,11 @@ static void force_opal_console_flush(struct kmsg_dumper *dumper, if (reason != KMSG_DUMP_PANIC) return; - if (opal_check_token(OPAL_CONSOLE_FLUSH)) { - do { - rc = OPAL_BUSY; - while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { - rc = opal_console_flush(0); - if (rc == OPAL_BUSY_EVENT) { - mdelay(OPAL_BUSY_DELAY_MS); - opal_poll_events(NULL); - } else if (rc == OPAL_BUSY) { - mdelay(OPAL_BUSY_DELAY_MS); - } - } - } while (rc == OPAL_PARTIAL); /* More to flush */ - - } else { - __be64 evt; - - WARN_ONCE(1, "opal: OPAL_CONSOLE_FLUSH missing.\n"); - /* - * If OPAL_CONSOLE_FLUSH is not implemented in the firmware, - * the console can still be flushed by calling the polling - * function while it has OPAL_EVENT_CONSOLE_OUTPUT events. - */ - do { - opal_poll_events(&evt); - } while (be64_to_cpu(evt) & OPAL_EVENT_CONSOLE_OUTPUT); - } + opal_flush_console(0); } static struct kmsg_dumper opal_kmsg_dumper = { - .dump = force_opal_console_flush + .dump = kmsg_dump_opal_console_flush }; void __init opal_kmsg_init(void) |