All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: WARNING: at drivers/tty/tty_ldisc.c:766 tty_ldisc_reinit+0x7d/0x90()
Date: Mon, 08 Aug 2011 16:39:38 +0200	[thread overview]
Message-ID: <4E3FF52A.9040804@gmail.com> (raw)
In-Reply-To: <CAOMGZ=GrBLL+EgtG1ZGNquMVNxD=X01vd3sakr7ZKFEh9m7xPA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

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

[-- Attachment #2: 0001-TTY-tty_ldisc_wait_idle-debug.patch --]
[-- Type: text/x-patch, Size: 1218 bytes --]

>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


      reply	other threads:[~2011-08-08 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 11:33 WARNING: at drivers/tty/tty_ldisc.c:766 tty_ldisc_reinit+0x7d/0x90() Vegard Nossum
2011-07-19 17:53 ` Arnd Bergmann
2011-07-19 19:43   ` Vegard Nossum
2011-08-08 14:39     ` Jiri Slaby [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E3FF52A.9040804@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.