Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2462433imm; Mon, 28 May 2018 08:31:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpb3SyMYVORCBVo+++qWflDcCbbvNDOvD2mjMREwrx/G0aLDlrD7whet9GXEaxA2JV7p9GJ X-Received: by 2002:a63:5fcb:: with SMTP id t194-v6mr10694386pgb.176.1527521493612; Mon, 28 May 2018 08:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527521493; cv=none; d=google.com; s=arc-20160816; b=02QYWHkWWseF7JkVtFOv6jT44q5Sz45xbkm3VUTe3Jynv9WA6h2elfaaScUoEXOaBz mFyWCU1YIqXGCP+qyBYJnWpiGNbm1LLbC03FlFixCdVuCHp8odc+zuqSU0fBxLaxpiy+ mKd5mRe0Nn+1OOuymFM3aBly8yACrkFuyacQztzokyS6SrVL9lFxS+1ih59sJrePQYVd SBXrDnf/aCwpyylWSMhihzxhJOdYDNb0kTVvKo71nC9DaO0nj0O40qhRYWPtFixzQCGz sdRKr+aQ2kIYARWphSnjY8VoghicQ5uB0ncPotFd+UyAsJ0CA3Rt5jYUaQtQswGETrNx gYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=IGcn2BMxzY55mQsF6UBVuvl/AgVc6XloLFX8dxNzPyM=; b=k/5HztTJapem7nFycUupou3pv/odXDQsn2zsdlYS8Z6CFrMipF0Ta6+6PCnyxRSFjm IpmBITv33Aj4qc6ertZswm5lYipXWeUcuKs0NcL735Z5yjvXfSsM4/UCFmb2kvfRN8fN 5oI7GenAbn2Rv9bSvfWyBfHkpqBb9Y55x4VvKv8DfYWYguui8kupb+FLdCWbSmyW9NyL lOhxZoYsqSH28FAMgrAqj5ZnyHx6MWq7VEJ5H3zF8Eah1PWBjL8uyV7Z2ttLMohxlqxo c46yiy/IKG/WUiGPo5Zu9B7T/FoKY1NUvWWt9dcbkEfBmGp6B22BLqLhkhwQJosGPhVQ VD5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fc5q/64W; 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 f7-v6si30042990pfa.78.2018.05.28.08.31.19; Mon, 28 May 2018 08:31:33 -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=@amarulasolutions.com header.s=google header.b=fc5q/64W; 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 S1034414AbeE1P3V (ORCPT + 99 others); Mon, 28 May 2018 11:29:21 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44827 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033186AbeE1P3N (ORCPT ); Mon, 28 May 2018 11:29:13 -0400 Received: by mail-wr0-f193.google.com with SMTP id y15-v6so20881893wrg.11 for ; Mon, 28 May 2018 08:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IGcn2BMxzY55mQsF6UBVuvl/AgVc6XloLFX8dxNzPyM=; b=fc5q/64WdQphGeU28wE9raaU1WTS3FF0CSYoxIxWSEeuYzonCYaRqhAXUam3H733TN fhFcMZ4AgDDn3dZUXgGK9VvrPBNyQL0rsUTUFI60rNga7hwmnzeDAzQfg0uk8/NDmYDB ycrMjVuacuoan7i1ozxWfObXYehwsCTgZnzGY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IGcn2BMxzY55mQsF6UBVuvl/AgVc6XloLFX8dxNzPyM=; b=cw6lblSKaBtWPX4n30+iiFWzdjSlUuM6gGkyJHMs5WlF4ZfZO49LOE56P3vOI7q7qh ikNeDo9TjfA+ovWAkRgxWgTRjmpdJ++P57PlIWv7cttj5WTOs/VmXs+PWdpR0qeqaMuP w5r2e2/J5/TQmNA9j1bflhy9kDS5M/duJL18CzZOA41NLXSiu4b3w3GxOrzpQzuUWxD7 FfmFRpIL1Ly/RWJaC72hB237hIL5h4FBQwcmpML0Hcty5eycwvBNqPkiWk1nrtX32QNT sE3itUaFEXew9v+h+szkjF1pcLlvafNtx/nSV8ZWL4e4Uq5s6+At7ZE8yaoB34v+vFtF 0R8g== X-Gm-Message-State: ALKqPwe+1HSdfiZo/sRrjWuEmRkkWqtZHZ8RmXwEjqPL6XsXTzZM1wfX qMKliBH+rynxgWO8udsEpA5MTPg/2+/1jGYsmIc6ZoQf X-Received: by 2002:adf:cf0d:: with SMTP id o13-v6mr9019914wrj.112.1527521351976; Mon, 28 May 2018 08:29:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:8684:0:0:0:0:0 with HTTP; Mon, 28 May 2018 08:29:11 -0700 (PDT) In-Reply-To: References: <1527493857-2220-1-git-send-email-michael@amarulasolutions.com> <5B0BD13D.8000809@broadcom.com> From: Michael Nazzareno Trimarchi Date: Mon, 28 May 2018 17:29:11 +0200 Message-ID: Subject: Re: [PATCH] brcmfmac: stop watchdog before detach and free everything 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@cypress.com, netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Mon, May 28, 2018 at 5:25 PM, Andy Shevchenko wrote: > On Mon, May 28, 2018 at 12:54 PM, Michael Nazzareno Trimarchi > wrote: >> Hi Arend >> >> On Mon, May 28, 2018 at 11:51 AM, Arend van Spriel >> 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 |