Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6233328rwl; Tue, 4 Apr 2023 09:32:02 -0700 (PDT) X-Google-Smtp-Source: AKy350anDljXbyP0SWeBgbmkRV2NqYzeaaEjtVxq3PWexG681lHmOs/m0nb6VfwjVEhxyGOnu/hj X-Received: by 2002:a17:906:fa15:b0:930:57e5:d9a8 with SMTP id lo21-20020a170906fa1500b0093057e5d9a8mr92708ejb.68.1680625922479; Tue, 04 Apr 2023 09:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680625922; cv=none; d=google.com; s=arc-20160816; b=ry9LlwUFjqhC3h6yi7o3hbdZQc/zW5hD38sSKr6Fy+ePl5e9fBw897Z4UuiMqVQK5Y X0x5U3S4k/zUEhKn6+C3ExaeaCrdw2k73pIl6yvJ0i+cG58+L/x7xiRFa4O7H/pVvIlv qTtf7m62UE1Rx8P+cX02EuEunYhD3JgZ4Mu2QRKUdKtElPIYRe7pxjdEuiigZFlBOA0e U2VbmcxE3yxK6cTT3uIOhajb2sMTAbEXsFQrzw4OmwJgm3HVby/T3ZzbjTtIt2sRPVHz i4XiGnFsWyDsQw94aH3vOr+mSNiseSTj3+ZL/PV+zyC+PY8xcKCtuJ7Q3zSPtflPSCC5 OODg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jcIqjbH+cijcl8pWYbgTd1sy+eahfWBaqxFC9SUAAks=; b=sf1SUXk8gYG7CJjwcNfE6o6sHR/wXIFw1TcHkNWzEsv0qoZSS9Nsl5B6MAxyxa41Eb 0Nr511v1SOtT30+eot7pwrTkq8CM+wIEHRxjYO+yMivyQe6H2oi+XjDnAH2rCn7XtLOe Cu0slVEKwdUBM2cTOIL2xo1IyhnmOKhn2aZsL+FJGdqz5UX09AySbWRUHcdPjr4zjO01 llBFFpppzwMc2lyTDBT4xglqhlkEFbQHwqXx9dzwEZ0qdtj24e8Sb0DIivT6Xw8fAvI/ 3AKcCgJ37LaRrd5jS2xzDTi6MUXG2YFsOffJ2O3TbglopqgfrSdgam8btEdJMOTMzlyr 1UWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ESljJ613; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a170906824a00b00921bcc71a01si10155655ejx.419.2023.04.04.09.31.45; Tue, 04 Apr 2023 09:32:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ESljJ613; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjDDQUa (ORCPT + 59 others); Tue, 4 Apr 2023 12:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbjDDQU3 (ORCPT ); Tue, 4 Apr 2023 12:20:29 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D3E33C2F for ; Tue, 4 Apr 2023 09:20:26 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id i5so133073751eda.0 for ; Tue, 04 Apr 2023 09:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680625224; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jcIqjbH+cijcl8pWYbgTd1sy+eahfWBaqxFC9SUAAks=; b=ESljJ613EoX0a/jKx+iWtquzzbj7IOoraoZuNTAN0dJXiCDiZTgTaxcTfSjh30mYBL GUhfhtP2qcUk//VjzbPu/1IjZ6Xlpsbkw+9qSypDT6kSvgYavS1S4R9EvebXr6G4mk1/ 8YlengaX+5/QmB1yAfSPCdIbIwTcpSNpCC0V67CtFbeeE4DWPFspmOaZHla9RhSkTzsA DGgHxXXj/3hXYKpQQBukh4LmzmmwdDIuv+atgDyw31s270GrDPne8GVse4P9qwD9Z/wt A+dUSbsapynycWbbmLnqblsYSFQBhmVzyd1XJ8HYcjzAaToRTu6iBNEuWtz2GZYvZkQE NtPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680625224; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jcIqjbH+cijcl8pWYbgTd1sy+eahfWBaqxFC9SUAAks=; b=hSBKh/ImS8F0uxrsbwjkz8rEZPD3H7eijRabuEqyqWSuMeHQ2JlJRBsrn5nHROmBWL ZDo+rgawdBzypVTDvRwnRh2dCx6xS/ofy7AnC1kSY67JrZCe9qQ/T/CY1XWOgdytuyoe QqvqWb1Ys92OMORunlHGZkmJjUftCuexeeaI3e5r0cSQhOtjY2/n/uST9NoXBKSasW35 GeGLgWJnw4IJrkGT/jkX+IJ5dqkPbcoEze2WAHIcwm6djEUqjHLaTCCEmVx/dhyMOoti PTAPM14DRJ1eKcDH6o7W3p7qnyyd9icTQIxpAG94SNbGKkPjWx/XijcxG7adjsRy3kg8 wW8Q== X-Gm-Message-State: AAQBX9fkFwiA0yhIMlnPEpFK0U1ARggfuBWuI5wrAYrZPwJU+3qIFYFO +aAbZvJ3POxIIzek6xiG32p0qqpSFQW9Wxs3 X-Received: by 2002:a17:906:258c:b0:932:c56a:c19b with SMTP id m12-20020a170906258c00b00932c56ac19bmr139701ejb.22.1680625224447; Tue, 04 Apr 2023 09:20:24 -0700 (PDT) Received: from [192.168.1.15] (cable-24-135-222-102.dynamic.sbb.rs. [24.135.222.102]) by smtp.gmail.com with ESMTPSA id q20-20020a170906541400b009442efdaf20sm6188286ejo.156.2023.04.04.09.20.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Apr 2023 09:20:23 -0700 (PDT) Message-ID: Date: Tue, 4 Apr 2023 18:20:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: wilc1000 kernel crash Content-Language: en-US To: Ajay.Kathat@microchip.com Cc: Claudiu.Beznea@microchip.com, linux-wireless@vger.kernel.org, kvalo@kernel.org, mwalle@kernel.org References: <20221024135407.7udo3dwl3mqyv2yj@0002.3ffe.de> <6d022f41-85bb-cde2-0b3d-feef0a0711f2@microchip.com> <20221026085415.6jgwrhq4sunqaypm@0002.3ffe.de> <20221209120343.wvagbfprsgdj74af@0002.3ffe.de> <4f279aa2-b5df-0b76-2cdf-ddb339a19cf7@microchip.com> <20221216101842.jjz3glyotqbbqlk4@0002.3ffe.de> <8d6316ef-fd66-0b18-ca5b-bb945ebc5370@gmail.com> From: Kirill Buksha In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 4.4.23. 03:30, Ajay.Kathat@microchip.com wrote: > On 4/3/23 07:24, Kirill Buksha wrote: >> [Some people who received this message don't often get email from kirbuk200@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] >> >> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >> >> On 16.12.22. 11:18, Michael Walle wrote: >>> Hi, >>> >>> On 22/12/09 02:14, Ajay.Kathat@microchip.com wrote: >>>> No progress yet. I tried to simulate the condition a few times but was >>>> unable to see the exact failure in my setup so I need to try more. >>> Shouldn't it also be possible to see the issue by code reading? I've >>> provided the call tree in my previous mail and my concerns regarding >>> the locking. Either I'm missing something there or there is no >>> locking between these threads which could cause this issue. >>> >>>> For the other "FW not responding" continuous logs, I got some clue. >>>> Probably, will try to send that patch first. >>> Ok, let me know if you have some patches, I'm happy to test them. >>> >>> -michael >>> >>> >> Hello, >> >> I faced the same kernel oops issue. After analyzing my logs and brief >> debugging, I agree with Mikhail: the problem seems to be accessing the >> scan_result pointer after it has been nulled. > I have submitted a patch [1] which has fix for scan_result NULL pointer > exception issue. The submitted patch handles the synchronization between > mac_close() and asynchronous interrupts from firmware. Basically, it > takes care of blocking the execution of mac_close() till all pending > works are completed and afterward no new work addition is allowed since > the close is in progress. It is worth to try with that patch once and > check it's behavior. > > 1. > https://lore.kernel.org/linux-wireless/20230404012010.15261-1-ajay.kathat@microchip.com/T/#u Thank you for the patch. I will take a look/test it when I have time. >> Regarding the solution: if there is a race between two threads (as >> Michael described earlier), then I think that the locking mechanism will >> be the most reliable solution. We ran into problems during >> deinitialization, but driver contains two more places >> (handle_scan_done() and wilc_disconnect() functions in wilc1000/hif.c), >> where scan_result is set to NULL. >> >> I use NetworkManager to manage networks and I have experienced the same >> failure multiple times when switching from one WiFi network to another. >> Keep in mind that switching between networks calls wilc_disconnect() and >> wilc_deinit() functions and it is not yet clear which one is causing a >> core dump. I think it's worth at least taking a look at these areas of >> the code. What do you think? > If possible, please share the sequence(commands) for Wifi network > switching scenario. It looks like both functions(mac_close & disconnect) > are getting called from user context. mac_close() is a netdevice > callback whereas wilc_disconnect() is a cfg80211 callback. Generally, > wilc_disconnect() should be enough to disconnect from current Wifi > network without bringing the complete interface down. Is NetworkManager > closing the interface(mac_close()) before switching the WiFi network. > > > Regards, > Ajay The commands are as follows: while true; do nmcli c up wlan0-client; nmcli c up wlan0-client-2; done It takes about 5 minutes until I see the core dump. I see following message after every command: ... wilc1000_sdio mmc0:0001:1 wlan0: Deinitializing wilc1000... ... Message above comes from wilc_wlan_deinitialize() function which is called from wilc_mac_close(). It seems that interface is closed between connections. Best regards, Kirill Buksha.