Commit d1e23375 authored by Heiko Carstens's avatar Heiko Carstens

[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: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 8284fb19
...@@ -332,7 +332,7 @@ sclp_tty_write_string(const unsigned char *str, int count) ...@@ -332,7 +332,7 @@ sclp_tty_write_string(const unsigned char *str, int count)
if (sclp_ttybuf == NULL) { if (sclp_ttybuf == NULL) {
while (list_empty(&sclp_tty_pages)) { while (list_empty(&sclp_tty_pages)) {
spin_unlock_irqrestore(&sclp_tty_lock, flags); spin_unlock_irqrestore(&sclp_tty_lock, flags);
if (in_atomic()) if (in_interrupt())
sclp_sync_wait(); sclp_sync_wait();
else else
wait_event(sclp_tty_waitq, wait_event(sclp_tty_waitq,
......
...@@ -383,7 +383,7 @@ sclp_vt220_timeout(unsigned long data) ...@@ -383,7 +383,7 @@ sclp_vt220_timeout(unsigned long data)
*/ */
static int static int
__sclp_vt220_write(const unsigned char *buf, int count, int do_schedule, __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
int convertlf) int convertlf, int may_schedule)
{ {
unsigned long flags; unsigned long flags;
void *page; void *page;
...@@ -398,9 +398,8 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule, ...@@ -398,9 +398,8 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
/* Create a sclp output buffer if none exists yet */ /* Create a sclp output buffer if none exists yet */
if (sclp_vt220_current_request == NULL) { if (sclp_vt220_current_request == NULL) {
while (list_empty(&sclp_vt220_empty)) { while (list_empty(&sclp_vt220_empty)) {
spin_unlock_irqrestore(&sclp_vt220_lock, spin_unlock_irqrestore(&sclp_vt220_lock, flags);
flags); if (in_interrupt() || !may_schedule)
if (in_atomic())
sclp_sync_wait(); sclp_sync_wait();
else else
wait_event(sclp_vt220_waitq, wait_event(sclp_vt220_waitq,
...@@ -450,7 +449,7 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule, ...@@ -450,7 +449,7 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
static int static int
sclp_vt220_write(struct tty_struct *tty, const unsigned char *buf, int count) sclp_vt220_write(struct tty_struct *tty, const unsigned char *buf, int count)
{ {
return __sclp_vt220_write(buf, count, 1, 0); return __sclp_vt220_write(buf, count, 1, 0, 1);
} }
#define SCLP_VT220_SESSION_ENDED 0x01 #define SCLP_VT220_SESSION_ENDED 0x01
...@@ -529,7 +528,7 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp) ...@@ -529,7 +528,7 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp)
static void static void
sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch) sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
{ {
__sclp_vt220_write(&ch, 1, 0, 0); __sclp_vt220_write(&ch, 1, 0, 0, 1);
} }
/* /*
...@@ -746,7 +745,7 @@ __initcall(sclp_vt220_tty_init); ...@@ -746,7 +745,7 @@ __initcall(sclp_vt220_tty_init);
static void static void
sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count) sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count)
{ {
__sclp_vt220_write((const unsigned char *) buf, count, 1, 1); __sclp_vt220_write((const unsigned char *) buf, count, 1, 1, 0);
} }
static struct tty_driver * static struct tty_driver *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment