Re: [Bluez-devel] bug report: trouble reconnecting keyboard after timeout

Marcel Holtmann
2008-05-15T14:15:04Z

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

Hi Dick,

> I upgraded bluez-utils and bluez-libs (3.31) and it didn't help.
>
> I've attached a logfile, I hope it's sufficient.
>
> My mouse and keyboard couldn't connect, I've reconnected them by
> manually disconnecting them in bluetooth-applet.

if I am not mistaken, then the attached kernel patch will fix this
issue.

Regards

Marcel

[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 918 bytes --]

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 519cdb9..96434d7 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -581,6 +581,12 @@ static int hidp_session(void *arg)
hid_free_device(session->hid);
}

+ /* Wakeup user-space polling for socket errors */
+ session->intr_sock->sk->sk_err = EUNATCH;
+ session->ctrl_sock->sk->sk_err = EUNATCH;
+
+ hidp_schedule(session);
+
fput(session->intr_sock->file);

wait_event_timeout(*(ctrl_sk->sk_sleep),
@@ -879,6 +885,10 @@ int hidp_del_connection(struct hidp_conndel_req *req)
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);

+ /* Wakeup user-space polling for socket errors */
+ session->intr_sock->sk->sk_err = EUNATCH;
+ session->ctrl_sock->sk->sk_err = EUNATCH;
+
/* Kill session thread */
atomic_inc(&session->terminate);
hidp_schedule(session);

[-- Attachment #3: Type: text/plain, Size: 230 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]