BT: Fix for infinite wait in ssr cleanup after enable timeout

This change is for devices based on msm8998 hardware only. This
only impacts standalone VR devices based o that are using oc-dev:
this commit is already merged in master.

Original author: Gurpreet Ghai <gghai@codeaurora.org>

Problem: Once enable timeout occurs because of no response
from controller while creating socket connection with it,
ssr cleanup is initiated by Adapter Service after timeout
for recovery. Once this scenario occurs, process gets stuck
infinitely with ssr cleanup function waiting for mutex.

Cause: The mutex requested by ssr cleanup function is held
by the vendor thread which is stuck while opening socket.
Since ssr cleanup is initialized as a result of freeze in
vendor thread and requires same lock being held by vendor
thread results in creation of linear deadlock.

Fix: Made changes to ensure resources required by ssr
cleanup operation is not held by blocking calls in vendor
library

Change-Id: I2e08c9e56872c137ca37995fb04121af1a1f7097
CRs-Fixed: 1106530
Bug: 38055350
Test: BT functions normally. BT continues to function after a
      timeout.
4 files changed
tree: a94c5c79c26959f0c7402fe275bbe83832bbcf01
  1. libbt-vendor/
  2. msm8909/
  3. msm8960/
  4. msm8992/
  5. msm8996/
  6. msm8998/
  7. Android.mk