]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: use wait_event API instead of open-coding it
authorJohn Keeping <john@metanate.com>
Thu, 19 Apr 2018 15:29:37 +0000 (16:29 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 18 May 2018 04:37:51 +0000 (06:37 +0200)
commit35f979bb45b5e53c5ea2eeffeb3ebeec8f9f849d
tree5e9713807bf76fcc72ff48be5144f81edab6b365
parent54a7121e489c26ba6e894b822e2467b3021083cc
Bluetooth: use wait_event API instead of open-coding it

I've seen timeout errors from HCI commands where it looks like
schedule_timeout() has returned immediately; additional logging for the
error case gives:

req_status=1 req_result=0 remaining=10000 jiffies

so the device is still in state HCI_REQ_PEND and the value returned by
schedule_timeout() is the same as the original timeout (HCI_INIT_TIMEOUT
on a system with HZ=1000).

Use wait_event_interruptible_timeout() instead of open-coding similar
behaviour which is subject to the spurious failure described above.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_request.c