]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.60/bluetooth-hci_qca-fix-sleep-inside-atomic-section-warning.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / bluetooth-hci_qca-fix-sleep-inside-atomic-section-warning.patch
1 From foo@baz Sat Jul 28 10:25:26 CEST 2018
2 From: Thierry Escande <thierry.escande@linaro.org>
3 Date: Tue, 29 May 2018 18:37:16 +0200
4 Subject: Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning
5
6 From: Thierry Escande <thierry.escande@linaro.org>
7
8 [ Upstream commit 9960521c44a5d828f29636ceac0600603ecbddbf ]
9
10 This patch fixes the following warning during boot:
11
12 do not call blocking ops when !TASK_RUNNING; state=1 set at
13 [<(ptrval)>] qca_setup+0x194/0x750 [hci_uart]
14 WARNING: CPU: 2 PID: 1878 at kernel/sched/core.c:6135
15 __might_sleep+0x7c/0x88
16
17 In qca_set_baudrate(), the current task state is set to
18 TASK_UNINTERRUPTIBLE before going to sleep for 300ms. It was then
19 restored to TASK_INTERRUPTIBLE. This patch sets the current task state
20 back to TASK_RUNNING instead.
21
22 Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
23 Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
24 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 ---
27 drivers/bluetooth/hci_qca.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30 --- a/drivers/bluetooth/hci_qca.c
31 +++ b/drivers/bluetooth/hci_qca.c
32 @@ -881,7 +881,7 @@ static int qca_set_baudrate(struct hci_d
33 */
34 set_current_state(TASK_UNINTERRUPTIBLE);
35 schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS));
36 - set_current_state(TASK_INTERRUPTIBLE);
37 + set_current_state(TASK_RUNNING);
38
39 return 0;
40 }