From patchwork Mon Oct 18 23:17:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 515926 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp32630imp; Mon, 18 Oct 2021 16:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7qmN0L9eyiT8hHRscOCeT1etvI6qpisY9b2vl6zryq7Pj7Gt39mtwo8WPjMmpvWhija4r X-Received: by 2002:a9d:72de:: with SMTP id d30mr2268147otk.213.1634598930310; Mon, 18 Oct 2021 16:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634598930; cv=none; d=google.com; s=arc-20160816; b=xbiT02Wfu6HR+OpkYE7K1FSgNLWkdz2iEyOuSbkQc9NK7XrkN4r9b8PXGekj5cOXcz 9YbDDDCgZhTNvRab9XURuTCLoSuFIIJMXwR2FPZfx2v6AUsN/3HloIQqoIB1//+bauWB 3lKkhbI9UhTqRfZHVjwcAVxTv1vVIovjqoYzdwlAu9xSc+yOKLke6SAGFD5NIzn2o/9F 1+R1DlMzQp5tcKJC5AxyBBOF1GNBhmc+FUWlJsNcawNVW4Vmuq2I/9iAyzWMXHsmm4qE 5qhR3enO5HwaRCxSivU2d61SxTwxIiSPjsYzmaTldgVFrITaL8occbjzI2CfDt/+IFtS JQWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=N63KxLS0hABD9B8/d2Tzjke7oHDWPpw3CXsGjevNJS8=; b=CxaDBXb08BjUntDP53hsp42TUM+RldRld8EKOxCoal84uqPxsOkgMVtRCRz7CS0w5a 3aMjfr+qd72UPG7Kry65ZkL1R/pX37Dt6gkIGzf60UYh6oA2ADOfZaMu6t4oMaO5f77U FyDCsxPQPegUYTd837a7KQaaQs4OtAUeWkdY+doR4K8p/CYPpZEvNRmL0aHjlL5vzlm3 TuwYlRYbf1V2eSo+Fi4scDgGcek2pvZOl7iCY0mKjSTvKa9erbeSz7tlH/Uqm7VcqjoU 7s+VvC0Kj+E2FVJBV5s4eSmQH4qAMsSv4Wq/Our482hqJxQiRL/M1Z7bK5dgoLDsufFS c5Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=DCt89Kr0; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y0ODsvaf; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 8si14789731otw.22.2021.10.18.16.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=DCt89Kr0; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y0ODsvaf; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N63KxLS0hABD9B8/d2Tzjke7oHDWPpw3CXsGjevNJS8=; b=DCt89Kr0QmVBTY KhLjjYZ2QiybvzWt4FuYlM/Th/fw70PvdMFfwqy41MO2vkuKR3ZeIZIA5d8VkhXk4HQHExRUc2WoA h/mzdsta4mw94cIlM5CguO/1xJR/Dj/LjKmlPQabvllIWSrnWR8w6IK4wmHpvvaQr3FOKdiTyCC6p Ql62Zah+8LzIlm3ln/6WjHWGwxWdQsMZKAtLNUV39U7nDr7gI5ZEnKp/7NEDdUjHPiUtoEoL0ghH4 UK6oDpWCtfFm4/OXgKQd+CAHLGnPrz+tO+UdSOASuTQLGVXAI6Ohx6OHNE3CJvdKBg42Zi6Kvpv8H f5yjLrSYUBZKGvBPWnKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqq-00HR9N-QV; Mon, 18 Oct 2021 23:15:28 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqo-00HR8T-JM for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 23:15:28 +0000 Received: by mail-wr1-x42b.google.com with SMTP id r7so44243241wrc.10 for ; Mon, 18 Oct 2021 16:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cqgq7CmylZ5uOrbViyRL+gfi0biEauoJtPG6puA4TVg=; b=Y0ODsvaf5ZQxj5xz7bmOLKad1kYhn+RH4Ua0wsqAeZod6Uq9jKGhPwNCJG4hxeEkSL FM9WV4HKZtzBGJySM7/sP6V/Vf5l/mMGXb49vJqqFj1zMJ/ujbXntX6cpUINNPI0ZDZ3 6Hcu/LgwjoWIezkxF6NcQFlfYgjUgn60z/bCsjS3k/PEHreq6fB/psqCqxXKG5CnskBp nWpwcwHY7CVNEljum3cTy+hLSZewKVzBSBhLsYiiaWJeU7w507uBc3Ju3hiBJNjVwW+y iBYTVYFgHzTCjBnxmZDOR4tK4gcwSeZNsIZb+jmhO4WyDgwPRk/30KMNJ+TOfnSOrpSJ Lqqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cqgq7CmylZ5uOrbViyRL+gfi0biEauoJtPG6puA4TVg=; b=7yuVCGQ+P++pc9Ht7IQ8YqZwjYuOhGiNahA2A3/h+9RmCwpMXGJP5MBZPx5mDcznrU +hp2PNm5uC5VlygZLf/CQrXXxaRuHjl9nF6eVWIsfepooqwYT605nke93k29P89nz7Xp OKcpzf2eRGTqMi/4T2ZfN1yNTub3BRq0yhMRbRmrXfC/ojjP7wICpUYswwH2EMinmglB Mh3En5weuENyzKKWDj6VbhY9Y9Qw6DaSQflUbGoU5Syq3LXMve1oF52XZkkn+vcn6qer MfiyPsLTmoBvTkxr2E4GQ+8rR0dDK0bCNLZECtvQNkBz2RSycqWeh9fYc3djDEl7QKgQ BGsA== X-Gm-Message-State: AOAM530nhnXfUviOznvAZr4Y89fJNcXybg0eCpIbfw6PGKBnpSCzN5N1 dwKKYTy3ES2bYI9e9rE+STbeLQ== X-Received: by 2002:adf:d1ee:: with SMTP id g14mr39642914wrd.264.1634598925129; Mon, 18 Oct 2021 16:15:25 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id s8sm3685379wrr.15.2021.10.18.16.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:24 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, johannes@sipsolutions.net, bryan.odonoghue@linaro.org Subject: [PATCH v2 1/5] wcn36xx: Fix dxe lock layering violation Date: Tue, 19 Oct 2021 00:17:18 +0100 Message-Id: <20211018231722.873525-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018231722.873525-1-bryan.odonoghue@linaro.org> References: <20211018231722.873525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_161526_662882_CDCBD472 X-CRM114-Status: GOOD ( 15.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: We are looking at some interesting crashes with wcn36xx in the wild, with some of the data appearing to indicate multiple instances of "WARNING Spurious TX complete indication". Looking at the code here we see that txrx.c is taking the dxe.c lock to set and unset the current TX skbuff pointer. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org We are looking at some interesting crashes with wcn36xx in the wild, with some of the data appearing to indicate multiple instances of "WARNING Spurious TX complete indication". Looking at the code here we see that txrx.c is taking the dxe.c lock to set and unset the current TX skbuff pointer. There is no obvious logical bug however, it is a layering violation to share locks like this. Lets tidy up the code a bit by making access functions to set and unset the TX sbuff. This makes it easier to reason about this code without having to switch between multiple files. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 26 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/dxe.h | 2 ++ drivers/net/wireless/ath/wcn36xx/txrx.c | 15 ++------------ 3 files changed, 30 insertions(+), 13 deletions(-) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index c4e9e939d7d6d..6c43df4bc92c3 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -878,6 +878,32 @@ int wcn36xx_dxe_tx_flush(struct wcn36xx *wcn) return -EBUSY; } +int wcn36xx_dxe_set_tx_ack_skb(struct wcn36xx *wcn, struct sk_buff *skb) +{ + unsigned long flags; + + spin_lock_irqsave(&wcn->dxe_lock, flags); + if (wcn->tx_ack_skb) { + spin_unlock_irqrestore(&wcn->dxe_lock, flags); + wcn36xx_warn("tx_ack_skb already set\n"); + return -EINVAL; + } + + wcn->tx_ack_skb = skb; + spin_unlock_irqrestore(&wcn->dxe_lock, flags); + + return 0; +} + +void wcn36xx_dxe_unset_tx_ack_skb(struct wcn36xx *wcn) +{ + unsigned long flags; + + spin_lock_irqsave(&wcn->dxe_lock, flags); + wcn->tx_ack_skb = NULL; + spin_unlock_irqrestore(&wcn->dxe_lock, flags); +} + int wcn36xx_dxe_init(struct wcn36xx *wcn) { int reg_data = 0, ret; diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h b/drivers/net/wireless/ath/wcn36xx/dxe.h index 26a31edf52e99..9a7655d6af982 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.h +++ b/drivers/net/wireless/ath/wcn36xx/dxe.h @@ -468,4 +468,6 @@ int wcn36xx_dxe_tx_frame(struct wcn36xx *wcn, bool is_low); int wcn36xx_dxe_tx_flush(struct wcn36xx *wcn); void wcn36xx_dxe_tx_ack_ind(struct wcn36xx *wcn, u32 status); +int wcn36xx_dxe_set_tx_ack_skb(struct wcn36xx *wcn, struct sk_buff *skb); +void wcn36xx_dxe_unset_tx_ack_skb(struct wcn36xx *wcn); #endif /* _DXE_H_ */ diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index d727b0dd98de5..1218bd85de3ba 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -584,7 +584,6 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct wcn36xx_vif *vif_priv = NULL; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - unsigned long flags; bool is_low = ieee80211_is_data(hdr->frame_control); bool bcast = is_broadcast_ether_addr(hdr->addr1) || is_multicast_ether_addr(hdr->addr1); @@ -606,15 +605,8 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) { wcn36xx_dbg(WCN36XX_DBG_DXE, "TX_ACK status requested\n"); - spin_lock_irqsave(&wcn->dxe_lock, flags); - if (wcn->tx_ack_skb) { - spin_unlock_irqrestore(&wcn->dxe_lock, flags); - wcn36xx_warn("tx_ack_skb already set\n"); + if (wcn36xx_dxe_set_tx_ack_skb(wcn, skb)) return -EINVAL; - } - - wcn->tx_ack_skb = skb; - spin_unlock_irqrestore(&wcn->dxe_lock, flags); /* Only one at a time is supported by fw. Stop the TX queues * until the ack status gets back. @@ -644,10 +636,7 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, /* If the skb has not been transmitted, * don't keep a reference to it. */ - spin_lock_irqsave(&wcn->dxe_lock, flags); - wcn->tx_ack_skb = NULL; - spin_unlock_irqrestore(&wcn->dxe_lock, flags); - + wcn36xx_dxe_unset_tx_ack_skb(wcn); ieee80211_wake_queues(wcn->hw); } From patchwork Mon Oct 18 23:17:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 515928 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp32651imp; Mon, 18 Oct 2021 16:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkh9NeCZ8gtdSDyvC6Xm9m9PjsaQwmrJpVezrjdT0D4O9hAR2iVmPzvDl3ysStZANjNWBl X-Received: by 2002:aca:300e:: with SMTP id w14mr1469119oiw.178.1634598931588; Mon, 18 Oct 2021 16:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634598931; cv=none; d=google.com; s=arc-20160816; b=mYBD1PJTgAzGRPdoLndVzG8dWqjtpqD72jk1IR6WVPq7PGc6CIER89ly3GrnJyubip Y0zc/oj96bcYIF2c/4ZR8ygWhIHVToL2Zd4eqlzoWflD3VJaupGXgPa5j1+YuaB/DeCh j1820S4HRymt/zNIxka4hztnQl7C1N01xlnnGUVxs4UIKIUD+GFT/MV4e0e8IAiTBH4F BMnLKtPzbNnO9LpDyutaDwPMbornZYFSobfSiPOhPfNZvBU4U1ATLejS9h7SdJqXJQaC wqMgFK8phpKOswlwSzLqTgzG1ZVsCOaC5KTV3VGZNfHM1krMGdPJJA5B3nY6aBoW1Mj5 j6FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=8Uz2pkpxkf7kJJq78yJDi3A+25esvBjCK+OGdUoNt1s=; b=Xzfj/mqk2Mu2ukfHzEgqrbOkWtOz7lm4KyKBEiBJyZNuaKbujeVITrOY2bZ6lwTTxz CMJ/lAi84KOAy3yYw6VheaSRU5K44Xd35tMU+VuhVp6XsTJaXHg/mH0w5Ffd3MBo7evb MWzky2NwuNyylxew+C/wOYTCaZZou48IVaDxbfvz4yKWHAbnu1oE4yZsBATaPb77h8Fl +eG4YXfKAGMhrkPnvi1O6/4k8oDLbKA550DLuMhDFi2u9cEDPv7f1rZjfAoxnreS1EoI nIt6TRzLvll1g3qECcHriXuT32if/RDLeKNGqKfc2hjPnXaXngySPIx68CXEUyQcYlKT LD9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=e5h9QzmC; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=R95yIGBI; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by mx.google.com with ESMTPS id w8si16770454oib.312.2021.10.18.16.15.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=e5h9QzmC; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=R95yIGBI; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8Uz2pkpxkf7kJJq78yJDi3A+25esvBjCK+OGdUoNt1s=; b=e5h9QzmCGRs88F UlcDs3Alwuhlu/lPZhNcvHtI3p4BcmMOyYzwxGDJfZSbQd/eNv6dQJ35hFTeYmbtUHMjkZBH2eQW+ 7gVJH8UM3B+w5ckdbpLrvgljAIshN9BmEaSRn6k/LSgpIQtn4xt+/X18xAx98ZK3Wi20YejaZgc/d QTONtii7At8CjzXxwT9Y3K0sONbJHM7+zNMIT1rKRRKTcTKvxH+tJ/XofFgReqfvmPbysvodM6hgM pR9VIaATNjChvwv0xeUgOBNghkpfvoo7qJhyJyqhXsom4IQ9cOynVDi4bZpYKVEyX2ZWEX8W9V9tI iTdxBwlwudg/AvlxjtMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqs-00HRA2-0l; Mon, 18 Oct 2021 23:15:30 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqp-00HR8U-7l for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 23:15:28 +0000 Received: by mail-wr1-x430.google.com with SMTP id r7so44243294wrc.10 for ; Mon, 18 Oct 2021 16:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YpmskcKe71TPZGRhow7F3YV4IIOIX62OuOrpbY+RO7Q=; b=R95yIGBIOzovHsbuuEh0AlNoXkgJIQA4VIfFrsW3weOXNHUJwfVQouzYmwfQf0Q5/x bygwNk0rdMkS+2tulz7Vg5QO5Lfi20Hqz8Sa2oVlNxyXH0xoGbu689gPxWAzLhcVU/dm qQIYznUHCb0kdo5RI9RipcC8wBHy/WoqYqF0suHy/QlTrP9uZvGJBCD2NVeeApQy7czR qWApoy2Pwa70l6UzbKbDZDcqXUzYMd8toiNfZ6tLVcaDKCAHnzw4UB20rp/AHPiwyKRW 6oiOED2MjtaddOLhIExzu97A1lOLnJjWWcT+d21ctVhr58D9vAP3D78DMFxDYY7OwsFH jtxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YpmskcKe71TPZGRhow7F3YV4IIOIX62OuOrpbY+RO7Q=; b=F7q1piXfK2xVkJ66127SbKPXL4gs7f3gcSpN4WY0JZw8M8Rp1HqpavzNFy6XKsokJT imWQ04ee7Yr97fPSwQ2JDRI6GfRq7SR1X9EF03mE7sCOhMdpLPUUZi5IymrkoFKG9Abo A+4QuKpElSmzG22V2KwIYU60pJVcZPFY7GqCQxKy0lCmlZ5CVScDQPjZAT3bSVKtpZ4E eVjLV3ev4OQpHIUQY8DTmtF4+ajPDeexMHzqxUI/rJ/TmxIPQtgeLGaL6Qsxph9kv6fS 4sxwqFBY3QeL1vadqawj6Fw+nwz5SqVAP6ApSpaAsBSBPUE4dUouKIslF+XZkUrw6X0S fTRw== X-Gm-Message-State: AOAM532gfGvD5PJiCzjH1SXhcConwwE0WVywKHqbhpMr9u4DkV409p+E /15NmsE1nEXa8a3KvZlx5a5zcA== X-Received: by 2002:adf:9c11:: with SMTP id f17mr40305177wrc.147.1634598926119; Mon, 18 Oct 2021 16:15:26 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id s8sm3685379wrr.15.2021.10.18.16.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:25 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, johannes@sipsolutions.net, bryan.odonoghue@linaro.org Subject: [PATCH v2 2/5] wcn36xx: Fix DMA channel enable/disable cycle Date: Tue, 19 Oct 2021 00:17:19 +0100 Message-Id: <20211018231722.873525-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018231722.873525-1-bryan.odonoghue@linaro.org> References: <20211018231722.873525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_161527_300432_DE0A1EA2 X-CRM114-Status: GOOD ( 14.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Right now we have a broken sequence where we enable DMA channel interrupts which can be left enabled and never disabled if we hit an error path. Worse still when we unload the driver, the DMA channel interrupt bits are left intact. About the only saving grace here is that we do remember to disable the wcnss interrupt when unload the driver. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:430 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org Right now we have a broken sequence where we enable DMA channel interrupts which can be left enabled and never disabled if we hit an error path. Worse still when we unload the driver, the DMA channel interrupt bits are left intact. About the only saving grace here is that we do remember to disable the wcnss interrupt when unload the driver. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 38 ++++++++++++++++++-------- 1 file changed, 27 insertions(+), 11 deletions(-) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 6c43df4bc92c3..b832afedde76a 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -272,6 +272,21 @@ static int wcn36xx_dxe_enable_ch_int(struct wcn36xx *wcn, u16 wcn_ch) return 0; } +static void wcn36xx_dxe_disable_ch_int(struct wcn36xx *wcn, u16 wcn_ch) +{ + int reg_data = 0; + + wcn36xx_dxe_read_register(wcn, + WCN36XX_DXE_INT_MASK_REG, + ®_data); + + reg_data &= ~wcn_ch; + + wcn36xx_dxe_write_register(wcn, + WCN36XX_DXE_INT_MASK_REG, + (int)reg_data); +} + static int wcn36xx_dxe_fill_skb(struct device *dev, struct wcn36xx_dxe_ctl *ctl, gfp_t gfp) @@ -939,7 +954,6 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) WCN36XX_DXE_WQ_TX_L); wcn36xx_dxe_read_register(wcn, WCN36XX_DXE_REG_CH_EN, ®_data); - wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_L); /***************************************/ /* Init descriptors for TX HIGH channel */ @@ -963,9 +977,6 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) wcn36xx_dxe_read_register(wcn, WCN36XX_DXE_REG_CH_EN, ®_data); - /* Enable channel interrupts */ - wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_H); - /***************************************/ /* Init descriptors for RX LOW channel */ /***************************************/ @@ -975,7 +986,6 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) goto out_err_rxl_ch; } - /* For RX we need to preallocated buffers */ wcn36xx_dxe_ch_alloc_skb(wcn, &wcn->dxe_rx_l_ch); @@ -998,9 +1008,6 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) WCN36XX_DXE_REG_CTL_RX_L, WCN36XX_DXE_CH_DEFAULT_CTL_RX_L); - /* Enable channel interrupts */ - wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_L); - /***************************************/ /* Init descriptors for RX HIGH channel */ /***************************************/ @@ -1032,15 +1039,18 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) WCN36XX_DXE_REG_CTL_RX_H, WCN36XX_DXE_CH_DEFAULT_CTL_RX_H); - /* Enable channel interrupts */ - wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_H); - ret = wcn36xx_dxe_request_irqs(wcn); if (ret < 0) goto out_err_irq; timer_setup(&wcn->tx_ack_timer, wcn36xx_dxe_tx_timer, 0); + /* Enable channel interrupts */ + wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_L); + wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_H); + wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_L); + wcn36xx_dxe_enable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_H); + return 0; out_err_irq: @@ -1057,6 +1067,12 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) void wcn36xx_dxe_deinit(struct wcn36xx *wcn) { + /* Disable channel interrupts */ + wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_H); + wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_RX_L); + wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_H); + wcn36xx_dxe_disable_ch_int(wcn, WCN36XX_INT_MASK_CHAN_TX_L); + free_irq(wcn->tx_irq, wcn); free_irq(wcn->rx_irq, wcn); del_timer(&wcn->tx_ack_timer); From patchwork Mon Oct 18 23:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 515929 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp32662imp; Mon, 18 Oct 2021 16:15:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh4aNJ2sQWyWdQQi1db3ohljlsNiPET2gUhrqFPfOVOeHUS2W7FJOJrqsx8ajhzBnlpmHd X-Received: by 2002:a05:6830:1e08:: with SMTP id s8mr2297933otr.305.1634598932623; Mon, 18 Oct 2021 16:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634598932; cv=none; d=google.com; s=arc-20160816; b=EbqpAJjwDM/csKg5zC2NuVF1h9bCxdCkAnpreerd4aWQwOPsVWY6jrPEz0sg9vzMpA IMub75gwJ8zqDnOGatWwIIWdn7K0w3CDo9+xfcvyeNf8Pydtd7ufnXTa/Wkx3VRBUBuW 1UVA8qhYiTVxBoCySM+g2WySsSeOgsiMxlS/LzhEICEIfUgQPXf/7b9Mpzz0QE89rjM/ 8B/6mHRmdeXkh4mXPnD7SoK0H2fTwiPgpgwVl1z4g3XVypnFD184gz2pUNV7Rc4OrQVD WVVj9kk+mUpZbrCSXBd3AcLwl7rQSjuP9c7pWzLM7VMv8B1EbL5pzHwALW38Aey/Cxio aZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=FqUPKgj5yHYE3zJUvTHVrOHiS93X5SG0Q9vpCstQOE8=; b=luY5q1/MqMSiG/aSXvENTf+H+ykkusdklcNd/ChdyvoLrpTMUZQMjsNDbGGcggQ0+a dn/2Lfp4R22z7WuI+AEdII8TEoi2qvY54z6KdFqBGmQMHnlrQhoB/NcAldK4kiG3N4Hb Eb25vqZF6kd+5g9LKWn6s8tuMz5ezF0cfdx9pEbCjPev68p4pR+KI2mrhr+7whMoY48D 1BpgmeUhdkdLIZEU/pxZbrw4JuZtRUGw7x2tL7u/hWxTX5H3n8joIylbSvaVArDdldRW DpSw5vt0z0MifBWE1A1wwmDWzpkZB6AXQP8vbzmzGIDAViskJAnK59PYJHBi+jis9pPC ZqQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=fhh6L8SU; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aFg91Sh9; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 92si16390533oth.115.2021.10.18.16.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=fhh6L8SU; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aFg91Sh9; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FqUPKgj5yHYE3zJUvTHVrOHiS93X5SG0Q9vpCstQOE8=; b=fhh6L8SUqUva7p 3Mf9SBY6SeC1sHtsBBaeFKg1wUHy9o3Rx+x+7F/NahdVj6AWmVRQSBsgDoOdu8V+F1oJnKjtpNYxs GVFP2trMUizhZ0E+y5JaVEw/7VD5wHYp5yZ5k4Dnh0hsT1ItEm8siiNhHwfo4Or6ZesL3bNoxx4hi CHM8zu0tM6HGiRm1WSmsGGpETPEPW2kcwPg+F5JCUBWztrv08ACg+OstiLwiihIXL0C5kY5hvzzBX nK0iVleaJg8PYF8YqcAr0e40Y/eOctetqveCz30HQbeeTQVfcaX0mQ/5iqxk1cAGDf79bIPq5Rq0d 1Zn0QSBjzNSPXW5Fhtbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqt-00HRBC-5W; Mon, 18 Oct 2021 23:15:31 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqq-00HR91-M9 for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 23:15:29 +0000 Received: by mail-wm1-x32f.google.com with SMTP id n40-20020a05600c3ba800b0030da2439b21so777151wms.0 for ; Mon, 18 Oct 2021 16:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QBnRHV9rerfqg5IbeiF/8rK0T34zBtjkpRvTdqdQUlc=; b=aFg91Sh9YmPW83M7zi+C8pWgz62P6/sn5LKCIc9U7zuatO2d5tXhdcNnFqrVmF5+kD MqFLmWBOxaq4QZLDqitIM+SY+FSUnT9wMdAADtwfMpVcJ69bTwjVWZMek+sw/yUTsUe3 y7NIksZ2WyGbJxBQmmkvIUTjLA17fNheH9OKFf0j28dprpaGdNkEdFUJJntMlRASQlMz OnvIfli9ErvH5YbHqmnM2pXqY3sLMgJ6QRC9j+BLygiz8XxaVkc2riPJIX2EjYVdIe55 SgXLXHiY173sCqYAWfUiZFZAdjiXyvbPfwlTRo1e0zuwRGqb5Wi1fTMlhKt/9+9Dof+t fgvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QBnRHV9rerfqg5IbeiF/8rK0T34zBtjkpRvTdqdQUlc=; b=lh9ypgKeBH/Ikc0sG8+ncuqzdUf3gKY1V4DO0I68IgWQSf6PQ5XuSoUm7HoyLEu5D5 yDC54m0cbk3JYZQNpAEp3O+Sj2U4fRtYK3CRBqayTgsUDs9BzzNeVLbMO8VePJCd0tND rEN+QXvksXrIbfs+JOPSvAkrbdJc/IJcLm+i9akCyHdxciGtIcb+vuyl7LY5a6oGPrue 5f+VYa+xqd2aBuw9gXnSL1Wlf6woLTbPsExqL4eCMGG5aCmgQ/OiIFwALyJdpDPAycU0 PZucO77i5ZCkWo76lhyI0izoN9BacQ6gT6weK4fXfxCnv1UXEQWgLMGwJ9hVl/8wAeNc 7FtA== X-Gm-Message-State: AOAM5323YAXfWnQsD32sxiV1OEY+T7uomJS3q2PHEM32g0lhXRzqdu6C TrayHRVs7LeifPhmfN0v+KPZcQ== X-Received: by 2002:a1c:5417:: with SMTP id i23mr2014312wmb.17.1634598927213; Mon, 18 Oct 2021 16:15:27 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id s8sm3685379wrr.15.2021.10.18.16.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:26 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, johannes@sipsolutions.net, bryan.odonoghue@linaro.org Subject: [PATCH v2 3/5] wcn36xx: Release DMA channel descriptor allocations Date: Tue, 19 Oct 2021 00:17:20 +0100 Message-Id: <20211018231722.873525-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018231722.873525-1-bryan.odonoghue@linaro.org> References: <20211018231722.873525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_161528_759606_50F0D85F X-CRM114-Status: UNSURE ( 8.37 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When unloading the driver we are not releasing the DMA descriptors which we previously allocated. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 5 +++++ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org When unloading the driver we are not releasing the DMA descriptors which we previously allocated. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index b832afedde76a..30f4484b336c3 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -1084,4 +1084,9 @@ void wcn36xx_dxe_deinit(struct wcn36xx *wcn) wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_l_ch); wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_h_ch); + + wcn36xx_dxe_deinit_descs(wcn->dev, &wcn->dxe_tx_l_ch); + wcn36xx_dxe_deinit_descs(wcn->dev, &wcn->dxe_tx_h_ch); + wcn36xx_dxe_deinit_descs(wcn->dev, &wcn->dxe_rx_l_ch); + wcn36xx_dxe_deinit_descs(wcn->dev, &wcn->dxe_rx_h_ch); } From patchwork Mon Oct 18 23:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 515930 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp32671imp; Mon, 18 Oct 2021 16:15:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu3/bQx1bqXXFfX/4yp/n6UMqqHbr8WW6A5Jaj26c7AU+xkFlwyTC6BW2Zx+3KlNgbYZms X-Received: by 2002:a9d:609b:: with SMTP id m27mr2280335otj.51.1634598933646; Mon, 18 Oct 2021 16:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634598933; cv=none; d=google.com; s=arc-20160816; b=Ot0joIJhcSaNOACkA8vMRf7gzZBJgzHWqYZqFcwXb9zZAFshuCcaFTWhfvaPPE64yJ i+70O7WlB/yWMbURiiWXthS1CWcWdOcjw65VCZiVvd0B88WAC1vTlgLIfQ+edUKqsGN1 ydIv2oV7WxVvTCwIzna1WR56wcVvF04qX0XqOzOMBsYW8Uh2z63apwwVCmhB6fhlise9 nw2dQx8HD3MmyVLbPhjiiouLJs35cPcpa4098Ki3tT8qhiCmpjK9ejLOvBMuonGXo8ie 0Z3qvfnbqWuH3/7N22yLpd1hfssPwqwpDwFi3wOenowptB6mpwY9zsP36sqnP8x9AGpb GHrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=Z2EhmtitNFkcrMvN/Vk7L7tappMnXEQJrmVPcBHgSDQ=; b=tX2Qo7ckruPnawJILzQItOBL/1tzKdjMJwG4/kVHdHTVrPBEZLVzCIL2JFl/BSWT2+ k6pV9/9mkLKo3DEDoOq6mWGHCC+NA+/zeDoCfqhBh6IojiakzVStmF2wbAf01KiA8TlV uYLepbBOFoqvoTmiwKOcIiFk5yiIFa6lgU8EJ7s7tIQZqrrFJE3nMMkeQ+Sb16PKRJwS +FEcVlpQ73cjhnM02Vrkq8feYpG1Z7Uf5i8vThJSoW2ODWn4Pnr+36rnBI6/Tc0Pe5pd RjrYZQAJlwLvQOnJKyFNt8hcu0j2/34tqvwH6nr58oB1dl0ZxjcA3KODpNwa7NpFNFMO LbnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=5AsRKWuw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HPfHLoDq; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c125si13573060oif.249.2021.10.18.16.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=5AsRKWuw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HPfHLoDq; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z2EhmtitNFkcrMvN/Vk7L7tappMnXEQJrmVPcBHgSDQ=; b=5AsRKWuw+tFEeC IL4gevw40DiwfVycha8IWAyr4ViNCjVhseGvcSPteYcDtNM+1zxJwtOLnfM1c4LQJkFErk8L2C1Hy krKynhNVoD1HrNcQ+zOSepHab/WoVY0KhL9iIFWFB+QojYwzszSAP98ad0FuiLjvIHr0RdgEqDVyU g8czvcPHP/ccwbFvIXfXo8LBlNlCXd2xib7Q2/XHN/6FLhU80DMpC4H/KVhQ1bOMG/xyh8Ic+szvs 0M9TSwmzrMiP48xt+HHBumsk9wZRkevXl2jdbrlwth7teYjQXhH60QoTSWySf9ISVb7mPPKegmWIR TEODLJpK41yc26f+fxgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqu-00HRBx-9U; Mon, 18 Oct 2021 23:15:32 +0000 Received: from mail-wr1-f43.google.com ([209.85.221.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqs-00HR9Z-2B for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 23:15:31 +0000 Received: by mail-wr1-f43.google.com with SMTP id m22so44363870wrb.0 for ; Mon, 18 Oct 2021 16:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ums5lH5A6tPRuZbLiAY6nRVNCSm8UQRGQFhKC352/Xs=; b=HPfHLoDquM7RwcND+vgWYueLkNiO7PWgpgDB78EfJZCLRozaCjUGgUBe+L0EkWBs8D oe6kjBNWVhYB9ZQfRQ63pxsrtBbEB94++LbfWizDhOHCG0Dbp1oCzZfIAOtiwSNR2jJX o99ktNMwHwoiVNlLuFNxqqoZPzqN43TfVTv6ckG3PiPXFcALOxxMVkTmoyx8g3ay2at1 Ogqqd8wsWOJg5RKDO1SdNR27TcQFlKJHdlvjGfFFuCSzYQ1go/ImvAT8OE53nt5thYL2 h3GHSNxkMmuQ2LBA9X09Fji001m00w2y9n0tJUv/irXZeEvGYOPT7RhsiDW5I7dQpeWr rgqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ums5lH5A6tPRuZbLiAY6nRVNCSm8UQRGQFhKC352/Xs=; b=m50OgynRv1W2SI0cHVzqPWPOR1HYw8EAo06NUYt4UAe2xO52NtpLK/wacfwJqD1swf oDIFz97O0R+lDL4x/F/XW7llBCCoB/AjpBXZ8vneKsZGJoxW4YE8N/lLF71sNLeG5bLE bae8LvWuQPaKPr99jE/8YSYHv9IQihPCkWtBS+xQ109eQA77hr1YWB1VUvws+4/Gwgm9 yZaCGKq8+eBh1FvdROb2pnim1kuDFzvJRtyleHNv8kHKxtQOeNi85SEiByz0cAB4fQUH N9j46crm+DVkEYa2xfiagruaeQQ2PYqPCjd9Z5Z3h817ZrPpjn7uKuJRXVocgwkLkTTV Zb+w== X-Gm-Message-State: AOAM532zYr9uGhOzRDIcE0YYYJvmGXHbRPJW7HxWKXMgNB8hCWT0cWlj Vb/eEimNuHiVkrxmW8FOCqcq4w== X-Received: by 2002:a05:6000:1563:: with SMTP id 3mr39029542wrz.20.1634598928262; Mon, 18 Oct 2021 16:15:28 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id s8sm3685379wrr.15.2021.10.18.16.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:27 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, johannes@sipsolutions.net, bryan.odonoghue@linaro.org Subject: [PATCH v2 4/5] wcn36xx: Functionally decompose DXE reset Date: Tue, 19 Oct 2021 00:17:21 +0100 Message-Id: <20211018231722.873525-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018231722.873525-1-bryan.odonoghue@linaro.org> References: <20211018231722.873525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_161530_143780_88564769 X-CRM114-Status: GOOD ( 10.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A follow-on patch will reset the DXE block in dxe_deinit. Prepare the way by first functionally decomposing the reset. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 11 ++++ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.43 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.43 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org A follow-on patch will reset the DXE block in dxe_deinit. Prepare the way by first functionally decomposing the reset. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 30f4484b336c3..d4f5746d9b10a 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -919,12 +919,19 @@ void wcn36xx_dxe_unset_tx_ack_skb(struct wcn36xx *wcn) spin_unlock_irqrestore(&wcn->dxe_lock, flags); } -int wcn36xx_dxe_init(struct wcn36xx *wcn) +static void wcn36xx_dxe_reset(struct wcn36xx *wcn) { - int reg_data = 0, ret; + int reg_data = 0; reg_data = WCN36XX_DXE_REG_RESET; wcn36xx_dxe_write_register(wcn, WCN36XX_DXE_REG_CSR_RESET, reg_data); +} + +int wcn36xx_dxe_init(struct wcn36xx *wcn) +{ + int reg_data = 0, ret; + + wcn36xx_dxe_reset(wcn); /* Select channels for rx avail and xfer done interrupts... */ reg_data = (WCN36XX_DXE_INT_CH3_MASK | WCN36XX_DXE_INT_CH1_MASK) << 16 | From patchwork Mon Oct 18 23:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 515931 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp32701imp; Mon, 18 Oct 2021 16:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1WRa50tvPaRRJAgepjtYE9+1umpp3ZhET/k3ckyXf2DlJ4SDzgpto3ZYWdVhoKJO2/f8q X-Received: by 2002:a05:6830:1656:: with SMTP id h22mr2255244otr.123.1634598935783; Mon, 18 Oct 2021 16:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634598935; cv=none; d=google.com; s=arc-20160816; b=0NxYD2pmELwl2IDMxkxX6aEUqh33FsHnBsVkuioumZiiIMlG5/N7fTbDTUA2uUWUb0 UKzwY4jchAcbTnA6LoUi91rPw3B+9pNHKvOL77TN9Om6/N/HOzR6mOoWjVoD+VkR/NZF 4L4zBDU42SPLI17SqUwjVdKYQySKA+TOHJJ4CFgIuz1F14Rx34/s9Du7ZTZhAEr9gt/T Bpd+Nf+5n0eM6nDRsyuP7bRnOyL7awPBFmVzhnrHZn/D/fcoL0DrziJ8k6IdALz5vc4e HwLm2IowHqMLiRCpLxQjWH7rxLtfx52U30lFSVHbqFZjQfFwyMd7CUhAvkfD5em3CF5k 2K5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=jc55AFFekw9X6l0tNOCBhlmrzzfkpts0vjuTbqPx/vo=; b=j6aAdybYLv1Q7xNlImFOoYET94XMDgouAXc/hXcwlvsBOgD4ZIbd1gsrR3Iun4FcDH gS+wStkqIUYJt+e2odhbGtC7WcxQ7XkEGw+Jy4wsttzHSaLGP+suLnvm/fGQqGMuoMTC B0XwXlt0iMiEJ0HszYV+J8FpIhW/N748i9M0yWs1yCZWdUyFi6LFmE6qcH2WnXEoIYZg tnBc3N42IFsUNzvx+tGNyez1fLpzv7eVvKiCkPJ3rt8H8BxFhCEOkIjp/IGaMFuByIlM gm/HaeBMCsPyEgEyZudU5D9aruen+tK5RaPt6DGD1fIHmaf9AlxuvnnoTyLpqMnSo9nB 61og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=i9M9NScW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hAIrENvH; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by mx.google.com with ESMTPS id q132si16554224oib.220.2021.10.18.16.15.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=i9M9NScW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hAIrENvH; spf=neutral (google.com: 2607:7c80:54:e::133 is neither permitted nor denied by best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jc55AFFekw9X6l0tNOCBhlmrzzfkpts0vjuTbqPx/vo=; b=i9M9NScW/Aq5Oy ygHyYfp/4yaMkxSRV/dNWf9xb4go7AmhW1q5yfMz0J0ENIWR2tele4Mpam9dyW0CDZp5t16/DItdN 0SsOn93d+uy4Zw/sUmvCNhpM57iAIirVueFNxki+821SaZVH7ZSDrmkBNiqVt15bfF22u3GDAzjTY cKFSaD6zCbB3Qu62y1U5cW20yYRlpDCypDnUVYMY3e96V2OCAiSZLLOjgAKeNwje5uhVz4P6JXJVi I9O74HrJEAGvVoIMRfahT1/8/hhiBe/WSpNIceHUnvA+Uz13DrE8hFgl3JkjiCAgRBFrMfTgD5+Sc KgNUy4+AQHY+z2J+gtsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqw-00HRCi-DW; Mon, 18 Oct 2021 23:15:34 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcbqs-00HR9h-HY for wcn36xx@lists.infradead.org; Mon, 18 Oct 2021 23:15:31 +0000 Received: by mail-wr1-x42f.google.com with SMTP id i12so44078153wrb.7 for ; Mon, 18 Oct 2021 16:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GbLM5Z3jD8SPQEozMJryUhBVooDo33aFTB2Os0auzZc=; b=hAIrENvHRnb4RSIeGT/YWT7oVggO3TgS+sD3kWQ/0yA+1biY1bh6snfeNIpAmdBmmI 2WlL6CSXl3HxWwFJpCPICwkoY/Vyv68aa1khsfHcwcXFiCv6Ql84UDkHa/NTyZTyBGd1 Hzk+LT3iAYZ9F29nfhP7jx1F5+6UtzEwUqUj5J++sefpeUIeVfYhz9beDSqj8pW/3ZdE x49l/OLkuGjxcr8J59p72kTPXqr30JJA9jWIb6uUNNQZEsuGge9NYJajTthIIxN1iylD Ws0sXHCxxezrcf6CwrFKgIJuMD1/Bx/6lJTItcMPKUI31M+2IbXoKLU33l2kGnevv9xy 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GbLM5Z3jD8SPQEozMJryUhBVooDo33aFTB2Os0auzZc=; b=seS7eO2JmduFKJdbBnkZC2dtLsh/rF+BPv/1unGt/mCXEd397l2TrQ/JC37vyHfXTq C4EM67kHBT2ve4nUP/vHxPjBRWHDlVKTq/y68IKAmd3W5xcFuTR5b2T/9JjscZPCQ2Wl 5vUcBXQW78jHC86AdhoJXNHgByTgwcxxR6PKJIbobrvlzlDuFy7Fb0ogL1oFjIz1mmMH qvZC8fvVG7AQrJGB9fpX7ivxiqT/+E71v55l8mJQaYpLdXj+Xx5GVglxoZbBMZFvpXzC PFt+gaMY6wrQIAZuOLSneoOU9A5+9AHsUwK0NmaeqKu99LkNd+9D6QLFZ0ITbgcUel34 b4NQ== X-Gm-Message-State: AOAM532ykE9tNyzU1u8CeJ5yl7mP7Z/oAQfGMP+7yG1e7Cvcaob4DKB9 mzRRqSDtBuh62GZE5Ln/gketgg== X-Received: by 2002:adf:bbc3:: with SMTP id z3mr40159667wrg.10.1634598929207; Mon, 18 Oct 2021 16:15:29 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id s8sm3685379wrr.15.2021.10.18.16.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 16:15:28 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, johannes@sipsolutions.net, bryan.odonoghue@linaro.org Subject: [PATCH v2 5/5] wcn36xx: Put DXE block into reset before freeing memory Date: Tue, 19 Oct 2021 00:17:22 +0100 Message-Id: <20211018231722.873525-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018231722.873525-1-bryan.odonoghue@linaro.org> References: <20211018231722.873525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_161530_607162_5A9A0B97 X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When deiniting the DXE hardware we should reset the block to ensure there is no spurious DMA write transaction from the downstream WCNSS to upstream MSM at a skbuff address we will have released. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 3 +++ 1 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org When deiniting the DXE hardware we should reset the block to ensure there is no spurious DMA write transaction from the downstream WCNSS to upstream MSM at a skbuff address we will have released. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/dxe.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index d4f5746d9b10a..cf85b0cd11be4 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -1089,6 +1089,9 @@ void wcn36xx_dxe_deinit(struct wcn36xx *wcn) wcn->tx_ack_skb = NULL; } + /* Put the DXE block into reset before freeing memory */ + wcn36xx_dxe_reset(wcn); + wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_l_ch); wcn36xx_dxe_ch_free_skbs(wcn, &wcn->dxe_rx_h_ch);