All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Gianluca Anzolin <gianluca@sottospazio.it>
Cc: gustavo@padovan.org, marcel@holtmann.org,
	linux-bluetooth@vger.kernel.org, gregkh@linuxfoundation.org,
	jslaby@suse.cz
Subject: Re: [PATCH v4 0/6] rfcomm: Implement rfcomm as a proper tty_port
Date: Fri, 26 Jul 2013 15:56:25 -0400	[thread overview]
Message-ID: <51F2D469.2020401@hurleysoftware.com> (raw)
In-Reply-To: <1374859138-19467-1-git-send-email-gianluca@sottospazio.it>

On 07/26/2013 01:18 PM, Gianluca Anzolin wrote:
> This patchset addresses an issue with the rfcomm tty driver in the
> current stable kernels that manifests itself as a sudden lockup of the
> whole machine or as a OOPS if we are lucky enough (I wasn't).
>
> Triggering the problem is very easy:
>
> 1) establish a bluetooth connection with a bluetooth host
> 2) open the tty it provides with some program
> 3) turn off the bluetooth host or take it out of range
>
> After a timeout the machine freezes.
>
> Another way to trigger these lockups is to simply release the rfcomm
> tty.
>
> This happens because the underlying tty_struct objects and tty_port
> objects are freed while being used: the code doesn't take references
> properly.
>
> The following patches address the problem by implementing a proper
> tty_port driver for rfcomm.
>
> There are still some issues left: one relevant to flow control (which is
> also missing in the current code) and another relevant to a corner case
> in rfcomm_dev_state_change() that I intend to fix with a future patch.
> They are commented with a FIXME.
>
> Thank you,
> Gianluca

Gianluca,

Looks good, nice job :)  [ Thanks for the cover letter. ]

I tested device disconnect with i/o both in-progress and while idle.
I also tested remote disconnect and local device release.
Teardown was clean and complete with all tests.

[ Sorry that it took me a little while. I first had to review the
tools/rfcomm.c code to figure out the parameters expected! since
there were no examples on the man page. Then I had to disable the
pnat plugin because the error path when it's not installed closes
the wrong file! ]

I have a minor comment on 4/6 regarding one of the debug printks.
Other than that;

Reviewed-and-Tested-by: Peter Hurley <peter@hurleysoftware.com>

If Gustavo has you change stuff, please note changes in the cover
letter and in the patch itself below your sign-off line [example below],
so that I can follow along without re-reviewing the entire patch.

Regards,
Peter Hurley

--- >% ----
Implement .activate, .shutdown and .carrier_raised methods of tty_port
to manage the dlc, moving the code from rfcomm_tty_install() and
rfcomm_tty_cleanup() functions.

At the same time the tty .open()/.close() and .hangup() methods are
changed to use the tty_port helpers that properly call the
aforementioned tty_port methods.

Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
---

  v5 - Fixed debug message in rfcomm_tty_activate()

  net/bluetooth/rfcomm/tty.c | 117 ++++++++++++++++++---------------------------
  1 file changed, 47 insertions(+), 70 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
.....

      parent reply	other threads:[~2013-07-26 19:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 17:18 [PATCH v4 0/6] rfcomm: Implement rfcomm as a proper tty_port Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 1/6] rfcomm: Take proper tty_struct references Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 2/6] rfcomm: Remove the device from the list in the destructor Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 3/6] rfcomm: Move the tty initialization and cleanup out of open/close Gianluca Anzolin
2013-07-26 20:04   ` Peter Hurley
2013-07-26 17:18 ` [PATCH v4 4/6] rfcomm: Implement .activate, .shutdown and .carrier_raised methods Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 5/6] rfcomm: Fix the reference counting of tty_port Gianluca Anzolin
2013-07-27  0:20   ` Peter Hurley
2013-07-27  4:48     ` Gianluca Anzolin
2013-07-27 12:07       ` Peter Hurley
2013-07-26 17:18 ` [PATCH v4 6/6] rfcomm: Purge the dlc->tx_queue to avoid circular dependency Gianluca Anzolin
2013-07-26 19:56 ` Peter Hurley [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=51F2D469.2020401@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=gianluca@sottospazio.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@padovan.org \
    --cc=jslaby@suse.cz \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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 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.