Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2076995imm; Mon, 28 May 2018 00:52:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKInNPCKcIYcZkQgPx4P5AcDQxknQhAweVL7+p4H2TypDhp+ZnCqAV+leKcyiP3ENE8Px4UU X-Received: by 2002:a65:4ac3:: with SMTP id c3-v6mr3339214pgu.329.1527493977215; Mon, 28 May 2018 00:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527493977; cv=none; d=google.com; s=arc-20160816; b=FkZAAbVOyZaGuC7J1+hAdTK48qYKth135FiYh3n9Sxx5jvrA3RfT1B5o1CEZCeO3J7 d5pP67B0PWf0qDcbgtzlEcmwjdvSsvdCJM2BwrIRP2UoUUvfFH99AD0inJwDQdrAijBu aL4SR0l3B8a7Um6ff0sTUAshEtmI8GOTClJclJyII1VxsjtCLAtxYbHklF4IR06oLC7A rXaZJKWzAWYE3t7gXt/DieIMXndaqPBvXYF9nIvtNw8OzgAoV5Y6ER3OyzvEs58EAsEP AWDGSMY9IzLg9gMkN69Ponkce6Tytln9lnUu+lmts76vmD9siNCDlX42UVhyg8d8Pbjr SMCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature:arc-authentication-results; bh=h2z8SXKaelFxN50zXGukZ2dcswvkhrll5fdJhO9qLQM=; b=ZejlekvfiKPUBBg2MFU5bau1u7N5r4AK3hIkQ1kDp+onps1x2qA4a6PneYaqY44KVp xDS+kC07W1SbVZkZ/5u7jOiRBeWUSJdh56h2+nUNFabTR4mv6/cKiImomjjkAeY0d4dr 88IXjblJ2QnvS5c1YPPHqqkEwu9c9mqnVr9XbIw3q6Pb+GyhDJQg8aBpdlgVKsR0p36n UQ4OdYTFna7AbIvxla1zTNJOwwT9rX1kRXb9DuyClugOXW3V7yVEICTrqvXXP18w3osk N/3L0yhv1wWi3dfbwtm3HX7xqlVgAcgyEaIg4SAXcMnsZiFKJ5Eyy1hsf30va3OJxBWo fUZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@amarulasolutions.com header.s=google header.b=pxE7VAUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d90-v6si29976815pld.92.2018.05.28.00.52.42; Mon, 28 May 2018 00:52:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@amarulasolutions.com header.s=google header.b=pxE7VAUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004AbeE1HvC (ORCPT + 99 others); Mon, 28 May 2018 03:51:02 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:40878 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753797AbeE1HvA (ORCPT ); Mon, 28 May 2018 03:51:00 -0400 Received: by mail-wr0-f193.google.com with SMTP id l41-v6so18714062wre.7 for ; Mon, 28 May 2018 00:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=h2z8SXKaelFxN50zXGukZ2dcswvkhrll5fdJhO9qLQM=; b=pxE7VAUxCn57NEgRvFsFkKozVPf+9c6QXsZtkID2Fkm6AusE/nHa1+9LB+PIg/CzBB CmNFtUU95toBklkBgQP+QYBrq2a2dIr4MV17Hl1mJxAbLtWyb0MRTYDyE0SAM6E6il1u bWEZ5UrGDjor+8lCNvdvdSiQKUXmGGvJuJRHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h2z8SXKaelFxN50zXGukZ2dcswvkhrll5fdJhO9qLQM=; b=C5jhbAZ9+rmtnX/NTj237Jf/4kj5vyuy9bBPbWpKh0yKdmS77ofMqm6Bx9FAJZImH+ UMlMm2Dn9Bn/+EfnwAxSY55QmP1yaG1iLriyLHj3XiudQFWX4M5TVOlW4Sf5kql0E9Hj SqacDb6q5q14DX0+3zabP5ngVtUru6jYeCdPTbMhFodo6NzxsETAf4UtMr1GzWnkKoL1 gilsMvQ32NrjpddYz76t+pv9SFHAXtsSxsdjBnZ4yWDUs8S0lrJRw22r7ZTX9QB8fbRl myx2UCOCeiMlhvfm6cGyu7uITTqB+5hrnEcv/tAW16JMY5LepHyb4+t1jB9E5qKgim8u WelQ== X-Gm-Message-State: ALKqPweYA1ub9QxJl8bFrbYnmP4pC4gGbI0d5oSNJjndCKv2askzZyB/ kASR40T3NybYgy6COJLfRFB10A== X-Received: by 2002:adf:8211:: with SMTP id 17-v6mr5751958wrb.144.1527493859312; Mon, 28 May 2018 00:50:59 -0700 (PDT) Received: from localhost.localdomain (ip-163-227.sn-213-198.clouditalia.com. [213.198.163.227]) by smtp.gmail.com with ESMTPSA id 88-v6sm22486818wro.49.2018.05.28.00.50.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 00:50:58 -0700 (PDT) From: Michael Trimarchi Cc: michael@amarulasolutions.com, Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Kalle Valo , "David S. Miller" , Pieter-Paul Giesberts , Ian Molton , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] brcmfmac: stop watchdog before detach and free everything Date: Mon, 28 May 2018 09:50:54 +0200 Message-Id: <1527493857-2220-1-git-send-email-michael@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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