diff options
author | Holger Smolinski <Holger.Smolinski@de.ibm.com> | 2008-10-10 15:33:27 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-10-10 15:34:01 -0400 |
commit | 2332ce1a97963b7769e0c2d40492a10a124efba5 (patch) | |
tree | 38728f02d84d91c9ce6e4bb06e871cc19cbe57cd /drivers/s390/char/sclp_con.c | |
parent | 15e86b0c752d50e910b2cca6e83ce74c4440d06c (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_con.c')
-rw-r--r-- | drivers/s390/char/sclp_con.c | 24 |
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 | */ |
174 | static void | 175 | static void |
175 | sclp_console_unblank(void) | 176 | sclp_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 | ||
192 | static int | ||
193 | sclp_console_notify(struct notifier_block *self, | ||
194 | unsigned long event, void *data) | ||
195 | { | ||
196 | sclp_console_flush(); | ||
197 | return NOTIFY_OK; | ||
198 | } | ||
199 | |||
200 | static struct notifier_block on_panic_nb = { | ||
201 | .notifier_call = sclp_console_notify, | ||
202 | .priority = 1, | ||
203 | }; | ||
204 | |||
205 | static 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 | } |