From: Johan Hedberg Date: Tue, 21 Dec 2010 21:01:27 +0000 (+0200) Subject: Bluetooth: Fix __hci_request synchronization for hci_open_dev X-Git-Tag: v2.6.38-rc1~476^2~14^2~3^2~43^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23bb57633df97ede067ea26f3cdc8a7ba2cd8109;p=pandora-kernel.git Bluetooth: Fix __hci_request synchronization for hci_open_dev The initialization function used by hci_open_dev (hci_init_req) sends many different HCI commands. The __hci_request function should only return when all of these commands have completed (or a timeout occurs). Several of these commands cause hci_req_complete to be called which causes __hci_request to return prematurely. This patch fixes the issue by adding a new hdev->req_last_cmd variable which is set during the initialization procedure. The hci_req_complete function will no longer mark the request as complete until the command matching hdev->req_last_cmd completes. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann Signed-off-by: Gustavo F. Padovan --- Reading git-diff-tree failed