]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/sclp_vt220.c
[S390] replace remaining __FUNCTION__ occurrences
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / sclp_vt220.c
index f47f4a768be5cf53019d259edaf544daa6230a1c..ed507594e62ba0adf12fde30a1ecd23a91509180 100644 (file)
@@ -202,7 +202,7 @@ sclp_vt220_callback(struct sclp_req *request, void *data)
 static int
 __sclp_vt220_emit(struct sclp_vt220_request *request)
 {
-       if (!(sclp_vt220_register.sclp_send_mask & EVTYP_VT220MSG_MASK)) {
+       if (!(sclp_vt220_register.sclp_receive_mask & EVTYP_VT220MSG_MASK)) {
                request->sclp_req.status = SCLP_REQ_FAILED;
                return -EIO;
        }
@@ -367,7 +367,7 @@ sclp_vt220_timeout(unsigned long data)
        sclp_vt220_emit_current();
 }
 
-#define BUFFER_MAX_DELAY       HZ/2
+#define BUFFER_MAX_DELAY       HZ/20
 
 /* 
  * Internal implementation of the write function. Write COUNT bytes of data
@@ -383,7 +383,7 @@ sclp_vt220_timeout(unsigned long data)
  */
 static int
 __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
-                  int convertlf)
+                  int convertlf, int may_schedule)
 {
        unsigned long flags;
        void *page;
@@ -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 */
                if (sclp_vt220_current_request == NULL) {
                        while (list_empty(&sclp_vt220_empty)) {
-                               spin_unlock_irqrestore(&sclp_vt220_lock,
-                                                      flags);
-                               if (in_atomic())
+                               spin_unlock_irqrestore(&sclp_vt220_lock, flags);
+                               if (in_interrupt() || !may_schedule)
                                        sclp_sync_wait();
                                else
                                        wait_event(sclp_vt220_waitq,
@@ -450,7 +449,7 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
 static int
 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
@@ -529,7 +528,7 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp)
 static void
 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);
 static void
 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 *