]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.67/brcmfmac-stop-watchdog-before-detach-and-free-everything.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.67 / brcmfmac-stop-watchdog-before-detach-and-free-everything.patch
1 From foo@baz Wed Aug 22 09:33:46 CEST 2018
2 From: Michael Trimarchi <michael@amarulasolutions.com>
3 Date: Wed, 30 May 2018 11:06:34 +0200
4 Subject: brcmfmac: stop watchdog before detach and free everything
5
6 From: Michael Trimarchi <michael@amarulasolutions.com>
7
8 [ Upstream commit 373c83a801f15b1e3d02d855fad89112bd4ccbe0 ]
9
10 Using built-in in kernel image without a firmware in filesystem
11 or in the kernel image can lead to a kernel NULL pointer deference.
12 Watchdog need to be stopped in brcmf_sdio_remove
13
14 The system is going down NOW!
15 [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8
16 Sent SIGTERM to all processes
17 [ 1348.121412] Mem abort info:
18 [ 1348.126962] ESR = 0x96000004
19 [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits
20 [ 1348.135948] SET = 0, FnV = 0
21 [ 1348.138997] EA = 0, S1PTW = 0
22 [ 1348.142154] Data abort info:
23 [ 1348.145045] ISV = 0, ISS = 0x00000004
24 [ 1348.148884] CM = 0, WnR = 0
25 [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____)
26 [ 1348.158475] [00000000000002f8] pgd=0000000000000000
27 [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP
28 [ 1348.168927] Modules linked in: ipv6
29 [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18
30 [ 1348.180757] Hardware name: Amarula A64-Relic (DT)
31 [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO)
32 [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20
33 [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290
34 [ 1348.200253] sp : ffff00000b85be30
35 [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000
36 [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638
37 [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800
38 [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660
39 [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00
40 [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001
41 [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8
42 [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400
43 [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001
44 [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10
45 [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870
46 [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55
47 [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000
48 [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100
49 [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000
50
51 Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
52 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
53 Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
54 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
55 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
56 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57 ---
58 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++
59 1 file changed, 7 insertions(+)
60
61 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
62 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
63 @@ -4245,6 +4245,13 @@ void brcmf_sdio_remove(struct brcmf_sdio
64 brcmf_dbg(TRACE, "Enter\n");
65
66 if (bus) {
67 + /* Stop watchdog task */
68 + if (bus->watchdog_tsk) {
69 + send_sig(SIGTERM, bus->watchdog_tsk, 1);
70 + kthread_stop(bus->watchdog_tsk);
71 + bus->watchdog_tsk = NULL;
72 + }
73 +
74 /* De-register interrupt handler */
75 brcmf_sdiod_intr_unregister(bus->sdiodev);
76