From patchwork Sat Jun 5 01:11:28 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: 454678 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp889524jae; Fri, 4 Jun 2021 18:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwnqede0ALGRdcRu8PeKa0rgdqP01M+qi+dX2vMG3445UV+8jen/2YygX2cjK+16AEMWSm X-Received: by 2002:a17:906:40ca:: with SMTP id a10mr6936724ejk.181.1622855467982; Fri, 04 Jun 2021 18:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622855467; cv=none; d=google.com; s=arc-20160816; b=NbsQFDso5pCC2OUHJeMCnYOBCKtFRzEDDn3RVVilItHWDmnuqqpNkEmWD2yCsnRc6T U+5AnixXha9eTyfVYQQ42fyueO2PhdWMlZvAxuWw8KVO7tSLSlbA4Oj7H7AwfmCRDtCt m03ZDveCcQsn7rL3/PmGugrHDWKs8LpNyVA+6DYg9UwaBfB+3Jc6bnB/90GsofK1nN6X rY1cKwrCOxak6Rbl/aTUa2F1RTrRXqnHa+9zXmT1uNov992zKYss29DhjuaI/MbETJ9d H/YzWlV8l7/CjDw+DpJZpWhWmRqINVq9wtRmbixI9VHj8teHuzBVAmd5U7JT99EX+E+i os2g== 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:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=9spwIh9dxJYqbCtNfcLPSgGYMjWQVbNXPWGrs1DEy/c=; b=O795Vj53fHHpJ1Sf8zg8XEQI+lU/an3QNjFsqBnIEMeH5exPBI7O+kC/HdrKISY4MC xFq0ZBqpZnnOV2AeDWZsp346ZvmDnnBnWIkUa1XkB7Pg1SSp4RwK5w+4mNMYuEtC+GcM s/mD1N/5EVh+W7BPpO6kMgBmWz2UDsj8P5aNBsKPA6DrnZ17+wna8Zynvc70xVM7K0qT 035K1eIxbSSBrci5HE04z7pBOpXU8EZbRWgmLpxxUxfp4l28uK6NH2hgtGYHxFPJmC2Z 1fLUzDuzF04hXniUt2V4ubu0TVDv8fO9VSEDHQZ+16IrmkUSbLw2JZY76JWLqUC194xM qmqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=Cox2ljez; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BxMcXrLa; 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 fp5si6171638ejc.316.2021.06.04.18.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 18:11:07 -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=Cox2ljez; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BxMcXrLa; 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: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=9spwIh9dxJYqbCtNfcLPSgGYMjWQVbNXPWGrs1DEy/c=; b=Cox2ljezBdd8Bb gOn8P/DL4A/pxXyfeL5H5X9kSZ94nFge6NgG4bFYY8f+UQQuFdS6/PWRw+g4scjr1e/lPQtk0tr+4 odbiVkIKasUvjubE7AkYx0tnpPfYW+9lJl+5yIUzDpWHeULwtWDT+W1hsn+nQjucGK5FABZzpXHL1 /PNUZIqgydTq29T2AbstJiAkEKzz89XAuVltEa2/Xe7hae/LWMSEhhAwRMrS4vYLukgboua19+dlG 0emMgWVdyuhHSTvfXs1+dD81A+erqrz8jjJvQg6qNEMd+bty/+Sh5wFgpR3kWSrGaxeusIbh7ff8H AqgGqyz8+nDWpFpXz1AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpKq8-00FiEs-TS; Sat, 05 Jun 2021 01:11:04 +0000 Received: from mail-wm1-f49.google.com ([209.85.128.49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpKq3-00FiDf-5W for wcn36xx@lists.infradead.org; Sat, 05 Jun 2021 01:11:03 +0000 Received: by mail-wm1-f49.google.com with SMTP id l11-20020a05600c4f0bb029017a7cd488f5so6543799wmq.0 for ; Fri, 04 Jun 2021 18:10:57 -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:mime-version :content-transfer-encoding; bh=F3eE0YLemFVJ4BnfvSqKcBky+Ny7hEaiWR08mc6OFGI=; b=BxMcXrLag2jZNJWrVqiYyRVGOtl++L6pNyBgG4nDyzFqb0/qkm0kU56mS0d2LV0jFk pK2t53ssln+cXVm3JeKRS6ZsyAbKJei4fSHPIXN0A2EC0f0sXddluB7hIqfO6uwsdPye 9I6GSu9o7IaZz+MweGRmmiiIY/3qtxnN1RTVIu/mf8MjoIw79LiSFkEDrGn/drsv2met ckYq3LztbNr0atNpsS3Gta/1zOSbZF2AZ0PYTwScjsrlbyb0iNOsjLoEt8ewnkEi+trx GDhhOQfBC9Bqjoxrioqz7+RhihoWceeMEojWRm0/5r51t7kybdKvWtZBli6NjtfODwRz 8M5A== 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:mime-version :content-transfer-encoding; bh=F3eE0YLemFVJ4BnfvSqKcBky+Ny7hEaiWR08mc6OFGI=; b=kXP7fdQoegEbmhqv9qfvNWFjDGLv2FvptCpklyke2G+zhdio150QZFUIMZpKZy40ts 2EmQW9rPv7Ht7fCrmrEgRG29+RTswf98GgiN8c9vyW8XfaCsguC1hUio3EfgcQn+OyWw ii8xPAGALoRGJfRlVvUUQo+gcN0D8r+b2mT9W6AFNZqMLGcSnKs5NSwGgvvA7STP3f2S qbaO0JIHGW3LVzL+tCoBoOblZhKloGoHNjsp49XLoOHAjyVgKCwfXC3h97geHpTAaYFB sFyZm8ztmC6UxsqfPaRst/ZUsjAnza5OV9u3QiVVqCypQM518g10B9axu+19BQIwyt2v qA8g== X-Gm-Message-State: AOAM530Oq/doQOAT+eYZdPh1ygdESr6S30Z1KV9Do9UehJ7R1Fk67S1A k/RL4RmOkSoAk7dRoAnrxuYPGQ== X-Received: by 2002:a7b:c10b:: with SMTP id w11mr6010402wmi.186.1622855396686; Fri, 04 Jun 2021 18:09:56 -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 u8sm9594941wmq.29.2021.06.04.18.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 18:09:56 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v6 00/12] wcn36xx: Enable downstream consistent Wake on Lan Date: Sat, 5 Jun 2021 02:11:28 +0100 Message-Id: <20210605011140.2004643-1-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_181059_234713_3BC6E675 X-CRM114-Status: GOOD ( 18.32 ) 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: V6: - Fixes two sparse warnings - kernel test robot V5: - Fixes a git rebase/squash error. A mutex_unlock for patch #2 was contained in patch #3 - Loic V4: 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.128.49 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.49 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 V6: - Fixes two sparse warnings - kernel test robot V5: - Fixes a git rebase/squash error. A mutex_unlock for patch #2 was contained in patch #3 - Loic V4: A few functions need to be declared static which were only flagged by the test robot when the V3 patches hit pending - get_first_vif - Kernel test robot Patch #2 https://www.mail-archive.com/ath10k@lists.infradead.org/msg13558.html - wcn36xx_ipv6_addr_change - Kernel test robot https://www.mail-archive.com/ath10k@lists.infradead.org/msg13571.html Patch #5 - wcn36xx_set_rekey_data - Kernel test robot Patch #7 https://www.mail-archive.com/ath10k@lists.infradead.org/msg13559.html Missed making this IPV6 only in the previous round - Fixed an IPV6 optional compliation missed in V3 - Kernel test robot https://www.mail-archive.com/ath10k@lists.infradead.org/msg13563.html Patch #6 Feedback from Ben and Loic - Streamlines the finding of the first associated VIF - Loic Poulain Patch #2 https://www.spinics.net/lists/linux-wireless/msg209208.html - Adds Tested-by: Benjamin Li as indicated Patch * I've verified this on Debian with 5.13.x and Android with 4.19.x where 4.19.x contains an appropriate out-of-tree LPM patch, to verify suspend/resume with offloaded ARP in suspend for ipv4 and ipv6 still works. V3: - Ifdefs an IPV6 specific function which will not compile unless CONFIG_IPV6 is switched on - Kernel test robot V2: - Drops work-around for scan in progress This is not required on a tip of tree kernel - Kalle - Churn out "this patch" form commit logs - Kalle - Adds comment about packing structures to commit log patch #8 - Kalle - Moves enablement of magic-packet and GTK rekey to last patch This means that the functionality is only switched on when the full series has been applied - Kalle https://www.spinics.net/lists/linux-wireless/msg206927.html V1: This series enables Wake on WLAN for the wcn36xx. Downstream implements two competing methods for WoWLAN, only one of which is used in practice. 1. The downstream prima driver and firmware have a dedicated wowlan SMD command set, however for whatever reason, the downstream driver doesn't actually use that code path for suspend/resume. Similarly the downstream kernel will mask out the SMD interrupt when entering into suspend, so its clear the firmware assisted wowlan command is not used at all. In short, the code is implemented but not used. 2. The alternative version of wake on wlan implemented downstream does A. An RXP filter B. Frimware ipv4 ARP offload C. Frimware ipv6 namesapece offload D. GTK replay counter save/update on suspend/resume This patchset replicates method #2 since it is the only method that actually works. When replicating the functionality from downstream to upsteam I found the RXP filter step to be redundant, so I skipped that. Verified on Android/4.19 with qcom out-of-tree low-power patch on wcn3680. Verified on Debian/kvalo/master on wcn3680 and wcn3620. The Debian/upstream test doesn't include the low-power patches from qcom so the time it takes the system to wake up when pinged is longer. Test method: 1. Enable magic packet wakeup on target iw phy0 wowlan enable magic-packet iw phy0 wowlan show 2. Flush arp tables on host sudo ip -s -s neigh flush all sudo ip -6 -s -s neigh flush all 3. Suspend device echo 1 > /sys/kernel/debug/clk/debug_suspend echo mem > /sys/power/state ; cat /sys/kernel/debug/rpm_stats echo 0 > /sys/module/wcn36xx/parameters/debug_mask dmesg 4. Ping either ipv4 or ipv6 ping 192.168.0.85 ping -6 fe80::6455:44ff:fe33:2211%wlo1 In both cases using Wireshark we see the target system receive an ARP or NS6 lookup and respond, followed by the host sending a ping or ping6 and the target system coming out of suspend. Similarly watching GTK keying on the AP when the device is in suspend, we see the firmware successfully rekey and when we resume, the host picking up the rekey material with persistence of the WiFi link during suspend/resume. commit 5336fad96e8f ("wcn36xx: Enable firmware offloaded keepalive") ensures that the link is kept alive in suspend, this additional set gives the ability to - Resolve ARP/NS6 lookups without waking the system - Rekeying in suspend - Suspending and resuming based on received datagram https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=ath.master-wcn36xx-fw-offload-suspend-resume Bryan O'Donoghue (12): wcn36xx: Return result of set_power_params in suspend wcn36xx: Run suspend for the first ieee80211_vif wcn36xx: Add ipv4 ARP offload support in suspend wcn36xx: Do not flush indication queue on suspend/resume wcn36xx: Add ipv6 address tracking wcn36xx: Add ipv6 namespace offload in suspend wcn36xx: Add set_rekey_data callback wcn36xx: Add GTK offload to WoWLAN path wcn36xx: Add GTK offload info to WoWLAN resume wcn36xx: Add Host suspend indication support wcn36xx: Add host resume request support wcn36xx: Enable WOWLAN flags drivers/net/wireless/ath/wcn36xx/hal.h | 20 +- drivers/net/wireless/ath/wcn36xx/main.c | 110 ++++++++- drivers/net/wireless/ath/wcn36xx/smd.c | 267 +++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 17 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 14 ++ 5 files changed, 414 insertions(+), 14 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx