From: Gianluca Anzolin <gianluca@sottospazio.it>
To: Benson Chow <blc+bluez@mail.vanade.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [REGRESSION] rfcomm (userland) broken by commit 29cd718b
Date: Sat, 28 Dec 2013 09:44:21 +0100 [thread overview]
Message-ID: <20131228084421.GA27196@sottospazio.it> (raw)
In-Reply-To: <alpine.LNX.2.00.1312271536480.28992@doujima.vanade.com>
[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]
On Fri, Dec 27, 2013 at 04:01:27PM -0700, Benson Chow wrote:
> First off, thanks for the fix to stop rfcomm from taking down the
> machine. However, I have noted that blueman and
> networkmanager/modemmanager no longer recognize the /dev/rfcomm0
> device as a valid dialup device. This seems to be a
> kernel-userspace interface regression as I can boot into 3.6.11 and
> it would work just fine.
>
> When I saw this thread, I agree there appears to be some
> kernel-userspace changes that broke something, but the recent patch
> still did not seem to let modemmanger detect the bluetooth device as
> it did pre linux-3.12.
>
> Blueman reports "connection failed: modem manager did not support
> the connection" implying there's still some userspace differences
> from the old behavior.
>
> I do notice I can run a terminal emulator on /dev/rfcomm0 and able
> to run modem AT-commands which means that I can communicate with the
> phone through bluetooth, so that part is working. Plus, tearing up
> that connection no longer results in a crash like before linux-3.8.
>
> Any other information I could get from my system to help debug
> what's going on here? Or perhaps modem-manager will need to be
> updated to work with the new behavior?
>
> Thanks,
> -Benson
Thank you for the report.
Could you try the attached patch on top of the last rfc3.patch and see if it
works?
Regards,
Gianluca
[-- Attachment #2: modman.patch --]
[-- Type: text/x-diff, Size: 1558 bytes --]
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 0357dcf..90c1872 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -124,9 +124,6 @@ static void rfcomm_dev_shutdown(struct tty_port *port)
{
struct rfcomm_dev *dev = container_of(port, struct rfcomm_dev, port);
- if (dev->tty_dev->parent)
- device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST);
-
/* close the dlc */
rfcomm_dlc_close(dev->dlc, 0);
}
@@ -577,9 +574,6 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
dev->err = err;
if (dlc->state == BT_CONNECTED) {
- device_move(dev->tty_dev, rfcomm_get_device(dev),
- DPM_ORDER_DEV_AFTER_PARENT);
-
wake_up_interruptible(&dev->port.open_wait);
} else if (dlc->state == BT_CLOSED)
tty_port_tty_hangup(&dev->port, false);
@@ -632,6 +626,9 @@ static void rfcomm_tty_cleanup(struct tty_struct *tty)
{
struct rfcomm_dev *dev = tty->driver_data;
+ if (dev->tty_dev->parent)
+ device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST);
+
clear_bit(RFCOMM_TTY_ATTACHED, &dev->flags);
rfcomm_dlc_lock(dev->dlc);
@@ -674,6 +671,9 @@ static int rfcomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
if (err)
rfcomm_tty_cleanup(tty);
+ device_move(dev->tty_dev, rfcomm_get_device(dev),
+ DPM_ORDER_DEV_AFTER_PARENT);
+
/* take over the tty_port reference if it was created with the
* flag RFCOMM_RELEASE_ONHUP. This will force the release of the port
* when the last process closes the tty. This behaviour is expected by
next prev parent reply other threads:[~2013-12-28 8:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 16:28 [PATCH] rfcomm: don't release the port in rfcomm_dev_state_change() Gianluca Anzolin
2013-09-18 1:19 ` Peter Hurley
2013-09-19 16:24 ` Gustavo Padovan
2013-12-12 20:11 ` [REGRESSION] rfcomm (userland) broken by commit 29cd718b Alexander Holler
2013-12-12 20:36 ` Peter Hurley
2013-12-12 23:35 ` Alexander Holler
2013-12-15 11:24 ` Gianluca Anzolin
2013-12-15 14:03 ` Peter Hurley
2013-12-15 15:08 ` Gianluca Anzolin
2013-12-15 17:54 ` Alexander Holler
2013-12-16 19:34 ` Peter Hurley
2013-12-16 20:20 ` Gianluca Anzolin
2013-12-16 20:27 ` Gianluca Anzolin
2013-12-16 20:58 ` Gianluca Anzolin
2013-12-16 21:15 ` Gianluca Anzolin
2013-12-24 13:21 ` Alexander Holler
2013-12-27 23:01 ` Benson Chow
2013-12-28 8:44 ` Gianluca Anzolin [this message]
2014-01-04 4:32 ` Benson Chow
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=20131228084421.GA27196@sottospazio.it \
--to=gianluca@sottospazio.it \
--cc=blc+bluez@mail.vanade.com \
--cc=linux-bluetooth@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;
as well as URLs for NNTP newsgroup(s).