Re: [Regression] Bluetooth RFComm: using it locks up the machine

From: Mark Lord
Date: Sun Mar 04 2007 - 10:12:48 EST


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@xxxxxxxxxxxx>
| Sat, 17 Feb 2007 22:58:57 +0000 (23:58 +0100)
| committer David S. Miller <davem@xxxxxxxxxxxxxxxxxxxx>
| 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@xxxxxxxxxxxx>

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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/