All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 v1] Bluetooth: Fix ACL alive for long in case of non pariable devices
@ 2013-06-28 10:14 Syam Sidhardhan
  2013-06-28 16:23 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Syam Sidhardhan @ 2013-06-28 10:14 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan, Sang-Ki Park

For certain devices (ex: HID mouse), support for authentication,
pairing and bonding is optional. For such devices, the ACL alive
for too long after the l2cap disconnection.

To avoid keep ACL alive for too long, set the ACL timeout back to
HCI_DISCONN_TIMEOUT when l2cap is connected.

While merging the commit id:a9ea3ed9b71cc3271dd59e76f65748adcaa76422
this issue might have introduce.

Signed-off-by: Sang-Ki Park <sangki79.park@samsung.com>
Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
 net/bluetooth/l2cap_core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9af3a76..80df756 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1383,6 +1383,10 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
 
 	BT_DBG("conn %p", conn);
 
+	hci_conn_hold(conn->hcon);
+	conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
+	hci_conn_drop(conn->hcon);
+
 	/* For outgoing pairing which doesn't necessarily have an
 	 * associated socket (e.g. mgmt_pair_device).
 	 */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1 v1] Bluetooth: Fix ACL alive for long in case of non pariable devices
  2013-06-28 10:14 [PATCH 1/1 v1] Bluetooth: Fix ACL alive for long in case of non pariable devices Syam Sidhardhan
@ 2013-06-28 16:23 ` Marcel Holtmann
  2013-07-17 16:28   ` Syam Sidhardhan
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2013-06-28 16:23 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth, Sang-Ki Park

Hi Syam,

> For certain devices (ex: HID mouse), support for authentication,
> pairing and bonding is optional. For such devices, the ACL alive
> for too long after the l2cap disconnection.
> 
> To avoid keep ACL alive for too long, set the ACL timeout back to
> HCI_DISCONN_TIMEOUT when l2cap is connected.
> 
> While merging the commit id:a9ea3ed9b71cc3271dd59e76f65748adcaa76422
> this issue might have introduce.
> 
> Signed-off-by: Sang-Ki Park <sangki79.park@samsung.com>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
> net/bluetooth/l2cap_core.c |    4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 9af3a76..80df756 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1383,6 +1383,10 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
> 
> 	BT_DBG("conn %p", conn);
> 

might be a good idea to add a comment here on why we are resetting the disc_timeout back to the original value.

> +	hci_conn_hold(conn->hcon);
> +	conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
> +	hci_conn_drop(conn->hcon);
> +
> 	/* For outgoing pairing which doesn't necessarily have an
> 	 * associated socket (e.g. mgmt_pair_device).
> 	 */

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1 v1] Bluetooth: Fix ACL alive for long in case of non pariable devices
  2013-06-28 16:23 ` Marcel Holtmann
@ 2013-07-17 16:28   ` Syam Sidhardhan
  0 siblings, 0 replies; 3+ messages in thread
From: Syam Sidhardhan @ 2013-07-17 16:28 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Syam Sidhardhan, User Name, Sang-Ki Park

Hi,


On Fri, Jun 28, 2013 at 9:53 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Syam,
>
> > For certain devices (ex: HID mouse), support for authentication,
> > pairing and bonding is optional. For such devices, the ACL alive
> > for too long after the l2cap disconnection.
> >
> > To avoid keep ACL alive for too long, set the ACL timeout back to
> > HCI_DISCONN_TIMEOUT when l2cap is connected.
> >
> > While merging the commit id:a9ea3ed9b71cc3271dd59e76f65748adcaa76422
> > this issue might have introduce.
> >
> > Signed-off-by: Sang-Ki Park <sangki79.park@samsung.com>
> > Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> > ---
> > net/bluetooth/l2cap_core.c |    4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index 9af3a76..80df756 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -1383,6 +1383,10 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
> >
> >       BT_DBG("conn %p", conn);
> >
>
> might be a good idea to add a comment here on why we are resetting the disc_timeout back to the original value.
>

Ok, Now I'll send a patch with the comment added.

> > +     hci_conn_hold(conn->hcon);
> > +     conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
> > +     hci_conn_drop(conn->hcon);
> > +
> >       /* For outgoing pairing which doesn't necessarily have an
> >        * associated socket (e.g. mgmt_pair_device).
> >        */
>
Regards,
Syam

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-17 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 10:14 [PATCH 1/1 v1] Bluetooth: Fix ACL alive for long in case of non pariable devices Syam Sidhardhan
2013-06-28 16:23 ` Marcel Holtmann
2013-07-17 16:28   ` Syam Sidhardhan

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.