aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:46:02 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:46:58 -0400
commitd1e23375bf5d1079cd54a1c6bc8592c42061f1e1 (patch)
tree771cd2fbf57d68e0a612eb095ae5486901a6ee5f /drivers/s390/char
parent8284fb19efa1f11ea8dd213e9e227fc1fcb20586 (diff)
[S390] sclp: Get rid of in_atomic() use.
Reintroduces in_interrupt() check in sclp_tty code. Add may_schedule parameter to vt220 write function, so we can let the write function know if it may schedule or not. So we disallow scheduling for all console calls and may allow them for tty calls. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/sclp_tty.c2
-rw-r--r--drivers/s390/char/sclp_vt220.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 2e616e33891d..e3b3d390b4a3 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -332,7 +332,7 @@ sclp_tty_write_string(const unsigned char *str, int count)
332 if (sclp_ttybuf == NULL) { 332 if (sclp_ttybuf == NULL) {
333 while (list_empty(&sclp_tty_pages)) { 333 while (list_empty(&sclp_tty_pages)) {
334 spin_unlock_irqrestore(&sclp_tty_lock, flags); 334 spin_unlock_irqrestore(&sclp_tty_lock, flags);
335 if (in_atomic()) 335 if (in_interrupt())
336 sclp_sync_wait(); 336 sclp_sync_wait();
337 else 337 else
338 wait_event(sclp_tty_waitq, 338 wait_event(sclp_tty_waitq,
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index f7b258dfd52c..ed507594e62b 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -383,7 +383,7 @@ sclp_vt220_timeout(unsigned long data)
383 */ 383 */
384static int 384static int
385__sclp_vt220_write(const unsigned char *buf, int count, int do_schedule, 385__sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
386 int convertlf) 386 int convertlf, int may_schedule)
387{ 387{
388 unsigned long flags; 388 unsigned long flags;
389 void *page; 389 void *page;
@@ -398,9 +398,8 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
398 /* Create a sclp output buffer if none exists yet */ 398 /* Create a sclp output buffer if none exists yet */
399 if (sclp_vt220_current_request == NULL) { 399 if (sclp_vt220_current_request == NULL) {
400 while (list_empty(&sclp_vt220_empty)) { 400 while (list_empty(&sclp_vt220_empty)) {
401 spin_unlock_irqrestore(&sclp_vt220_lock, 401 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
402 flags); 402 if (in_interrupt() || !may_schedule)
403 if (in_atomic())
404 sclp_sync_wait(); 403 sclp_sync_wait();
405 else 404 else
406 wait_event(sclp_vt220_waitq, 405 wait_event(sclp_vt220_waitq,
@@ -450,7 +449,7 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
450static int 449static int
451sclp_vt220_write(struct tty_struct *tty, const unsigned char *buf, int count) 450sclp_vt220_write(struct tty_struct *tty, const unsigned char *buf, int count)
452{ 451{
453 return __sclp_vt220_write(buf, count, 1, 0); 452 return __sclp_vt220_write(buf, count, 1, 0, 1);
454} 453}
455 454
456#define SCLP_VT220_SESSION_ENDED 0x01 455#define SCLP_VT220_SESSION_ENDED 0x01
@@ -529,7 +528,7 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp)
529static void 528static void
530sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch) 529sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
531{ 530{
532 __sclp_vt220_write(&ch, 1, 0, 0); 531 __sclp_vt220_write(&ch, 1, 0, 0, 1);
533} 532}
534 533
535/* 534/*
@@ -746,7 +745,7 @@ __initcall(sclp_vt220_tty_init);
746static void 745static void
747sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count) 746sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count)
748{ 747{
749 __sclp_vt220_write((const unsigned char *) buf, count, 1, 1); 748 __sclp_vt220_write((const unsigned char *) buf, count, 1, 1, 0);
750} 749}
751 750
752static struct tty_driver * 751static struct tty_driver *