From patchwork Wed Oct 28 14:21:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsuchiya Yuto X-Patchwork-Id: 11864737 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFD81697 for ; Thu, 29 Oct 2020 01:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 955B420790 for ; Thu, 29 Oct 2020 01:04:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EEBx/en4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731866AbgJ2BEl (ORCPT ); Wed, 28 Oct 2020 21:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728543AbgJ1WGJ (ORCPT ); Wed, 28 Oct 2020 18:06:09 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D13C0613CF; Wed, 28 Oct 2020 15:06:08 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id p7so1151611ioo.6; Wed, 28 Oct 2020 15:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AMavcgab6f/G1LUhaSL/VnJNMSO60VRuV52F7ID9Z1w=; b=EEBx/en4jUjbpcytmaGqmQqZoK88eThP+DK9XrxHaN1SQ97f4DrSYomDP9X0SkW/q0 0Ber+eFxG+cd5uPhS9kdMvcxwOsNyvUepSmCzF0TsiaP4hVWzXTUgLvgS/dMFSOxyzGk 16u+I0XQc8qsTHSPvYyz4rHV/3lQF3ThUC3tsDsCPS7dA5Ch0eGbrwSUZZ0hL3TNeOZG CN+mzBK34uZp1FOpOIHpgudSrBlFlgzn5ZeXE3KM3F4rVihVfxpyLVG39v8DBIYrtkyE jP4hkiJ1Zb4zzHVZo4l6i5dRHdIorBBpHSNi4Xnn8MEx3bY91Z+6rCAstCz6GCl+fxKY ymrg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=AMavcgab6f/G1LUhaSL/VnJNMSO60VRuV52F7ID9Z1w=; b=CKpYiUzKGjXL4CxtU6+GaP15fd6Xsqjtz/dqg2P6v2vodl49iA5RdZr4bSTV2cy3iq dDGX8FUFw7YMQtmDKOSZqmTLmMMc6SbFohuC0uRg8/dPmhHvjf1BcQSlHvjsyQnGjGFm PO/UnaQuUbBrWTzN9BLdxsAKQNQzZ3w7gG3ikuLPaNCy6GuHmgyFhVRSb2Lfmr8qHkKG vyPvBQwGayPlrdRRB4rwyd8/xg4a7ir6gcrv9BOCwY1HddWTFv4js6LL8QMRdQRndrjJ WDjJCvVJohq3qmvoiFy9Qu615C/JZqc39FQ/l8nKsda9eP/sli9WSfkSz2sDPW81acKZ 2C9Q== X-Gm-Message-State: AOAM530SG7VqaJa7OiXisKna++lsnFpXsOKaIaweltNijmCeZU1ZQYhU nQtB9MEYCrhWfa5sFo05UoYfxYh0LodR5Nde X-Google-Smtp-Source: ABdhPJxizRPARCHdEsCXjgrcYCTJx2PzRg4bj6IZWfYbOoEie0tP3vFgu3sgYYebDUS52otqnjvptw== X-Received: by 2002:a65:62ca:: with SMTP id m10mr6618468pgv.407.1603894962096; Wed, 28 Oct 2020 07:22:42 -0700 (PDT) Received: from k5-sbwpb.flets-east.jp (i60-35-254-237.s41.a020.ap.plala.or.jp. [60.35.254.237]) by smtp.gmail.com with ESMTPSA id c12sm6293543pgi.14.2020.10.28.07.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 07:22:41 -0700 (PDT) From: Tsuchiya Yuto To: Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , Andy Shevchenko , verdre@v0yd.nl, Tsuchiya Yuto Subject: [PATCH 1/2] mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure Date: Wed, 28 Oct 2020 23:21:09 +0900 Message-Id: <20201028142110.18144-2-kitakar@gmail.com> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201028142110.18144-1-kitakar@gmail.com> References: <20201028142110.18144-1-kitakar@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/net/wireless/marvell/mwifiex/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 9ba8a8f64976b..6283df5aaaf8b 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1471,6 +1471,8 @@ int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); mwifiex_deauthenticate(priv, NULL); + mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN); + mwifiex_uninit_sw(adapter); adapter->is_up = false; From patchwork Wed Oct 28 14:21:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsuchiya Yuto X-Patchwork-Id: 11863969 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40EA092C for ; Wed, 28 Oct 2020 22:55:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1478720735 for ; Wed, 28 Oct 2020 22:55:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RvRQWDXR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389780AbgJ1Wz0 (ORCPT ); Wed, 28 Oct 2020 18:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731840AbgJ1WyC (ORCPT ); Wed, 28 Oct 2020 18:54:02 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F4117C0613CF; Wed, 28 Oct 2020 15:54:01 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id z24so745632pgk.3; Wed, 28 Oct 2020 15:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qmvrLB7IH1tGEinPOUC68sap5ydLolJODJfXOc7ByPA=; b=RvRQWDXRKqXfWV1Qf7Fg/btqgFdO6+cXld3893h/BP0HWY/1WVErVSqo7pbWRTd9uW BcCM2LMn4SMYPMMhw0Mf8/X6yjlG2KT47LD9Me3eDW5ggVIq0SUvGrO1VDADfSDh9DTc QWFOWQNxO86T5rgzitA0pLdEDzIXGXc8eBuVmk1/n5KIIyeClJC5o2YT3zobf8H/+zKZ 13v8qIJNPdAz/R36oUoJG4mRgCiilam6iyzbkZI8v4v2OYpSu2CQy/zPcXs57oYa4Akt cDZizE+XsfoG0y2skqlWJADlevw+dYlVxZOk3JsZmCQRCGQ30DQUkESKAA3E6K5r2ZkU 5Lag== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qmvrLB7IH1tGEinPOUC68sap5ydLolJODJfXOc7ByPA=; b=OH5M+ac17Lh7CHQS+0gY18nPTqU0HdbHGnUxx4ndsQCQ3nAFd+UK1kGMGLYubqpOgW eCFsVeifjkmRzcVSJqiZjQhLBJZo0t4L7p+psW4KtwvDG3Tkg3E8ee990f6XyHSj0phs ThoAJtskITyS/ydI2jlcu3WsP8QzC7nI2qO3P0uwZbwwgdjDtlN0GPwTIYxWtRhM5RJ2 K6rEetVAzqoDKi5ZoP0OVpWzf4qzEUVFkQlOKPKlDxHMABHd/6C/FT0LwR7vyJehANXx SRoCG9NKc4ikIOMZ8XKK94TyV3f7zXjG591JTnPmOLxFEn58RlGcNIPZw1fIl14AAPnn 1fMw== X-Gm-Message-State: AOAM531WE3VAvDmTvbW7mbIhaL0lF0x6D4nY8GtgbK13ka1Rk1IlbGQJ D72U+DGtuyuLqi6Y1PQyC9hkDuwCIJq5lFr/ X-Google-Smtp-Source: ABdhPJzTvSsMLNIAWrdEQ/goV55Jb501WYhs5rz8KEKsREYW9U+fmj5apKNge3gsIDMfJRlUVEgtpQ== X-Received: by 2002:a17:902:c086:b029:d3:deab:e812 with SMTP id j6-20020a170902c086b02900d3deabe812mr7546840pld.51.1603894968621; Wed, 28 Oct 2020 07:22:48 -0700 (PDT) Received: from k5-sbwpb.flets-east.jp (i60-35-254-237.s41.a020.ap.plala.or.jp. [60.35.254.237]) by smtp.gmail.com with ESMTPSA id c12sm6293543pgi.14.2020.10.28.07.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 07:22:48 -0700 (PDT) From: Tsuchiya Yuto To: Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , Andy Shevchenko , verdre@v0yd.nl, Tsuchiya Yuto Subject: [PATCH 2/2] mwifiex: update comment for shutdown_sw()/reinit_sw() to reflect current state Date: Wed, 28 Oct 2020 23:21:10 +0900 Message-Id: <20201028142110.18144-3-kitakar@gmail.com> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201028142110.18144-1-kitakar@gmail.com> References: <20201028142110.18144-1-kitakar@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The functions mwifiex_shutdown_sw() and mwifiex_reinit_sw() can be used for more general purposes than the PCIe function level reset. Also, these are even not PCIe-specific. So, let's update the comments at the top of each function accordingly. Signed-off-by: Tsuchiya Yuto --- drivers/net/wireless/marvell/mwifiex/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 6283df5aaaf8b..ee52fb839ef77 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1455,7 +1455,7 @@ static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter) } /* - * This function gets called during PCIe function level reset. + * This function can be used for shutting down the adapter SW. */ int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) { @@ -1483,7 +1483,7 @@ int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter) } EXPORT_SYMBOL_GPL(mwifiex_shutdown_sw); -/* This function gets called during PCIe function level reset. Required +/* This function can be used for reinitting the adapter SW. Required * code is extracted from mwifiex_add_card() */ int