Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9043341pxu; Mon, 28 Dec 2020 05:15:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwafR+cOPP2Y6WmxWGhVRt4bjf4PDhQHGjXKUO2uranHcFZEypWDGdDF2siHOMi/QjieBSr X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr42208884edu.170.1609161301369; Mon, 28 Dec 2020 05:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161301; cv=none; d=google.com; s=arc-20160816; b=TueiByIzgQ0434nepaM/MfEIWpGerCvFkFEqc7/jEAY7wUtAeewoQ9b/3+zOSWCw4C jKls8vq14Zc0VH3xyakDiJi6kgJ1MvxebTHNH6a5USMCMEwhjqa3hEnPSKG5wlKWSxH2 VBs2B55lAt2L/v1y8jPbv2NV0yDt3uMZruGQ1wjop/DAnZUWaS6SXtmbAKo1cJgSgW82 F30SrDb0O9ny2w7yQlOdN0fGMGaodxk1dnTVp7ZPkg1nAs/dfOlxATJ6F8nYDOxN176S cL3hlzGoDqyawf9mnpf6HeboGM9XdDVd/lonb42INmJFlylmSuFLz1snJepbvUhO8Xwe rZpQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=7JgQJhJLRj2wz4JCINbyJVjiS25khHkO4CYvjPo4hFQ=; b=FgczBsnmI60lacCe3UrDgy9sUTycECRvp3tm/gNdwEhBUG7F4wVizRehl/3B4C3F/D rX6b46oH5g7j/7WhxUanArvMxIflAdwO9jIyg2LYRuv3zzE7HPmMFHhQQryZ2fVguI5V SOlHhBS/tusDzQZ8b/w+SrhEBQJ4mcycgHT+ovHHZRoiegDSlRFJNG4WD0gZIEq+1q74 yx+Oflh/mc/vpkjqGmTwhhKuprggcTjFlBV+ofxGo6dgd/ne7yiFW7MyDLU+PGro900R Y7Mz2F8LYjEAzoZJm0H68szCqConBE64M340WirSU2jKyqo6h487w5IJs7c0dXrgsjkc lCGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qb1PnbOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg13si21001858ejc.310.2020.12.28.05.14.38; Mon, 28 Dec 2020 05:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=qb1PnbOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731842AbgL1NLq (ORCPT + 99 others); Mon, 28 Dec 2020 08:11:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:38716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731556AbgL1NLJ (ORCPT ); Mon, 28 Dec 2020 08:11:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF08F207C9; Mon, 28 Dec 2020 13:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161053; bh=MYA/x9JJHfm+Cut+k+tRiQqtxbhNjKtFH0O4csVoeqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qb1PnbOLyqEu7s70GuZO9hkO4oxRmXfudoyXMiKybp9UTy0TS8NJ8uo9vezNwAZVH SFrN229T9lG8paU9j2vp9LMzibct8Md0gJdI38vHEkT50/Jeakr9tTgLXvsdAXiX7M hpbj7Hyj9gELhxpP9uH4vZy/ipgu+Zg/MHukIemo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tsuchiya Yuto , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 085/242] mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure Date: Mon, 28 Dec 2020 13:48:10 +0100 Message-Id: <20201228124908.877143818@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tsuchiya Yuto [ Upstream commit fa74cb1dc0f4da46c441b735ca865ac52de42c0e ] 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: $ 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 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20201028142110.18144-2-kitakar@gmail.com Signed-off-by: Sasha Levin --- 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 ee40b739b2897..cd668e5427d07 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1447,6 +1447,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); if (adapter->if_ops.down_dev) -- 2.27.0