* [PATCH] brcmfmac: stop watchdog before detach and free everything @ 2018-05-28 7:50 Michael Trimarchi 2018-05-28 9:51 ` Arend van Spriel 2018-05-29 9:25 ` Arend van Spriel 0 siblings, 2 replies; 15+ messages in thread From: Michael Trimarchi @ 2018-05-28 7:50 UTC (permalink / raw) Cc: michael, Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel Watchdog need to be stopped in brcmf_sdio_remove to avoid i The system is going down NOW! [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 Sent SIGTERM to all processes [ 1348.121412] Mem abort info: [ 1348.126962] ESR = 0x96000004 [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits [ 1348.135948] SET = 0, FnV = 0 [ 1348.138997] EA = 0, S1PTW = 0 [ 1348.142154] Data abort info: [ 1348.145045] ISV = 0, ISS = 0x00000004 [ 1348.148884] CM = 0, WnR = 0 [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) [ 1348.158475] [00000000000002f8] pgd=0000000000000000 [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 1348.168927] Modules linked in: ipv6 [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 [ 1348.180757] Hardware name: Amarula A64-Relic (DT) [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 [ 1348.200253] sp : ffff00000b85be30 [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 412a05b..061f69d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4294,6 +4294,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) brcmf_dbg(TRACE, "Enter\n"); if (bus) { + /* Stop watchdog task */ + if (bus->watchdog_tsk) { + send_sig(SIGTERM, bus->watchdog_tsk, 1); + kthread_stop(bus->watchdog_tsk); + bus->watchdog_tsk = NULL; + } + /* De-register interrupt handler */ brcmf_sdiod_intr_unregister(bus->sdiodev); -- 2.7.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 7:50 [PATCH] brcmfmac: stop watchdog before detach and free everything Michael Trimarchi @ 2018-05-28 9:51 ` Arend van Spriel 2018-05-28 9:54 ` Michael Nazzareno Trimarchi 2018-05-29 9:25 ` Arend van Spriel 1 sibling, 1 reply; 15+ messages in thread From: Arend van Spriel @ 2018-05-28 9:51 UTC (permalink / raw) To: Michael Trimarchi Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel On 5/28/2018 9:50 AM, Michael Trimarchi wrote: > Watchdog need to be stopped in brcmf_sdio_remove to avoid > i > The system is going down NOW! > [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 > Sent SIGTERM to all processes > [ 1348.121412] Mem abort info: > [ 1348.126962] ESR = 0x96000004 > [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits > [ 1348.135948] SET = 0, FnV = 0 > [ 1348.138997] EA = 0, S1PTW = 0 > [ 1348.142154] Data abort info: > [ 1348.145045] ISV = 0, ISS = 0x00000004 > [ 1348.148884] CM = 0, WnR = 0 > [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) > [ 1348.158475] [00000000000002f8] pgd=0000000000000000 > [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP > [ 1348.168927] Modules linked in: ipv6 > [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 > [ 1348.180757] Hardware name: Amarula A64-Relic (DT) > [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 > [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 Hi Michael, Thanks for the patch. In normal scenario the callstack looks like this: brcmf_sdio_remove() -> brcmf_detach() -> brcmf_bus_stop() -> brcmf_sdio_bus_stop() In brcmf_sdio_bus_stop() the watchdog is terminated. So in what scenario did you encounter this null pointer deref? Regards, Arend ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 9:51 ` Arend van Spriel @ 2018-05-28 9:54 ` Michael Nazzareno Trimarchi 2018-05-28 15:25 ` Andy Shevchenko 0 siblings, 1 reply; 15+ messages in thread From: Michael Nazzareno Trimarchi @ 2018-05-28 9:54 UTC (permalink / raw) To: Arend van Spriel Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, LKML Hi Arend On Mon, May 28, 2018 at 11:51 AM, Arend van Spriel <arend.vanspriel@broadcom.com> wrote: > On 5/28/2018 9:50 AM, Michael Trimarchi wrote: >> >> Watchdog need to be stopped in brcmf_sdio_remove to avoid >> i >> The system is going down NOW! >> [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual >> address 000002f8 >> Sent SIGTERM to all processes >> [ 1348.121412] Mem abort info: >> [ 1348.126962] ESR = 0x96000004 >> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >> [ 1348.135948] SET = 0, FnV = 0 >> [ 1348.138997] EA = 0, S1PTW = 0 >> [ 1348.142154] Data abort info: >> [ 1348.145045] ISV = 0, ISS = 0x00000004 >> [ 1348.148884] CM = 0, WnR = 0 >> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >> [ 1348.168927] Modules linked in: ipv6 >> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >> 4.17.0-rc5-next-20180517 #18 >> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 > > > Hi Michael, > > Thanks for the patch. In normal scenario the callstack looks like this: > > brcmf_sdio_remove() > -> brcmf_detach() > -> brcmf_bus_stop() > -> brcmf_sdio_bus_stop() > > In brcmf_sdio_bus_stop() the watchdog is terminated. So in what scenario did > you encounter this null pointer deref? Is this happen even when there is not wifi firmware? boot without any firmware in the filesystem and then trigger a reboot Michael > > Regards, > Arend -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com | ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 9:54 ` Michael Nazzareno Trimarchi @ 2018-05-28 15:25 ` Andy Shevchenko 2018-05-28 15:29 ` Michael Nazzareno Trimarchi 0 siblings, 1 reply; 15+ messages in thread From: Andy Shevchenko @ 2018-05-28 15:25 UTC (permalink / raw) To: Michael Nazzareno Trimarchi Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, LKML On Mon, May 28, 2018 at 12:54 PM, Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > Hi Arend > > On Mon, May 28, 2018 at 11:51 AM, Arend van Spriel > <arend.vanspriel@broadcom.com> wrote: >> On 5/28/2018 9:50 AM, Michael Trimarchi wrote: >>> >>> Watchdog need to be stopped in brcmf_sdio_remove to avoid >>> i >>> The system is going down NOW! >>> [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual >>> address 000002f8 >>> Sent SIGTERM to all processes >>> [ 1348.121412] Mem abort info: >>> [ 1348.126962] ESR = 0x96000004 >>> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >>> [ 1348.135948] SET = 0, FnV = 0 >>> [ 1348.138997] EA = 0, S1PTW = 0 >>> [ 1348.142154] Data abort info: >>> [ 1348.145045] ISV = 0, ISS = 0x00000004 >>> [ 1348.148884] CM = 0, WnR = 0 >>> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >>> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >>> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >>> [ 1348.168927] Modules linked in: ipv6 >>> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >>> 4.17.0-rc5-next-20180517 #18 >>> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >>> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >>> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >>> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >> >> >> Hi Michael, >> >> Thanks for the patch. In normal scenario the callstack looks like this: >> >> brcmf_sdio_remove() >> -> brcmf_detach() >> -> brcmf_bus_stop() >> -> brcmf_sdio_bus_stop() >> >> In brcmf_sdio_bus_stop() the watchdog is terminated. So in what scenario did >> you encounter this null pointer deref? > > Is this happen even when there is not wifi firmware? > boot without any firmware in the filesystem and then trigger a reboot Something like the above I had noticed for a long (couple of kernel releases?) time, but wasn't a big priority to me. Though, I can test this on my side. P.S. I think rmmod or echo > unbind will trigger that as well. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 15:25 ` Andy Shevchenko @ 2018-05-28 15:29 ` Michael Nazzareno Trimarchi 2018-05-28 15:33 ` Michael Nazzareno Trimarchi 0 siblings, 1 reply; 15+ messages in thread From: Michael Nazzareno Trimarchi @ 2018-05-28 15:29 UTC (permalink / raw) To: Andy Shevchenko Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, LKML Hi On Mon, May 28, 2018 at 5:25 PM, Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Mon, May 28, 2018 at 12:54 PM, Michael Nazzareno Trimarchi > <michael@amarulasolutions.com> wrote: >> Hi Arend >> >> On Mon, May 28, 2018 at 11:51 AM, Arend van Spriel >> <arend.vanspriel@broadcom.com> wrote: >>> On 5/28/2018 9:50 AM, Michael Trimarchi wrote: >>>> >>>> Watchdog need to be stopped in brcmf_sdio_remove to avoid >>>> i >>>> The system is going down NOW! >>>> [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual >>>> address 000002f8 >>>> Sent SIGTERM to all processes >>>> [ 1348.121412] Mem abort info: >>>> [ 1348.126962] ESR = 0x96000004 >>>> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >>>> [ 1348.135948] SET = 0, FnV = 0 >>>> [ 1348.138997] EA = 0, S1PTW = 0 >>>> [ 1348.142154] Data abort info: >>>> [ 1348.145045] ISV = 0, ISS = 0x00000004 >>>> [ 1348.148884] CM = 0, WnR = 0 >>>> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >>>> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >>>> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >>>> [ 1348.168927] Modules linked in: ipv6 >>>> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >>>> 4.17.0-rc5-next-20180517 #18 >>>> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >>>> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >>>> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >>>> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >>> >>> >>> Hi Michael, >>> >>> Thanks for the patch. In normal scenario the callstack looks like this: >>> >>> brcmf_sdio_remove() >>> -> brcmf_detach() >>> -> brcmf_bus_stop() >>> -> brcmf_sdio_bus_stop() >>> >>> In brcmf_sdio_bus_stop() the watchdog is terminated. So in what scenario did >>> you encounter this null pointer deref? >> >> Is this happen even when there is not wifi firmware? >> boot without any firmware in the filesystem and then trigger a reboot > > Something like the above I had noticed for a long (couple of kernel > releases?) time, but wasn't a big priority to me. > Though, I can test this on my side. > > P.S. I think rmmod or echo > unbind will trigger that as well. > Right now the module is compiled in the kernel. I can dig down tonight on this if needed Michael > -- > With Best Regards, > Andy Shevchenko -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com | ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 15:29 ` Michael Nazzareno Trimarchi @ 2018-05-28 15:33 ` Michael Nazzareno Trimarchi 2018-05-29 9:22 ` Arend van Spriel 0 siblings, 1 reply; 15+ messages in thread From: Michael Nazzareno Trimarchi @ 2018-05-28 15:33 UTC (permalink / raw) To: Andy Shevchenko Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, LKML Hi Andy The problem seems really easy to solve: diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 412a05b..ba60b151 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4227,13 +4227,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) timer_setup(&bus->timer, brcmf_sdio_watchdog, 0); /* Initialize watchdog thread */ init_completion(&bus->watchdog_wait); - bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, - bus, "brcmf_wdog/%s", - dev_name(&sdiodev->func1->dev)); - if (IS_ERR(bus->watchdog_tsk)) { - pr_warn("brcmf_watchdog thread failed to start\n"); - bus->watchdog_tsk = NULL; - } + /* Initialize DPC thread */ bus->dpc_triggered = false; bus->dpc_running = false; @@ -4281,6 +4275,14 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) goto fail; } + bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, + bus, "brcmf_wdog/%s", + dev_name(&sdiodev->func1->dev)); + if (IS_ERR(bus->watchdog_tsk)) { + pr_warn("brcmf_watchdog thread failed to start\n"); + bus->watchdog_tsk = NULL; + } + return bus; Just look here ret = brcmf_fw_get_firmwares(sdiodev->dev, fwreq, brcmf_sdio_firmware_callback); if (ret != 0) { brcmf_err("async firmware request failed: %d\n", ret); kfree(fwreq); goto fail; } bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, bus, "brcmf_wdog/%s", dev_name(&sdiodev->func1->dev)); if (IS_ERR(bus->watchdog_tsk)) { pr_warn("brcmf_watchdog thread failed to start\n"); bus->watchdog_tsk = NULL; } return bus; fail: brcmf_sdio_remove(bus); return NULL; On Mon, May 28, 2018 at 5:29 PM, Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote: > Hi > > On Mon, May 28, 2018 at 5:25 PM, Andy Shevchenko > <andy.shevchenko@gmail.com> wrote: >> On Mon, May 28, 2018 at 12:54 PM, Michael Nazzareno Trimarchi >> <michael@amarulasolutions.com> wrote: >>> Hi Arend >>> >>> On Mon, May 28, 2018 at 11:51 AM, Arend van Spriel >>> <arend.vanspriel@broadcom.com> wrote: >>>> On 5/28/2018 9:50 AM, Michael Trimarchi wrote: >>>>> >>>>> Watchdog need to be stopped in brcmf_sdio_remove to avoid >>>>> i >>>>> The system is going down NOW! >>>>> [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual >>>>> address 000002f8 >>>>> Sent SIGTERM to all processes >>>>> [ 1348.121412] Mem abort info: >>>>> [ 1348.126962] ESR = 0x96000004 >>>>> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >>>>> [ 1348.135948] SET = 0, FnV = 0 >>>>> [ 1348.138997] EA = 0, S1PTW = 0 >>>>> [ 1348.142154] Data abort info: >>>>> [ 1348.145045] ISV = 0, ISS = 0x00000004 >>>>> [ 1348.148884] CM = 0, WnR = 0 >>>>> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >>>>> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >>>>> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >>>>> [ 1348.168927] Modules linked in: ipv6 >>>>> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >>>>> 4.17.0-rc5-next-20180517 #18 >>>>> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >>>>> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >>>>> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >>>>> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >>>> >>>> >>>> Hi Michael, >>>> >>>> Thanks for the patch. In normal scenario the callstack looks like this: >>>> >>>> brcmf_sdio_remove() >>>> -> brcmf_detach() >>>> -> brcmf_bus_stop() >>>> -> brcmf_sdio_bus_stop() >>>> >>>> In brcmf_sdio_bus_stop() the watchdog is terminated. So in what scenario did >>>> you encounter this null pointer deref? >>> >>> Is this happen even when there is not wifi firmware? >>> boot without any firmware in the filesystem and then trigger a reboot >> >> Something like the above I had noticed for a long (couple of kernel >> releases?) time, but wasn't a big priority to me. >> Though, I can test this on my side. >> >> P.S. I think rmmod or echo > unbind will trigger that as well. >> > > Right now the module is compiled in the kernel. I can dig down tonight > on this if needed > > Michael > >> -- >> With Best Regards, >> Andy Shevchenko > > > > -- > | Michael Nazzareno Trimarchi Amarula Solutions BV | > | COO - Founder Cruquiuskade 47 | > | +31(0)851119172 Amsterdam 1018 AM NL | > | [`as] http://www.amarulasolutions.com | -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com | ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 15:33 ` Michael Nazzareno Trimarchi @ 2018-05-29 9:22 ` Arend van Spriel 0 siblings, 0 replies; 15+ messages in thread From: Arend van Spriel @ 2018-05-29 9:22 UTC (permalink / raw) To: Michael Nazzareno Trimarchi, Andy Shevchenko Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, LKML On 5/28/2018 5:33 PM, Michael Nazzareno Trimarchi wrote: > Hi Andy > > The problem seems really easy to solve: > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > index 412a05b..ba60b151 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > @@ -4227,13 +4227,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct > brcmf_sdio_dev *sdiodev) > timer_setup(&bus->timer, brcmf_sdio_watchdog, 0); > /* Initialize watchdog thread */ > init_completion(&bus->watchdog_wait); > - bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, > - bus, "brcmf_wdog/%s", > - dev_name(&sdiodev->func1->dev)); > - if (IS_ERR(bus->watchdog_tsk)) { > - pr_warn("brcmf_watchdog thread failed to start\n"); > - bus->watchdog_tsk = NULL; > - } > + > /* Initialize DPC thread */ > bus->dpc_triggered = false; > bus->dpc_running = false; > @@ -4281,6 +4275,14 @@ struct brcmf_sdio *brcmf_sdio_probe(struct > brcmf_sdio_dev *sdiodev) > goto fail; > } > > + bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, > + bus, "brcmf_wdog/%s", > + dev_name(&sdiodev->func1->dev)); > + if (IS_ERR(bus->watchdog_tsk)) { > + pr_warn("brcmf_watchdog thread failed to start\n"); > + bus->watchdog_tsk = NULL; > + } > + > return bus; Hi Michael, That makes no sense. Or are you saying the function brcmf_fw_get_firmwares() fails for you? Oh wait, you mentioned the driver was built-in, right? The above change does not solve the issue. It just makes it less likely to occur. So I think your initial fix is the best solution for this. Regards, Arend ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 2018-05-28 7:50 [PATCH] brcmfmac: stop watchdog before detach and free everything Michael Trimarchi 2018-05-28 9:51 ` Arend van Spriel @ 2018-05-29 9:25 ` Arend van Spriel 2018-05-30 9:06 ` [PATCH V2] " Michael Trimarchi 1 sibling, 1 reply; 15+ messages in thread From: Arend van Spriel @ 2018-05-29 9:25 UTC (permalink / raw) To: Michael Trimarchi Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel On 5/28/2018 9:50 AM, Michael Trimarchi wrote: > Watchdog need to be stopped in brcmf_sdio_remove to avoid > i > The system is going down NOW! > [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 > Sent SIGTERM to all processes [snip] Please send a V2 with your configuration details to the commit message, ie. using built-in driver, no firmware in place, etc. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++ > 1 file changed, 7 insertions(+) ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-05-29 9:25 ` Arend van Spriel @ 2018-05-30 9:06 ` Michael Trimarchi 2018-06-19 18:19 ` Arend van Spriel ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: Michael Trimarchi @ 2018-05-30 9:06 UTC (permalink / raw) To: Arend van Spriel Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel Using built-in in kernel image without a firmware in filesystem or in the kernel image can lead to a kernel NULL pointer deference. Watchdog need to be stopped in brcmf_sdio_remove The system is going down NOW! [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 Sent SIGTERM to all processes [ 1348.121412] Mem abort info: [ 1348.126962] ESR = 0x96000004 [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits [ 1348.135948] SET = 0, FnV = 0 [ 1348.138997] EA = 0, S1PTW = 0 [ 1348.142154] Data abort info: [ 1348.145045] ISV = 0, ISS = 0x00000004 [ 1348.148884] CM = 0, WnR = 0 [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) [ 1348.158475] [00000000000002f8] pgd=0000000000000000 [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 1348.168927] Modules linked in: ipv6 [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 [ 1348.180757] Hardware name: Amarula A64-Relic (DT) [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 [ 1348.200253] sp : ffff00000b85be30 [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 412a05b..061f69d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4294,6 +4294,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) brcmf_dbg(TRACE, "Enter\n"); if (bus) { + /* Stop watchdog task */ + if (bus->watchdog_tsk) { + send_sig(SIGTERM, bus->watchdog_tsk, 1); + kthread_stop(bus->watchdog_tsk); + bus->watchdog_tsk = NULL; + } + /* De-register interrupt handler */ brcmf_sdiod_intr_unregister(bus->sdiodev); -- 2.7.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-05-30 9:06 ` [PATCH V2] " Michael Trimarchi @ 2018-06-19 18:19 ` Arend van Spriel 2018-06-19 19:06 ` Kalle Valo 2018-06-20 13:15 ` Andy Shevchenko 2018-06-24 16:58 ` [V2] " Kalle Valo 2 siblings, 1 reply; 15+ messages in thread From: Arend van Spriel @ 2018-06-19 18:19 UTC (permalink / raw) To: Michael Trimarchi Cc: Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel On 5/30/2018 11:06 AM, Michael Trimarchi wrote: > Using built-in in kernel image without a firmware in filesystem > or in the kernel image can lead to a kernel NULL pointer deference. > Watchdog need to be stopped in brcmf_sdio_remove > > The system is going down NOW! > [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 > Sent SIGTERM to all processes > [ 1348.121412] Mem abort info: > [ 1348.126962] ESR = 0x96000004 > [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits > [ 1348.135948] SET = 0, FnV = 0 > [ 1348.138997] EA = 0, S1PTW = 0 > [ 1348.142154] Data abort info: > [ 1348.145045] ISV = 0, ISS = 0x00000004 > [ 1348.148884] CM = 0, WnR = 0 > [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) > [ 1348.158475] [00000000000002f8] pgd=0000000000000000 > [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP > [ 1348.168927] Modules linked in: ipv6 > [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 > [ 1348.180757] Hardware name: Amarula A64-Relic (DT) > [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 > [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 > [ 1348.200253] sp : ffff00000b85be30 > [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 > [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 > [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 > [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 > [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 > [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 > [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 > [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 > [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 > [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 > [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 > [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 > [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 > [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 > [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 Forgot about this one. Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > index 412a05b..061f69d 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > @@ -4294,6 +4294,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) > brcmf_dbg(TRACE, "Enter\n"); > > if (bus) { > + /* Stop watchdog task */ > + if (bus->watchdog_tsk) { > + send_sig(SIGTERM, bus->watchdog_tsk, 1); > + kthread_stop(bus->watchdog_tsk); > + bus->watchdog_tsk = NULL; > + } > + > /* De-register interrupt handler */ > brcmf_sdiod_intr_unregister(bus->sdiodev); > > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-06-19 18:19 ` Arend van Spriel @ 2018-06-19 19:06 ` Kalle Valo 2018-06-19 19:27 ` Arend van Spriel 0 siblings, 1 reply; 15+ messages in thread From: Kalle Valo @ 2018-06-19 19:06 UTC (permalink / raw) To: Arend van Spriel Cc: Michael Trimarchi, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel Arend van Spriel <arend.vanspriel@broadcom.com> writes: > On 5/30/2018 11:06 AM, Michael Trimarchi wrote: >> Using built-in in kernel image without a firmware in filesystem >> or in the kernel image can lead to a kernel NULL pointer deference. >> Watchdog need to be stopped in brcmf_sdio_remove >> >> The system is going down NOW! >> [ 1348.110759] Unable to handle kernel NULL pointer dereference at >> virtual address 000002f8 >> Sent SIGTERM to all processes >> [ 1348.121412] Mem abort info: >> [ 1348.126962] ESR = 0x96000004 >> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >> [ 1348.135948] SET = 0, FnV = 0 >> [ 1348.138997] EA = 0, S1PTW = 0 >> [ 1348.142154] Data abort info: >> [ 1348.145045] ISV = 0, ISS = 0x00000004 >> [ 1348.148884] CM = 0, WnR = 0 >> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >> [ 1348.168927] Modules linked in: ipv6 >> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >> 4.17.0-rc5-next-20180517 #18 >> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >> [ 1348.200253] sp : ffff00000b85be30 >> [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 >> [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 >> [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 >> [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 >> [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 >> [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 >> [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 >> [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 >> [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 >> [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 >> [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 >> [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 >> [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 >> [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 >> [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 > > Forgot about this one. > > Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Should this go to 4.18? -- Kalle Valo ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-06-19 19:06 ` Kalle Valo @ 2018-06-19 19:27 ` Arend van Spriel 2018-06-19 19:37 ` Andy Shevchenko 0 siblings, 1 reply; 15+ messages in thread From: Arend van Spriel @ 2018-06-19 19:27 UTC (permalink / raw) To: Kalle Valo Cc: Michael Trimarchi, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel On 6/19/2018 9:06 PM, Kalle Valo wrote: > Arend van Spriel <arend.vanspriel@broadcom.com> writes: > >> On 5/30/2018 11:06 AM, Michael Trimarchi wrote: >>> Using built-in in kernel image without a firmware in filesystem >>> or in the kernel image can lead to a kernel NULL pointer deference. >>> Watchdog need to be stopped in brcmf_sdio_remove >>> >>> The system is going down NOW! >>> [ 1348.110759] Unable to handle kernel NULL pointer dereference at >>> virtual address 000002f8 >>> Sent SIGTERM to all processes >>> [ 1348.121412] Mem abort info: >>> [ 1348.126962] ESR = 0x96000004 >>> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >>> [ 1348.135948] SET = 0, FnV = 0 >>> [ 1348.138997] EA = 0, S1PTW = 0 >>> [ 1348.142154] Data abort info: >>> [ 1348.145045] ISV = 0, ISS = 0x00000004 >>> [ 1348.148884] CM = 0, WnR = 0 >>> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) >>> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >>> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >>> [ 1348.168927] Modules linked in: ipv6 >>> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >>> 4.17.0-rc5-next-20180517 #18 >>> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >>> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >>> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >>> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >>> [ 1348.200253] sp : ffff00000b85be30 >>> [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 >>> [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 >>> [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 >>> [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 >>> [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 >>> [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 >>> [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 >>> [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 >>> [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 >>> [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 >>> [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 >>> [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 >>> [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 >>> [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 >>> [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 >> >> Forgot about this one. >> >> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> > > Should this go to 4.18? It is a bit of a corner case, but yeah let's do that. Regards, Arend ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-06-19 19:27 ` Arend van Spriel @ 2018-06-19 19:37 ` Andy Shevchenko 0 siblings, 0 replies; 15+ messages in thread From: Andy Shevchenko @ 2018-06-19 19:37 UTC (permalink / raw) To: Arend van Spriel Cc: Kalle Valo, Michael Trimarchi, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, Linux Kernel Mailing List On Tue, Jun 19, 2018 at 10:27 PM, Arend van Spriel <arend.vanspriel@broadcom.com> wrote: > On 6/19/2018 9:06 PM, Kalle Valo wrote: >> >> Arend van Spriel <arend.vanspriel@broadcom.com> writes: >> >>> On 5/30/2018 11:06 AM, Michael Trimarchi wrote: >>>> >>>> Using built-in in kernel image without a firmware in filesystem >>>> or in the kernel image can lead to a kernel NULL pointer deference. >>>> Watchdog need to be stopped in brcmf_sdio_remove >>>> >>>> The system is going down NOW! >>>> [ 1348.110759] Unable to handle kernel NULL pointer dereference at >>>> virtual address 000002f8 >>>> Sent SIGTERM to all processes >>>> [ 1348.121412] Mem abort info: >>>> [ 1348.126962] ESR = 0x96000004 >>>> [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits >>>> [ 1348.135948] SET = 0, FnV = 0 >>>> [ 1348.138997] EA = 0, S1PTW = 0 >>>> [ 1348.142154] Data abort info: >>>> [ 1348.145045] ISV = 0, ISS = 0x00000004 >>>> [ 1348.148884] CM = 0, WnR = 0 >>>> [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = >>>> (____ptrval____) >>>> [ 1348.158475] [00000000000002f8] pgd=0000000000000000 >>>> [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP >>>> [ 1348.168927] Modules linked in: ipv6 >>>> [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted >>>> 4.17.0-rc5-next-20180517 #18 >>>> [ 1348.180757] Hardware name: Amarula A64-Relic (DT) >>>> [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) >>>> [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 >>>> [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 >>>> [ 1348.200253] sp : ffff00000b85be30 >>>> [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 >>>> [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 >>>> [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 >>>> [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 >>>> [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 >>>> [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 >>>> [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 >>>> [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 >>>> [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 >>>> [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 >>>> [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 >>>> [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 >>>> [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 >>>> [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 >>>> [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 >>> >>> >>> Forgot about this one. >>> >>> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> >> >> >> Should this go to 4.18? > > > It is a bit of a corner case, but yeah let's do that. > > Regards, > Arend Guys, sorry, didn't have time to test. Do it ASAP. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V2] brcmfmac: stop watchdog before detach and free everything 2018-05-30 9:06 ` [PATCH V2] " Michael Trimarchi 2018-06-19 18:19 ` Arend van Spriel @ 2018-06-20 13:15 ` Andy Shevchenko 2018-06-24 16:58 ` [V2] " Kalle Valo 2 siblings, 0 replies; 15+ messages in thread From: Andy Shevchenko @ 2018-06-20 13:15 UTC (permalink / raw) To: Michael Trimarchi Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller, Pieter-Paul Giesberts, Ian Molton, open list:TI WILINK WIRELES..., open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER, brcm80211-dev-list, netdev, Linux Kernel Mailing List On Wed, May 30, 2018 at 12:06 PM, Michael Trimarchi <michael@amarulasolutions.com> wrote: > Using built-in in kernel image without a firmware in filesystem > or in the kernel image can lead to a kernel NULL pointer deference. > Watchdog need to be stopped in brcmf_sdio_remove > > The system is going down NOW! > [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 > Sent SIGTERM to all processes > [ 1348.121412] Mem abort info: > [ 1348.126962] ESR = 0x96000004 > [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits > [ 1348.135948] SET = 0, FnV = 0 > [ 1348.138997] EA = 0, S1PTW = 0 > [ 1348.142154] Data abort info: > [ 1348.145045] ISV = 0, ISS = 0x00000004 > [ 1348.148884] CM = 0, WnR = 0 > [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) > [ 1348.158475] [00000000000002f8] pgd=0000000000000000 > [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP > [ 1348.168927] Modules linked in: ipv6 > [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 > [ 1348.180757] Hardware name: Amarula A64-Relic (DT) > [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 > [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 > [ 1348.200253] sp : ffff00000b85be30 > [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 > [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 > [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 > [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 > [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 > [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 > [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 > [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 > [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 > [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 > [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 > [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 > [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 > [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 > [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 > It was a 100% (or so) reproducible on Intel Edison with vanilla kernel and linux-firmware package, while calibration file (*.txt) is not in distribution. The system is going down NOW! Sent SIGTERM to all processes [ 118.695900] PGD 800000003bc3f067 P4D 800000003bc3f067 PUD 3bc5b067 PMD 0 [ 118.695935] Oops: 0002 [#1] SMP PTI [ 118.711905] CPU: 1 PID: 1255 Comm: brcmf_wdog/mmc2 Not tainted 4.18.0-rc1-next-20180618+ #59 [ 118.720354] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48 [ 118.729181] RIP: 0010:brcmf_sdiod_freezer_count+0x7/0x10 [brcmfmac] After this patch applied problem was gone Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> P.S. Sorry it took a bit longer. > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > index 412a05b..061f69d 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > @@ -4294,6 +4294,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) > brcmf_dbg(TRACE, "Enter\n"); > > if (bus) { > + /* Stop watchdog task */ > + if (bus->watchdog_tsk) { > + send_sig(SIGTERM, bus->watchdog_tsk, 1); > + kthread_stop(bus->watchdog_tsk); > + bus->watchdog_tsk = NULL; > + } > + > /* De-register interrupt handler */ > brcmf_sdiod_intr_unregister(bus->sdiodev); > > -- > 2.7.4 -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [V2] brcmfmac: stop watchdog before detach and free everything 2018-05-30 9:06 ` [PATCH V2] " Michael Trimarchi 2018-06-19 18:19 ` Arend van Spriel 2018-06-20 13:15 ` Andy Shevchenko @ 2018-06-24 16:58 ` Kalle Valo 2 siblings, 0 replies; 15+ messages in thread From: Kalle Valo @ 2018-06-24 16:58 UTC (permalink / raw) To: Michael Trimarchi Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller, Pieter-Paul Giesberts, Ian Molton, linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list, netdev, linux-kernel Michael Trimarchi <michael@amarulasolutions.com> wrote: > Using built-in in kernel image without a firmware in filesystem > or in the kernel image can lead to a kernel NULL pointer deference. > Watchdog need to be stopped in brcmf_sdio_remove > > The system is going down NOW! > [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 > Sent SIGTERM to all processes > [ 1348.121412] Mem abort info: > [ 1348.126962] ESR = 0x96000004 > [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits > [ 1348.135948] SET = 0, FnV = 0 > [ 1348.138997] EA = 0, S1PTW = 0 > [ 1348.142154] Data abort info: > [ 1348.145045] ISV = 0, ISS = 0x00000004 > [ 1348.148884] CM = 0, WnR = 0 > [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) > [ 1348.158475] [00000000000002f8] pgd=0000000000000000 > [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP > [ 1348.168927] Modules linked in: ipv6 > [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 > [ 1348.180757] Hardware name: Amarula A64-Relic (DT) > [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 > [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 > [ 1348.200253] sp : ffff00000b85be30 > [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 > [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 > [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 > [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 > [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 > [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 > [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 > [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 > [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 > [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 > [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 > [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 > [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 > [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 > [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000 > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> > Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Patch applied to wireless-drivers.git, thanks. 373c83a801f1 brcmfmac: stop watchdog before detach and free everything -- https://patchwork.kernel.org/patch/10437931/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-06-24 16:58 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-05-28 7:50 [PATCH] brcmfmac: stop watchdog before detach and free everything Michael Trimarchi 2018-05-28 9:51 ` Arend van Spriel 2018-05-28 9:54 ` Michael Nazzareno Trimarchi 2018-05-28 15:25 ` Andy Shevchenko 2018-05-28 15:29 ` Michael Nazzareno Trimarchi 2018-05-28 15:33 ` Michael Nazzareno Trimarchi 2018-05-29 9:22 ` Arend van Spriel 2018-05-29 9:25 ` Arend van Spriel 2018-05-30 9:06 ` [PATCH V2] " Michael Trimarchi 2018-06-19 18:19 ` Arend van Spriel 2018-06-19 19:06 ` Kalle Valo 2018-06-19 19:27 ` Arend van Spriel 2018-06-19 19:37 ` Andy Shevchenko 2018-06-20 13:15 ` Andy Shevchenko 2018-06-24 16:58 ` [V2] " Kalle Valo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).