lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: WARNING: at drivers/tty/tty_ldisc.c:766 tty_ldisc_reinit+0x7d/0x90()
On 07/19/2011 09:43 PM, Vegard Nossum wrote:
> On 19 July 2011 19:53, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tuesday 19 July 2011 13:33:36 Vegard Nossum wrote:
>>> Any ideas?
>>
>> This is the WARN_ON that Jiri added in 92f6fa09b "TTY: ldisc, do not close
>> until there are readers".
>>
>> Is the login process that triggered this running on the USB device you pass
>> through, or do you have vga or serial console?
>
> I am using console=ttyS0 console=tty0, so I have both vga and serial
> console. The login process was running on the vga console.

Hi, hmm, originally wait_for_idle was there without checking the retval.
I added it back with checking the retval. I really wonder who is the
other user of the port. Or if there is a bug in refcounting somewhere.

Could you attach output of the kernel run with the patch attached?

thanks,
--
js
From 5c6bd3fe6d06b13511f366248052ec789c58b88c Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jslaby@suse.cz>
Date: Mon, 8 Aug 2011 16:00:59 +0200
Subject: [PATCH] TTY: tty_ldisc_wait_idle debug

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/tty/tty_ldisc.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 512c49f..0b90801 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -26,6 +26,7 @@
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/seq_file.h>
+#include <linux/ratelimit.h>

#include <linux/uaccess.h>
#include <asm/system.h>
@@ -758,11 +759,17 @@ static void tty_reset_termios(struct tty_struct *tty)
static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
{
struct tty_ldisc *ld = tty_ldisc_get(ldisc);
+ int ret;

if (IS_ERR(ld))
return -1;

- WARN_ON_ONCE(tty_ldisc_wait_idle(tty));
+ ret = tty_ldisc_wait_idle(tty);
+ if (ret)
+ printk_ratelimited(KERN_DEBUG "%s: refcount of %ps is still %d\n",
+ __func__,
+ tty->ldisc->ops,
+ atomic_read(&tty->ldisc->users));

tty_ldisc_close(tty, tty->ldisc);
tty_ldisc_put(tty->ldisc);
--
1.7.6
\
 
 \ /
  Last update: 2011-08-08 16:41    [from the cache]
©2003-2011 Jasper Spaans