aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/con3215.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/con3215.c')
-rw-r--r--drivers/s390/char/con3215.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index d3ec9b55ab35..982cf62ab66d 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -21,6 +21,7 @@
21#include <linux/console.h> 21#include <linux/console.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/reboot.h>
24 25
25#include <linux/slab.h> 26#include <linux/slab.h>
26#include <linux/bootmem.h> 27#include <linux/bootmem.h>
@@ -775,11 +776,11 @@ static struct tty_driver *con3215_device(struct console *c, int *index)
775} 776}
776 777
777/* 778/*
778 * panic() calls console_unblank before the system enters a 779 * panic() calls con3215_flush through a panic_notifier
779 * disabled, endless loop. 780 * before the system enters a disabled, endless loop.
780 */ 781 */
781static void 782static void
782con3215_unblank(void) 783con3215_flush(void)
783{ 784{
784 struct raw3215_info *raw; 785 struct raw3215_info *raw;
785 unsigned long flags; 786 unsigned long flags;
@@ -790,6 +791,23 @@ con3215_unblank(void)
790 spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); 791 spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
791} 792}
792 793
794static int con3215_notify(struct notifier_block *self,
795 unsigned long event, void *data)
796{
797 con3215_flush();
798 return NOTIFY_OK;
799}
800
801static struct notifier_block on_panic_nb = {
802 .notifier_call = con3215_notify,
803 .priority = 0,
804};
805
806static struct notifier_block on_reboot_nb = {
807 .notifier_call = con3215_notify,
808 .priority = 0,
809};
810
793/* 811/*
794 * The console structure for the 3215 console 812 * The console structure for the 3215 console
795 */ 813 */
@@ -797,7 +815,6 @@ static struct console con3215 = {
797 .name = "ttyS", 815 .name = "ttyS",
798 .write = con3215_write, 816 .write = con3215_write,
799 .device = con3215_device, 817 .device = con3215_device,
800 .unblank = con3215_unblank,
801 .flags = CON_PRINTBUFFER, 818 .flags = CON_PRINTBUFFER,
802}; 819};
803 820
@@ -859,6 +876,8 @@ con3215_init(void)
859 raw3215[0] = NULL; 876 raw3215[0] = NULL;
860 return -ENODEV; 877 return -ENODEV;
861 } 878 }
879 atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
880 register_reboot_notifier(&on_reboot_nb);
862 register_console(&con3215); 881 register_console(&con3215);
863 return 0; 882 return 0;
864} 883}