From fcfe8c7befffcd20336ddf18aaaa389aca9b8d54 Mon Sep 17 00:00:00 2001 From: Jon Benson Date: Sat, 4 Dec 2010 13:14:33 +1100 Subject: [PATCH] Revert "Try using whatever buffer we can get in smd_tty instead of sitting in an endless loop!" This reverts commit 6df8c16511a8f934e35556ae6cfb42753ed5b6fd. --- arch/arm/mach-msm/smd_tty.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-msm/smd_tty.c b/arch/arm/mach-msm/smd_tty.c index df027df2..1d1802a3 100644 --- a/arch/arm/mach-msm/smd_tty.c +++ b/arch/arm/mach-msm/smd_tty.c @@ -78,16 +78,19 @@ static void smd_tty_work_func(struct work_struct *work) ptr = NULL; avail = tty_prepare_flip_string(tty, &ptr, avail); - if (smd_read(info->ch, ptr, avail) != avail) { - /* shouldn't be possible since we're in interrupt - * context here and nobody else could 'steal' our - * characters. - */ - printk(KERN_ERR "OOPS - smd_tty_buffer mismatch?!"); - } - wake_lock_timeout(&info->wake_lock, HZ / 2); - tty->low_latency = 1; - tty_flip_buffer_push(tty); + if (avail && ptr) { + if (smd_read(info->ch, ptr, avail) != avail) { + /* shouldn't be possible since we're in interrupt + * context here and nobody else could 'steal' our + * characters. + */ + printk(KERN_ERR "OOPS - smd_tty_buffer mismatch?!"); + } + wake_lock_timeout(&info->wake_lock, HZ / 2); + tty->low_latency = 1; + tty_flip_buffer_push(tty); + } else + printk(KERN_ERR "smd_tty_work_func: tty_prepare_flip_string fail\n"); } mutex_unlock(&smd_tty_lock);