aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp_vt220.c
diff options
context:
space:
mode:
authorHolger Smolinski <Holger.Smolinski@de.ibm.com>2008-10-10 15:33:27 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-10-10 15:34:01 -0400
commit2332ce1a97963b7769e0c2d40492a10a124efba5 (patch)
tree38728f02d84d91c9ce6e4bb06e871cc19cbe57cd /drivers/s390/char/sclp_vt220.c
parent15e86b0c752d50e910b2cca6e83ce74c4440d06c (diff)
[S390] console flush on panic / reboot
The s390 console drivers use the unblank callback of the console structure to flush the console buffer. In case of a panic or a reboot the CPU doing the callback can block on the console i/o. The other CPUs in the system continue to work. For panic this is not a good idea. Replace the unblank callback with proper panic/reboot notifier. These get called after all but one CPU have been stopped. Signed-off-by: Holger Smolinski <Holger.Smolinski@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/sclp_vt220.c')
-rw-r--r--drivers/s390/char/sclp_vt220.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index ad51738c4261..9854f19f5e62 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -24,6 +24,8 @@
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/reboot.h>
28
27#include <asm/uaccess.h> 29#include <asm/uaccess.h>
28#include "sclp.h" 30#include "sclp.h"
29 31
@@ -743,24 +745,30 @@ sclp_vt220_con_device(struct console *c, int *index)
743 return sclp_vt220_driver; 745 return sclp_vt220_driver;
744} 746}
745 747
746/* 748static int
747 * This routine is called from panic when the kernel is going to give up. 749sclp_vt220_notify(struct notifier_block *self,
748 * We have to make sure that all buffers will be flushed to the SCLP. 750 unsigned long event, void *data)
749 * Note that this function may be called from within an interrupt context.
750 */
751static void
752sclp_vt220_con_unblank(void)
753{ 751{
754 __sclp_vt220_flush_buffer(); 752 __sclp_vt220_flush_buffer();
753 return NOTIFY_OK;
755} 754}
756 755
756static struct notifier_block on_panic_nb = {
757 .notifier_call = sclp_vt220_notify,
758 .priority = 1,
759};
760
761static struct notifier_block on_reboot_nb = {
762 .notifier_call = sclp_vt220_notify,
763 .priority = 1,
764};
765
757/* Structure needed to register with printk */ 766/* Structure needed to register with printk */
758static struct console sclp_vt220_console = 767static struct console sclp_vt220_console =
759{ 768{
760 .name = SCLP_VT220_CONSOLE_NAME, 769 .name = SCLP_VT220_CONSOLE_NAME,
761 .write = sclp_vt220_con_write, 770 .write = sclp_vt220_con_write,
762 .device = sclp_vt220_con_device, 771 .device = sclp_vt220_con_device,
763 .unblank = sclp_vt220_con_unblank,
764 .flags = CON_PRINTBUFFER, 772 .flags = CON_PRINTBUFFER,
765 .index = SCLP_VT220_CONSOLE_INDEX 773 .index = SCLP_VT220_CONSOLE_INDEX
766}; 774};
@@ -776,6 +784,8 @@ sclp_vt220_con_init(void)
776 if (rc) 784 if (rc)
777 return rc; 785 return rc;
778 /* Attach linux console */ 786 /* Attach linux console */
787 atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
788 register_reboot_notifier(&on_reboot_nb);
779 register_console(&sclp_vt220_console); 789 register_console(&sclp_vt220_console);
780 return 0; 790 return 0;
781} 791}