public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Mark Lord <lkml@rtr.ca>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	bluez-devel@lists.sourceforge.net, marcel@holtmann.org,
	Andrew Morton <akpm@osdl.org>,
	"David S. Miller" <davem@sunset.davemloft.net>
Subject: Re: [Regression] Bluetooth RFComm:  using it locks up the machine
Date: Sun, 04 Mar 2007 10:12:22 -0500	[thread overview]
Message-ID: <45EAE1D6.10900@rtr.ca> (raw)
In-Reply-To: <45EADD78.1030300@rtr.ca>

Mark Lord wrote:
> Any attempt to open/use a bluetooth rfcomm device locks up
> scheduling completely on my machine.
> 
> Interrupts (ping, alt-sysrq) seem to be alive, but nothing else.
> 
> This was working fine in 2.6.20, broken now in 2.6.21-rc2-git*

Further info:  Reverting this change (below) fixes it:

| author	Marcel Holtmann <marcel@holtmann.org>
| 	 Sat, 17 Feb 2007 22:58:57 +0000 (23:58 +0100)
| committer	David S. Miller <davem@sunset.davemloft.net>
| 	 Mon, 26 Feb 2007 19:42:41 +0000 (11:42 -0800)
| commit	c1a3313698895d8ad4760f98642007bf236af2e8
| tree	337a876f727061362b6a169f8759849c105b8f7a	tree | snapshot
| parent	f5ffd4620aba9e55656483ae1ef5c79ba81f5403	commit | diff
| 
| [Bluetooth] Make use of device_move() for RFCOMM TTY devices
| 
| In the case of bound RFCOMM TTY devices the parent is not available
| before its usage. So when opening a RFCOMM TTY device, move it to
| the corresponding ACL device as a child. When closing the device,
| move it back to the virtual device tree.
| Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

Specifically, I reverted these changes, below, to fix it:

--- 2.6.20/net/bluetooth/rfcomm/tty.c	2007-02-04 13:44:54.000000000 -0500
+++ 2.6.21/net/bluetooth/rfcomm/tty.c	2007-03-02 15:06:32.000000000 -0500
@@ -74,6 +74,8 @@
 	wait_queue_head_t       wait;
 	struct tasklet_struct   wakeup_task;
 
+	struct device		*tty_dev;
+
 	atomic_t 		wmem_alloc;
 };
 
@@ -261,7 +263,7 @@
 		return err;
 	}
 
-	tty_register_device(rfcomm_tty_driver, dev->id, rfcomm_get_device(dev));
+	dev->tty_dev = tty_register_device(rfcomm_tty_driver, dev->id, NULL);
 
 	return dev->id;
 }
@@ -630,6 +632,9 @@
 	set_current_state(TASK_RUNNING);
 	remove_wait_queue(&dev->wait, &wait);
 
+	if (err == 0)
+		device_move(dev->tty_dev, rfcomm_get_device(dev));
+
 	return err;
 }
 
@@ -642,6 +647,8 @@
 	BT_DBG("tty %p dev %p dlc %p opened %d", tty, dev, dev->dlc, dev->opened);
 
 	if (--dev->opened == 0) {
+		device_move(dev->tty_dev, NULL);
+
 		/* Close DLC and dettach TTY */
 		rfcomm_dlc_close(dev->dlc, 0);
 

  reply	other threads:[~2007-03-04 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-04 14:53 [Regression] Bluetooth RFComm: using it locks up the machine Mark Lord
2007-03-04 15:12 ` Mark Lord [this message]
2007-03-04 17:33   ` Marcel Holtmann
2007-03-04 17:55   ` Mark Lord
2007-03-04 18:26     ` [PATCH] Fix 2.6.21 rfcomm lockups (2.6.21 regression) Mark Lord
2007-03-05 12:41       ` Cornelia Huck
2007-03-05 15:33       ` Jiri Kosina

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=45EAE1D6.10900@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=akpm@osdl.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=davem@sunset.davemloft.net \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox