[RAMEN9610-14864] [COMMON] wlbt: Release bt_write_wake_lock during BT shutdown
authorMathias Sass Michno <m.michno@samsung.com>
Wed, 1 May 2019 08:54:59 +0000 (10:54 +0200)
committerKim Gunho <gunho.kim@samsung.com>
Fri, 28 Jun 2019 14:44:44 +0000 (23:44 +0900)
Ensure that the bt_write_wake_lock is released during shutdown
in case the controller doesn't ack the last sent command.
(cherry-picked from http://12.36.155.91:81/#/c/423622/)

SCSC-Bug-Id: SSB-52228
Change-Id: Id44627f30fd8efc3392068922a21dbf281926649
Signed-off-by: Mathias Sass Michno <m.michno@samsung.com>
drivers/misc/samsung/scsc_bt/scsc_bt_module.c

index 9ae6982b17dbc1eba6edd229b20230fe2b610f9c..de7d4d376a390ac07222060b98bd2f44339d7bf8 100755 (executable)
@@ -419,6 +419,12 @@ static int slsi_sm_bt_service_cleanup(bool allow_service_stop)
 
        atomic_set(&bt_service.error_count, 0);
 
+       /* Release write wake lock if held */
+       if (wake_lock_active(&bt_service.write_wake_lock)) {
+               bt_service.write_wake_unlock_count++;
+               wake_unlock(&bt_service.write_wake_lock);
+       }
+
        SCSC_TAG_DEBUG(BT_COMMON, "complete\n");
        return 0;