Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2159195imm; Mon, 28 May 2018 02:53:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrwSPGWmdu3G06GWUCVhhMmLOs/c9rEhM9/yO8nhzCQ6mhty3viO/gdDdtjPzB2SC7o8e2g X-Received: by 2002:a62:f24a:: with SMTP id y10-v6mr12847805pfl.75.1527501227917; Mon, 28 May 2018 02:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527501227; cv=none; d=google.com; s=arc-20160816; b=AjfGnAYGylLk/QtgyGw6xPkYMtYuEIqnZUh/ykaJKCV2iqyTuMO3XzNRUlYVgaT6qL Uym6P3V/2cKS1q39jfnWKmseVTB8E/J/d/uJmtQx63cKQHW4iLurdrU6zVf+64uGHIf4 9wjKfGRZo+JJeb9vZ6VPJJVxaEq0KVX7YDf0anieE9lkT3a2pw59XGkmaGUScZu/yOqs gTg3K81LWlFEovwU4avFUXty5J9789BQpXF8ldzgzVsmnGcTQYjps3QZzAIzIUoKIx9g VTgV3Knn3vHgnYQQMlfFzSk/mylgg5VKpgLlsLIBCi9DR3mxwnWONlebS4hwYZZ2vSqs dUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=wxeW2Dr2ADggq69wGd2MHlOrwZ3QgsDIHHE7KfMIBWU=; b=jhLIFEBHF2sU42rCvNOMFED0kB+b4YKQibSukSnLFWEY0GR0Tzy2voMU5Tpf7wj09S tCs6RaeE0JI1plra3+mJflnH35hy0uv7QFtqKfwWHfaGNVNHpFfj7Ddoy4ryhaZi4Ews 9taJn5Owx9OqikxNqd1Tmfb1p+PNBetT71kihr2tht1HdQ1GYuvF+ZK/b6kZJDivSxk7 cE9i+xL0efNJPgs6zUSP15SDUe7Hs2r7H7ePw16OOOp3b4gD3OLll2FXX00wbR20vhaE EHZAJs7kqN1mgCiG0pgqF5dFPnmt2ofhDWdWb1UdSZKUH8folvMb9JIFA4lIzBasty29 oyIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=drz9Ub8c; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33-v6si31835895pld.170.2018.05.28.02.53.32; Mon, 28 May 2018 02:53:47 -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=pass header.i=@broadcom.com header.s=google header.b=drz9Ub8c; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754331AbeE1JwV (ORCPT + 99 others); Mon, 28 May 2018 05:52:21 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:43085 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754200AbeE1JwT (ORCPT ); Mon, 28 May 2018 05:52:19 -0400 Received: by mail-qk0-f193.google.com with SMTP id h19-v6so8737925qkj.10 for ; Mon, 28 May 2018 02:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=wxeW2Dr2ADggq69wGd2MHlOrwZ3QgsDIHHE7KfMIBWU=; b=drz9Ub8cCyI5D/uNyqe/6dxo90vo5J73KIETJnafeBu92X9+cV1TGmqDHaQtUcKD2I Nm123GqK4fJP2kN1tNwOl+G2CrSQLBlNbcWC9ERk9/QbbB6YFE1NfAimjObrfjIieqrG M6QQZgtUtUHP5o4ayU/Q6krzXtCLgbSddEzCA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wxeW2Dr2ADggq69wGd2MHlOrwZ3QgsDIHHE7KfMIBWU=; b=UKZVAytaF6V7Ujrgs+WKypBogcUx00B4UBUsSALQmMumDdh8Fp6c80/mYAPb+M7QOJ 2oybVz9SgUjfaJ3/inywhu+osPZwtrwVQ4m8Th9HDEzJWXyAMccxkiqkEEWJg4GN9aoU U15Ya3nTeR56Ea6EB/yR5/2qbMelT+gh3CpGjapMibdmzoV+MReZHJSRInhNC4d9dtda z90F9j7YhLBrkW58jImswuDpG/1CRY+DbPMlZbnmjISNF7fI4l+WCIF9gs1XJ2eIVDhY VjZc3uIkCqAWgvKUXp042h311nRhRt0ykTw78X/S6JbueHPMRA3BRJqwmqbcMm4uHhpS bWTA== X-Gm-Message-State: ALKqPwfGF+Z/SysPIzQQSJzbgadEaWejllnJeO1cmJsrxuChlZ1Zg+RX y9CLQJgo/c5o+BCPvQZRWNCnEPWo X-Received: by 2002:a37:1bc9:: with SMTP id m70-v6mr10496918qkh.152.1527501138398; Mon, 28 May 2018 02:52:18 -0700 (PDT) Received: from [10.176.68.125] ([192.19.248.250]) by smtp.gmail.com with ESMTPSA id g57-v6sm3103543qte.52.2018.05.28.02.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 02:52:17 -0700 (PDT) Subject: Re: [PATCH] brcmfmac: stop watchdog before detach and free everything To: Michael Trimarchi References: <1527493857-2220-1-git-send-email-michael@amarulasolutions.com> Cc: 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 From: Arend van Spriel Message-ID: <5B0BD13D.8000809@broadcom.com> Date: Mon, 28 May 2018 11:51:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1527493857-2220-1-git-send-email-michael@amarulasolutions.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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