|
@@ -522,6 +522,8 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count
|
|
|
return -EIO;
|
|
|
|
|
|
while (count > 0) {
|
|
|
+ int ret = 0;
|
|
|
+
|
|
|
spin_lock_irqsave(&hp->lock, flags);
|
|
|
|
|
|
rsize = hp->outbuf_size - hp->n_outbuf;
|
|
@@ -537,10 +539,13 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count
|
|
|
}
|
|
|
|
|
|
if (hp->n_outbuf > 0)
|
|
|
- hvc_push(hp);
|
|
|
+ ret = hvc_push(hp);
|
|
|
|
|
|
spin_unlock_irqrestore(&hp->lock, flags);
|
|
|
|
|
|
+ if (!ret)
|
|
|
+ break;
|
|
|
+
|
|
|
if (count) {
|
|
|
if (hp->n_outbuf > 0)
|
|
|
hvc_flush(hp);
|