Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2536113pxb; Sun, 8 Nov 2020 04:19:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPL3JkLPURCq6DREKDn58abJRO7grNrxza62s1QKa6QYKk38phaFTwGE98YAFkFPS6qVBG X-Received: by 2002:a17:906:468d:: with SMTP id a13mr1374076ejr.253.1604837998887; Sun, 08 Nov 2020 04:19:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604837998; cv=none; d=google.com; s=arc-20160816; b=lAt6vsAYzgxu6Nh4kjibgocaZ6I+iiR3nuezkxBeGYus6EXkigKsWZkwWQS9/pidpS Ky22gxgVHdtnjFTbKKZ/YbnrYfGDKrWgx2dbj5D9jL/B2oJRzJtU6pDZNjeSaBGTF9lX +OO9Yf9I2mfnXN338LIO+4filHzmDTFt2fSfrnunApGCiWgUoX10DSVfCUv3msIvZ60Q mnfgSYnGj6UUVPesrTiMYIAw6mJuywO+AXOCtHcpFCZ/KxPzuctI1evJpDa8GtaKtif9 2g8kX26Yx6hkzQvKjtIzkAyWeqJkV8edU2Je4m5Wsl5Zt/aSkUzzbpas89RhW45S07BF FFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=FOb3CkJSCULJhcmaSH25nWu7qZ8T7kljUgnnkg/7s6U=; b=f8MVUzsjS6gJIX4kN8oLukl/0VePFxNL3HTfAIH15JrQ1yoOwriM95Dc+YZOKIevjI cLcMiEWVRdFoh+ij3fNJuk3DGASYAgPkhSSCQys9msgETMZzFUwhnX1/YYbRy1IeArGn rmjfGwVNv+okjpVG543PlXQKkjaPo/0CbblfSOf8+SyRIaPgzJCWxP8VlwQcjnV342pp 5txwPmyv/ZgK4s2cbTvPGWRXwf3J6VKVSXhAKeZTeZYY5OO5iQ0DR/47LqpSBGlbpKcE o9azNYAU/dPlCDNq/cssB1Ph6HZIxM0J6oE5LJhCXSqq0xbC0RHB85gP8+vfoE+M1KvA Mwjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IIkxxu7u; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si5118199edq.590.2020.11.08.04.19.25; Sun, 08 Nov 2020 04:19:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IIkxxu7u; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 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 S1728311AbgKHMTH (ORCPT + 99 others); Sun, 8 Nov 2020 07:19:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgKHMTG (ORCPT ); Sun, 8 Nov 2020 07:19:06 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42ACEC0613CF; Sun, 8 Nov 2020 04:19:06 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id c20so5419803pfr.8; Sun, 08 Nov 2020 04:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=FOb3CkJSCULJhcmaSH25nWu7qZ8T7kljUgnnkg/7s6U=; b=IIkxxu7uh5a1BkPe6aAwfWrC0oh+2muAeOyWWesFPM6s6+j74gENB3oTdBfU2zU+Jl Hc7ZfPBXEXEUSxVjK+eGkBiQThqS8D9fnxElsasTGKwKwpGN1bM14hMmM1/0DhLG2t2b vovvD4VDF+Zb9rgAS6AgqWtEsSy7SdsotF1507zP5qh0ZRt7h03vVdC/3LiGdyDmrxUQ Ap9jLmXZGuI2nor7BV+Uht3ZkQYQMDH7LlZBi5CreGOrxyCnErCoq6WC2+CIJH0JR1rS fPTECQyeMiJJXrI4tdrsYrkQxnSjGQA5ttXHY5Hd3e+/1TfO7MdejEXcpHuGgTqfaWfz JmHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=FOb3CkJSCULJhcmaSH25nWu7qZ8T7kljUgnnkg/7s6U=; b=WMxr0yvLJMgptguq3FZkTfN5BNwsfhyy9psNkyfKzCmoqkiM+KjpiSIeJSHYXeR/Z1 ihHk4M253tUs/tRFdAYlPA7m2JJR7Vh5clLNdHHGOryREcp7CAKDXtGwqVEuig+NTUKc UpcjPL8s/ibLkRX3bsJbVnQWKZx+A7fbNUIoOo69k66pB5tMovedJt/2CP2ZW35WLsxC EdQacHEI5W9OBEN4d2DZGkJ7fYoc1upGlmSA72bk7WUjOnFOzvnKkzRfdBvguodMnBgJ Okb00AoEATBQZIDlsdds1Ovy2MLBH4uWjZpzwxnc0mcygy2m9WcMrOEhmnUxMkUwNDmp 9QLg== X-Gm-Message-State: AOAM530XJoUEPYqovHepG6RW/kuMlOor6B3PqJdvHD7DDJo/Kqr0uFDx ljiFsvzAGJzxBarFvHHmR7s= X-Received: by 2002:a63:160b:: with SMTP id w11mr9190201pgl.110.1604837945686; Sun, 08 Nov 2020 04:19:05 -0800 (PST) Received: from [192.168.1.59] (i60-35-254-237.s41.a020.ap.plala.or.jp. [60.35.254.237]) by smtp.gmail.com with ESMTPSA id s6sm8702996pfh.9.2020.11.08.04.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Nov 2020 04:19:05 -0800 (PST) Message-ID: Subject: Re: [PATCH 1/2] mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure From: Tsuchiya Yuto To: Kalle Valo Cc: Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , Andy Shevchenko , verdre@v0yd.nl Date: Sun, 08 Nov 2020 21:19:00 +0900 In-Reply-To: <87pn4o5bkk.fsf@tynnyri.adurom.net> References: <20201028142110.18144-1-kitakar@gmail.com> <20201028142110.18144-2-kitakar@gmail.com> <87pn4o5bkk.fsf@tynnyri.adurom.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sun, 2020-11-08 at 13:31 +0200, Kalle Valo wrote: > Tsuchiya Yuto writes: > > > When FLR is performed but without fw reset for some reasons (e.g. on > > Surface devices, fw reset requires another quirk), it fails to reset > > properly. You can trigger the issue on such devices via debugfs entry > > for reset: > > > > $ echo 1 | sudo tee /sys/kernel/debug/mwifiex/mlan0/reset > > > > and the resulting dmesg log: > > > > [ 45.740508] mwifiex_pcie 0000:03:00.0: Resetting per request > > [ 45.742937] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 3 > > [ 45.744666] mwifiex_pcie 0000:03:00.0: info: shutdown mwifiex... > > [ 45.751530] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.751539] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771691] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771695] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 45.771697] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771698] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 45.771699] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771701] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 45.771702] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771703] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 45.771704] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771705] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 45.771707] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed > > [ 45.771708] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 53.099343] mwifiex_pcie 0000:03:00.0: info: trying to associate to '[SSID]' bssid [BSSID] > > [ 53.241870] mwifiex_pcie 0000:03:00.0: info: associated to bssid [BSSID] successfully > > [ 75.377942] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 > > [ 85.385491] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 15 > > [ 87.539408] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 > > [ 87.539412] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 99.699917] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 > > [ 99.699925] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [ 111.859802] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110 > > [ 111.859808] mwifiex_pcie 0000:03:00.0: deleting the crypto keys > > [...] > > > > When comparing mwifiex_shutdown_sw() with mwifiex_pcie_remove(), it > > lacks mwifiex_init_shutdown_fw(). > > > > This commit fixes mwifiex_shutdown_sw() by adding the missing > > mwifiex_init_shutdown_fw(). > > > > Fixes: 4c5dae59d2e9 ("mwifiex: add PCIe function level reset support") > > Signed-off-by: Tsuchiya Yuto > > Otherwise looks good to me, but what is FLR? I can add the description > to the commit log if you tell me what it is. > Thanks! It's a PCIe Function Level Reset (FLR). In addition to this, it may be better to add a vendor name (Microsoft) of the devices where we observed this issue? (The other patch I sent also lacks the vendor name [1]) Based on the two improvements, I think the commit log should look like this (also fixed some grammatical errors): When a PCIe function level reset (FLR) is performed but without fw reset for some reasons (e.g., on Microsoft Surface devices, fw reset requires other quirks), it fails to reset wifi properly. You can trigger the issue on such devices via debugfs entry for reset: [...] I'd appreciate it if you could add the above changes (and/or your changes if required). I can also resend this series if this is more preferable. [1] [PATCH] mwifiex: pcie: skip cancel_work_sync() on reset failure path https://lore.kernel.org/linux-wireless/20201028142346.18355-1-kitakar@gmail.com/