Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 368046 Details for
Bug 474432
>=sys-kernel/gentoo-sources-3.8 - Ripup of bluetooth rfcomm causes oops/machine hang.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for inclusion 3/4
2452_connection-wait-on-RFCOMM-open.patch (text/plain), 2.76 KB, created by
Mike Pagano
on 2014-01-17 20:32:22 UTC
(
hide
)
Description:
Patch for inclusion 3/4
Filename:
MIME Type:
Creator:
Mike Pagano
Created:
2014-01-17 20:32:22 UTC
Size:
2.76 KB
patch
obsolete
>--- a/net/bluetooth/rfcomm/tty.c 2014-01-17 14:27:32.320268044 -0500 >+++ b/net/bluetooth/rfcomm/tty.c 2014-01-17 14:33:52.560269348 -0500 >@@ -58,6 +58,7 @@ struct rfcomm_dev { > uint modem_status; > > struct rfcomm_dlc *dlc; >+ wait_queue_head_t conn_wait; > > struct device *tty_dev; > >@@ -124,7 +125,41 @@ static int rfcomm_dev_activate(struct tt > { > struct rfcomm_dev *dev = container_of(port, struct rfcomm_dev, port); > >- return rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel); >+ DEFINE_WAIT(wait); >+ int err; >+ >+ err = rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel); >+ if (err) >+ return err; >+ >+ while (1) { >+ prepare_to_wait(&dev->conn_wait, &wait, TASK_INTERRUPTIBLE); >+ >+ if (dev->dlc->state == BT_CLOSED) { >+ err = -dev->err; >+ break; >+ } >+ >+ if (dev->dlc->state == BT_CONNECTED) >+ break; >+ >+ if (signal_pending(current)) { >+ err = -ERESTARTSYS; >+ break; >+ } >+ >+ tty_unlock(tty); >+ schedule(); >+ tty_lock(tty); >+ } >+ >+ finish_wait(&dev->conn_wait, &wait); >+ >+ if (!err) >+ device_move(dev->tty_dev, rfcomm_get_device(dev), >+ DPM_ORDER_DEV_AFTER_PARENT); >+ >+ return err; > } > > /* we block the open until the dlc->state becomes BT_CONNECTED */ >@@ -151,7 +186,6 @@ static const struct tty_port_operations > .destruct = rfcomm_dev_destruct, > .activate = rfcomm_dev_activate, > .shutdown = rfcomm_dev_shutdown, >- .carrier_raised = rfcomm_dev_carrier_raised, > }; > > static struct rfcomm_dev *__rfcomm_dev_get(int id) >@@ -258,6 +292,7 @@ static int rfcomm_dev_add(struct rfcomm_ > > tty_port_init(&dev->port); > dev->port.ops = &rfcomm_port_ops; >+ init_waitqueue_head(&dev->conn_wait); > > skb_queue_head_init(&dev->pending); > >@@ -576,12 +611,9 @@ static void rfcomm_dev_state_change(stru > BT_DBG("dlc %p dev %p err %d", dlc, dev, 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) >+ wake_up_interruptible(&dev->conn_wait); >+ >+ if (dlc->state == BT_CLOSED) > tty_port_tty_hangup(&dev->port, false); > } > >@@ -1104,7 +1136,7 @@ int __init rfcomm_init_ttys(void) > rfcomm_tty_driver->subtype = SERIAL_TYPE_NORMAL; > rfcomm_tty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; > rfcomm_tty_driver->init_termios = tty_std_termios; >- rfcomm_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL; >+ rfcomm_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; > rfcomm_tty_driver->init_termios.c_lflag &= ~ICANON; > tty_set_operations(rfcomm_tty_driver, &rfcomm_ops); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 474432
:
351696
|
366926
|
366928
|
368038
|
368044
| 368046 |
368048