aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp_con.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/sclp_con.c')
-rw-r--r--drivers/s390/char/sclp_con.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
index 7e619c534bf4..9a25c4bd1421 100644
--- a/drivers/s390/char/sclp_con.c
+++ b/drivers/s390/char/sclp_con.c
@@ -16,6 +16,7 @@
16#include <linux/bootmem.h> 16#include <linux/bootmem.h>
17#include <linux/termios.h> 17#include <linux/termios.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/reboot.h>
19 20
20#include "sclp.h" 21#include "sclp.h"
21#include "sclp_rw.h" 22#include "sclp_rw.h"
@@ -172,7 +173,7 @@ sclp_console_device(struct console *c, int *index)
172 * will be flushed to the SCLP. 173 * will be flushed to the SCLP.
173 */ 174 */
174static void 175static void
175sclp_console_unblank(void) 176sclp_console_flush(void)
176{ 177{
177 unsigned long flags; 178 unsigned long flags;
178 179
@@ -188,6 +189,24 @@ sclp_console_unblank(void)
188 spin_unlock_irqrestore(&sclp_con_lock, flags); 189 spin_unlock_irqrestore(&sclp_con_lock, flags);
189} 190}
190 191
192static int
193sclp_console_notify(struct notifier_block *self,
194 unsigned long event, void *data)
195{
196 sclp_console_flush();
197 return NOTIFY_OK;
198}
199
200static struct notifier_block on_panic_nb = {
201 .notifier_call = sclp_console_notify,
202 .priority = 1,
203};
204
205static struct notifier_block on_reboot_nb = {
206 .notifier_call = sclp_console_notify,
207 .priority = 1,
208};
209
191/* 210/*
192 * used to register the SCLP console to the kernel and to 211 * used to register the SCLP console to the kernel and to
193 * give printk necessary information 212 * give printk necessary information
@@ -197,7 +216,6 @@ static struct console sclp_console =
197 .name = sclp_console_name, 216 .name = sclp_console_name,
198 .write = sclp_console_write, 217 .write = sclp_console_write,
199 .device = sclp_console_device, 218 .device = sclp_console_device,
200 .unblank = sclp_console_unblank,
201 .flags = CON_PRINTBUFFER, 219 .flags = CON_PRINTBUFFER,
202 .index = 0 /* ttyS0 */ 220 .index = 0 /* ttyS0 */
203}; 221};
@@ -241,6 +259,8 @@ sclp_console_init(void)
241 sclp_con_width_htab = 8; 259 sclp_con_width_htab = 8;
242 260
243 /* enable printk-access to this driver */ 261 /* enable printk-access to this driver */
262 atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
263 register_reboot_notifier(&on_reboot_nb);
244 register_console(&sclp_console); 264 register_console(&sclp_console);
245 return 0; 265 return 0;
246} 266}