|
@@ -12,7 +12,6 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include <linux/kmsg_dump.h>
|
|
#include <linux/kmsg_dump.h>
|
|
-#include <linux/delay.h>
|
|
|
|
|
|
|
|
#include <asm/opal.h>
|
|
#include <asm/opal.h>
|
|
#include <asm/opal-api.h>
|
|
#include <asm/opal-api.h>
|
|
@@ -24,11 +23,9 @@
|
|
* may not be completely printed. This function does not actually dump the
|
|
* may not be completely printed. This function does not actually dump the
|
|
* message, it just ensures that OPAL completely flushes the console buffer.
|
|
* 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)
|
|
enum kmsg_dump_reason reason)
|
|
{
|
|
{
|
|
- s64 rc;
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Outside of a panic context the pollers will continue to run,
|
|
* Outside of a panic context the pollers will continue to run,
|
|
* so we don't need to do any special flushing.
|
|
* 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)
|
|
if (reason != KMSG_DUMP_PANIC)
|
|
return;
|
|
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 = {
|
|
static struct kmsg_dumper opal_kmsg_dumper = {
|
|
- .dump = force_opal_console_flush
|
|
|
|
|
|
+ .dump = kmsg_dump_opal_console_flush
|
|
};
|
|
};
|
|
|
|
|
|
void __init opal_kmsg_init(void)
|
|
void __init opal_kmsg_init(void)
|