>From 4fe9f5edcd187fb29298b59698cb920f2baccc15 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 8 Aug 2011 16:00:59 +0200 Subject: [PATCH 1/1] TTY: tty_ldisc_wait_idle debug Signed-off-by: Jiri Slaby --- 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 #include #include +#include #include #include @@ -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.1