From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dirkjan Bussink <dirkjan.bussink@nedap.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tty: Prevent deadlock in n_gsm driver
Date: Wed, 30 Jan 2013 11:10:58 +0100 [thread overview]
Message-ID: <20130130101058.GA9532@kroah.com> (raw)
In-Reply-To: <0E76C0E9-AC46-42C0-BF43-12DAF0DCE313@nedap.com>
On Wed, Jan 30, 2013 at 10:51:59AM +0100, Dirkjan Bussink wrote:
> This change fixes a deadlock when the multiplexer is closed while there
> are still client side ports open.
>
> When the multiplexer is closed and there are active tty's it tries to
> close them with tty_vhangup. This has a problem though, because
> tty_vhangup needs the tty_lock. This patch changes it to unlock the
> tty_lock before attempting the hangup and relocks afterwards. The
> additional call to tty_port_tty_set is needed because otherwise the
> port stays active because of the reference counter.
>
> This change also exposed another problem that other code paths don't
> expect that the multiplexer could have been closed. This patch also adds
> checks for these cases in the gsmtty_ class of function that could be
> called.
>
> The documentation explicitly states that "first close all virtual ports
> before closing the physical port" but we've found this to not always
> reality in our field situations. The GPRS / UTMS modem sometimes crashes
> and needs a power cycle in that case which means cleanly shutting down
> everything is not always possible. This change makes it much more robust
> for our situation where at least the system is recoverable with this patch
> and doesn't hang in a deadlock situation inside the kernel.
>
> The patch is against the long term support kernel (3.4.27) and should
> apply cleanly to more recent branches. Tested with a Telit GE864-QUADV2
> and Telit HE910 modem.
>
> Signed-off-by: Dirkjan Bussink <dirkjan.bussink@nedap.com>
> Cc: stable <stable@vger.kernel.org>
This patch breaks the build in the tty-next tree:
drivers/tty/n_gsm.c: In function ‘gsm_dlci_release’:
drivers/tty/n_gsm.c:1713:3: error: too few arguments to function ‘tty_unlock’
In file included from drivers/tty/n_gsm.c:44:0:
include/linux/tty.h:596:24: note: declared here
drivers/tty/n_gsm.c:1715:3: error: too few arguments to function ‘tty_lock’
In file included from drivers/tty/n_gsm.c:44:0:
include/linux/tty.h:595:24: note: declared here
Can you fix this up (get it to build on the linux-next tree) and resend
it?
thanks,
greg k-h
next prev parent reply other threads:[~2013-01-30 10:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 8:49 [PATCH] Prevent deadlock in n_gsm driver Dirkjan Bussink
2013-01-30 5:12 ` [PATCH] tty: " Greg Kroah-Hartman
2013-01-30 9:51 ` Dirkjan Bussink
2013-01-30 10:10 ` Greg Kroah-Hartman [this message]
2013-01-30 10:46 ` Dirkjan Bussink
2013-01-30 9:55 ` Dirkjan Bussink
2013-01-30 10:06 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2013-01-30 10:44 Dirkjan Bussink
2013-03-02 19:07 Ben Hutchings
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=20130130101058.GA9532@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dirkjan.bussink@nedap.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox