From patchwork Mon Oct 25 08:28:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 516150 Delivered-To: patch@linaro.org Received: by 2002:ad5:4292:0:0:0:0:0 with SMTP id z18csp781837imn; Mon, 25 Oct 2021 01:16:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnT2xGFE/Goi4kXTBBYmvyW3hXZfQdrUo/Yw/OdTzH3JtnMsGOxwxuwC3IqnxdH3DrYmQQ X-Received: by 2002:a05:6808:1246:: with SMTP id o6mr11082232oiv.38.1635149815409; Mon, 25 Oct 2021 01:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635149815; cv=none; d=google.com; s=arc-20160816; b=bxRl2jHjlONT6ZdLwKMt5v21UpyAA9neY0vNOyq58F33yXvtqvjS/JC8uaeVXrSiHP 8FkbmhPN11NjWRP8O/qedZGaL5lxIcU0KkjGl8abt9HeQuTypGnalUzIb3Inp2AWMQgy QlFU9sIiLIVJ9Da22zmwulQMNcuDHK6AKx9XHa0gwPx/2tyOUPE2U4Q/v8vgBXGpTcMe H4bZ2/OIwjdOYNUCPqGBoyE+GuZmU0RphRN3zSzmO5qbRMlXyY3ySNJ2aRUJdeqaVF9+ nEF2ZIXriSmiBQba1x/lXTaR71LQqYGvPMXo34hGMRO599v+wfXh8qZqnxS9CvXdgQIC wnFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=i6KI/xSN9K49HKGJntuaEWfDoUoOs+f8DiTxtkPfnqI=; b=RhsQlbRZ3PUDpytcfeSKbBCbXu4l6qzpbOMoYcPc8ma4zq62dQif8ce3NIB//jE6pX 232HIii1DODkaSRwDmtNSBc+rOBthuzFW0v5GlKAQQA9m8OgfWjR46VcmmJDC7spFEQG sfpfdhxvwVyvtdNhNGYTvC9QYxfF3PlFQjbCeQf4DceXQtyOKgLTdwecY4lLpwZMxUTA 9VfmSIzIFMH5uIGQhoAEVIKq1NYykcH1VprYb+6Qk4AVPW+6h5EYubpuPQ3qXOW7WrBS Jnsg9WxCCER1baG9CACOK0eECQxyhM3mUrM8xyDbKutTJBmySF4udune/j7jriIDjQCg xDbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=lC6uL7mX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iSk33Ikv; 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 w194si16819831oif.201.2021.10.25.01.16.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 01:16:55 -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=lC6uL7mX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iSk33Ikv; 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To:References: List-Owner; bh=i6KI/xSN9K49HKGJntuaEWfDoUoOs+f8DiTxtkPfnqI=; b=lC6uL7mXIqpj3O xWhfpHSTrL0byxQWuYIV2Wbv6htdhJelk65mkrJ/NQtjJv9etqc/7vTaQaf9ATeG4XnA6TqKCnpKm pjhxnrKINzETrcpPFbV9a7FqwX26K7n4oKBf/CLRvbwKhskUZcBksYCHEVrQZ2ZF1xsp7lNPu1d7p NMfvuysrioPVGmZp3T37IbQ/LHcCny9V76JurAIMm3TMi0y4OP6ImRC2sX2KW19XYalSF2A1zqMTd fcnmc0kdI+JwYiI5zNWk/JcSdlZAQS/kCXQoSRIOeyaxaqs25PyhmnzqX1SutuEbJpc+Mstp2GKja LOCnbgBLG8X3+cICGY4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mevA5-00FlD9-W0; Mon, 25 Oct 2021 08:16:53 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mevA3-00FlCT-JT for wcn36xx@lists.infradead.org; Mon, 25 Oct 2021 08:16:52 +0000 Received: by mail-wr1-x433.google.com with SMTP id d13so8775297wrf.11 for ; Mon, 25 Oct 2021 01:16:51 -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; bh=/ONHwovzGtX6c4QtNm3dsEQglHqM8sqBpiVTMmVOH/E=; b=iSk33Ikv4ZsQOw+/PcaHGspL+SDokjPfkC0ZtGZIpGxaQyk4Sn3FNO7KwZ1IkeAY6C Oqo1WlySWRS3Xx33kaIVxgE3PB00n8WCJSU4HWzsjkgcN5sGCnzdq7/UTff1oSEsntrc pHViH+xb7/mUccTwDjtOK7bE/Op+TFLCyNn42OB2nTHFNqd3v2bTZBLK+Dp6gBLhpxmQ kHRsoWXHZACOjz4KHFUEqlXG/yMKzB6M3BuFGlANcq1KIeJa0fHxRo64GYTdG3SSXv3N iWCi3ZgJ90cTSBn0JlXCmf+5tOkvh3hAexJVP9iY0UFMUWimO3ihY0JcIGhGmgsOf/xl MqKw== 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; bh=/ONHwovzGtX6c4QtNm3dsEQglHqM8sqBpiVTMmVOH/E=; b=tqGZyXeeDzVlvw32E6HgN4jWhsjGjv0fPaoJ8ZWBCnk6g5VgF5dHg6dfsjmZHLLR9a gpzuzosqFgctBNT82DiqSxPmNKVgbVxooojpBwTREMNB9Lu8a7tU0riQUCQZ3nUXugBW ULrApmvj6sHB5xgFAURtPApHYLJzCMh8mrPlz6gmq9/DwNjSxKFY52yi1WVLkGBoU3Ad qawUg8rWP6INm5jumYVVNJwrpT+i0qne+2m55DtPQ+0h7aiWuby4UJwPAzLFaBmtNg0+ QlHFHjNMicXYokGMsPJYvd4vwtAglDfHix3SEaR82XqwJ+kK709Zl1g1sVv0JVPfMYKE k1rA== X-Gm-Message-State: AOAM531h1BU4qmTtsV5iNJBODiBbYXoahtjhOdfekVfFkS8E1XUpo2hN zK42525BUAjn1DHPb1OgP/9nMg== X-Received: by 2002:adf:e0c1:: with SMTP id m1mr21987545wri.241.1635149809805; Mon, 25 Oct 2021 01:16:49 -0700 (PDT) Received: from localhost.localdomain ([88.160.176.23]) by smtp.gmail.com with ESMTPSA id 12sm6409449wmk.34.2021.10.25.01.16.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 01:16:49 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, Loic Poulain Subject: [PATCH] wcn36xx: Fix packet drop on resume Date: Mon, 25 Oct 2021 10:28:16 +0200 Message-Id: <1635150496-19290-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_011651_663982_4ED8A747 X-CRM114-Status: GOOD ( 10.77 ) 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: If the system is resumed because of an incoming packet, the wcn36xx RX interrupts is fired before actual resuming of the wireless/mac80211 stack, causing any received packets to be simply dropped. E.g [...] 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:433 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: , MIME-Version: 1.0 Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org If the system is resumed because of an incoming packet, the wcn36xx RX interrupts is fired before actual resuming of the wireless/mac80211 stack, causing any received packets to be simply dropped. E.g. a ping request causes a system resume, but is dropped and so never forwarded to the IP stack. This change fixes that, disabling DMA interrupts on suspend to no pass packets until mac80211 is resumed and ready to handle them. Note that it's not incompatible with RX irq wake. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.7.4 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Reviewed-by: Bryan O'Donoghue diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a42eae6..a650b9e 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1137,6 +1137,13 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) goto out; ret = wcn36xx_smd_wlan_host_suspend_ind(wcn); } + + /* Disable IRQ, we don't want to handle any packet before mac80211 is + * resumed and ready to receive packets. + */ + disable_irq(wcn->tx_irq); + disable_irq(wcn->rx_irq); + out: mutex_unlock(&wcn->conf_mutex); return ret; @@ -1159,6 +1166,10 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } + + enable_irq(wcn->tx_irq); + enable_irq(wcn->rx_irq); + mutex_unlock(&wcn->conf_mutex); return 0;