From patchwork Fri Mar 19 16:15:08 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: 404809 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511052jai; Fri, 19 Mar 2021 09:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIvEDsFKve7v+q+Vuau2/eBgp5Kdatnpo9Rgn6fEVxH8etNyJhS2hr0FUmTvGMbB6BEzWC X-Received: by 2002:a1c:c244:: with SMTP id s65mr4426194wmf.96.1616170440996; Fri, 19 Mar 2021 09:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170440; cv=none; d=google.com; s=arc-20160816; b=Oy5GcdCLInyNZt6gaRX7TXjzrP7FtTVQBIxhA4Qu9vdRMt2v1bPlXkDQxuThPY+HNO RgLLLQcpuyYE+aJXzs0AIe6aXoGu0W6OvAfDwT/n768VZ2xnxbJUGHUeps6+3mUL/i1j WDihi0G8OWpNCMgnWyEJcCUorz0oqnyiWisbHSJOoiw9w6I+E3y6Giz1kcNK7JfmKGN+ zcIZ4guITYvW3RQR3vlvgop9nBDiOQ4uF70FP6bIcMMblLR8SCyc64G2Ga85r0+QHIwo nO41UOzygNXYvG+f7EtTNipZpR7284gaDjcvzNdG0RCmlyIYd6abfLY5Ce4W7tmHSC4T n9BA== 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=Yj8mEaBk8IrNqzf4k5GlKAiDlC34PoUFf2e3VgSjfbs=; b=LMlBtPtk2171w1lVV20UZae8YVsdMOMua75kybZRaNptiaMI82iG7a48iRIiwNUeqq sEa/wk5eEmdTdAeDhvASx1BWLVyCt8qGg32Tb019rBNnD+0bda+aXYGJPBwexRKZfDjC bbIZm14/oF33DNqBkqJqm895WbPrrQFPzmJRzuvyJauU/4mH/Ea5XHq2MfxiOPV+++NG 0bMOczxT5ixZL6iYIgiSJvuXp+nyeEeB6ilDlSHyinYnxIPyX+lrHUspfvTRubq7dzFy 8bKDA/5kW9fZMS6Lgfsygf8PH2DBwUbtgLoq0HxSmndceybenvE1PvaaKy21M424gvGy iYxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=Bzc58liz; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QTyb0fDo; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id u13si6698001wrq.279.2021.03.19.09.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=Bzc58liz; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QTyb0fDo; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=Yj8mEaBk8IrNqzf4k5GlKAiDlC34PoUFf2e3VgSjfbs=; b=Bzc58lizlI+ep6/o9NEkfWTVdq bfFoB/pv+byy5gqcEF9PiRX4axzi2IFVSEVVxYrmMsqZv1velAShaGrHS14nCPa6T4vzF9U/x/Qyo eMZ+haBfFv9eBJJRqlB6uQMxmS7mx5BoktPwsKRCfHJ4+fQ3UVnhNQKkOSC8Tas1RMet3snbRXhcK HUnmzsBnSkDwCfaL60yYiq5O2agNEEMEVEIUFyuJURD8Jvjr2gbADQjvbBSNeRTLBgLmI4faQgVIp rrXpHOxUlK9S7joX3aDDY2igK51yJkA3RraW4erHDYp35OT0RUDHKtUB+Z1A+dTfPJnwbkqpNIgdJ 26py/pRg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl9-007fp1-54; Fri, 19 Mar 2021 16:13:59 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl2-007fmm-V5 for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:55 +0000 Received: by mail-wm1-x330.google.com with SMTP id j4-20020a05600c4104b029010c62bc1e20so5537688wmi.3 for ; Fri, 19 Mar 2021 09:13: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:mime-version :content-transfer-encoding; bh=okuKe8CA+ab8LpK2nHrz2TjkjOWAoDIz/1AJJ/f6Yvo=; b=QTyb0fDoJRKKgsn4iczhJTDMWyjPLmqUR8H/WbXZQiSLWzJcfwpESYJQaR6Ys+5nWK 8aatYCX9/918qrwGnMhgwyhWx3KttUmMngd2mT1HcFJNauKXH05BOZCJSmdmxg6GZG5Y /aGVfB6SHRj4/QRNc8M7ONbG99k4AQZPfugLkzx7lxpXnNIQYZgBvKlYrLIxCcvkKOCJ 16HYWJUDyYpWbrAbs3q4ZVSnvWBTG+YOdcr2LGJjd5uHlwkP/3DG/0Xj1N5/llmAjGEd kNkpnmagf9nYMvoVvmodNNJ02QkP0Z7G5AzKyiUK5w/50tS9FlF9CQtny1rQVEvolRRu YsXw== 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=okuKe8CA+ab8LpK2nHrz2TjkjOWAoDIz/1AJJ/f6Yvo=; b=hgJ1L9xVNzbIzcThyWeMxturHYxqi+qYlgL2GWz0k8w3piLPoElkKtuhGlzmpXJ/lO DcMdZQBTHdvF2VvmF+G9snqq4DjvXUpXnB2Z133ux4hKx+qqkjMG5Y13XuGjm7ZfZM6L /2zjM6CZhEW5E7bh52Me2HW/z2VZJPcEv/Hq7bZ9MQ298envC7Sw4acCRaGXl2DwX9M4 F8XmkonN3gjL6AiyN49nu7STX0DVUMXVRr866f356nOa5fx8dVKgbxL7ntRS0XHQgMds EAdfhTmpVegAAGHc1Az44d7dnguUH59K4GAvAPWyGJpmeg3VvI0r2v0xKdBzPdOivQys QbdA== X-Gm-Message-State: AOAM533T173gDiEBup8wQnx1zOFgGliVQ7318FhJ9ieKQRI8hshk3jL4 nbK3siGlDL+5QrRPReB/D+u/Gw== X-Received: by 2002:a05:600c:4f14:: with SMTP id l20mr4352720wmq.71.1616170431461; Fri, 19 Mar 2021 09:13:51 -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 h8sm8432495wrt.94.2021.03.19.09.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:50 -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 v3 00/12] wcn36xx: Enable downstream consistent Wake on Lan Date: Fri, 19 Mar 2021 16:15:08 +0000 Message-Id: <20210319161520.3590510-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-20210319_161353_221806_4A19C990 X-CRM114-Status: GOOD ( 16.69 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: V3: - Ifdefs an IPV6 specific function which will not compile unless CONFIG_IPV6 is swithced 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 lo [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:330 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 V3: - Ifdefs an IPV6 specific function which will not compile unless CONFIG_IPV6 is swithced 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 | 118 ++++++++- drivers/net/wireless/ath/wcn36xx/smd.c | 265 +++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 17 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 14 ++ 5 files changed, 420 insertions(+), 14 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Tested-by: Benjamin Li