From patchwork Tue Jun 1 02:49: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: 451342 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331352jao; Mon, 31 May 2021 19:47:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZHE28aUVHlwEx0sXfb/2zIqbA4XFTYNZgC4cV5SEYB2u6cMD7vb0vl7ZSNykh8BcJEPE3 X-Received: by 2002:a63:2bc1:: with SMTP id r184mr13821227pgr.10.1622515663395; Mon, 31 May 2021 19:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515663; cv=none; d=google.com; s=arc-20160816; b=URHwGGLjOUh1VFTcYp19cGqO8fMiifZKhXs8GDcjBY4414PJ7sq5voipo4QgY+1Dxu HDFOjZ2nBlixOFUu+wauHpSfnaCkOVuBYnm2cDf9VkLcBIJaW6rrlMrLGPYiNya7qUjZ YJnwggcw2OOR2wxeUQUQZEtHQ0yi9DJR/KNbNpB1qrUOqYqhSKQumNlwLeEtkXfVxb3/ EjJiO221NRL0V9XV6AbAUAqtH+0vsdN34gSLnZS2unFGkv68XgpTc0X113CfZD4mQPYO eoA+xo2y7dAkJdLdeoJZYZdv9b/P/zS35FbsIKyoLCxORKI6xKR2oMBDjeUiWUsJAN1h mJkQ== 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=QfUWtbHeTLoTZ6yHy5K3ZuIS+Dcbt/FtDgVTwGKFhyQ=; b=pTNT/6pjt4mdWIThOUfSuYTIGIMtWbFrXQRXW3N1lOtDtPj4BiGUI3BnFvNOVB8SS+ +Hlljm4gPxyGOxUKQI6oiQYp/ooDNHb+iqTu8fMSEnw0bdTPujmQoDXIIj/dwWM9EdIg yUcNMUP35hUMxi8LnzvKCnAvS3v1/0zgLtFsq5dg8zbXuBvZiBCdgQueCAJf0+mk33YK zOtwOC+aahqWV5tP73uk/yNxafZOaVR327Zkgco3zQ5tuHhCQ+KNnCICk4AwbHJ1zOsn wkErokakNeIFGhO58N2kEpBSMJHSaxjJCyuBk4lZ5A1UjF/5TzsMUlN1xhl2j0CPNLm5 qAtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=c5mQHfGo; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gBa3JVfn; 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 i22si17566134pgj.501.2021.05.31.19.47.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:43 -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=c5mQHfGo; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gBa3JVfn; 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=QfUWtbHeTLoTZ6yHy5K3ZuIS+Dcbt/FtDgVTwGKFhyQ=; b=c5mQHfGoUXqMm3 0KsOFENKkrlg9LvWiRi2NI7pGF2iYuVFcosB3LINDy4BezKbivjqs9IlZ2eAFCn8fiVZ56kTsQRW2 Bbi155mQ+VcNe6ZcOqzZ9V21CHF/FNEMumd7+pUXyHV92Q9h4xJkNS5EyVLQcR0LzyBQrhtRlfppk 4HVIVp6BlJum/ezqXyaYjkQilN+m3E1uxvFsyzTVfWkA7sc9LjXTvjDrlRnW42PGNgWTKjS4BUE9N 7rARQhkcFBeXSMPHu2Zq0omLrmFW5UEuzfJGe9Wwq9ecIU7pvoeAuqulMKt/9xVeg5JYPPqUPw8O6 h//tT5mlH8NkzLHDMumw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRS-00EJFp-P8; Tue, 01 Jun 2021 02:47:42 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRP-00EJDq-En for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 02:47:41 +0000 Received: by mail-wr1-x42d.google.com with SMTP id l2so5123315wrw.6 for ; Mon, 31 May 2021 19:47:38 -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=1+HS7tUeKRCOuApaK6WCy3HoJTamuAgVD3+QpJW63e8=; b=gBa3JVfnC5h0SrqsQ/KSVrgJzlCirzK+vXA8T1Iu8zVhw2zy2YdSi1/mBT43IkSaIA xYwatRLPqYVjQs3GfK1XKKpy59tjGS2lnZ1AgxcJ4V752fWn9wKE04hpMNPW1udCO0hT t75X5M2XiWMhDvH6wOXaVa8UVJqJEyoAccsJWvfnYPTKw0SFEVfoi2FL4Vg+jn2E24pz olyT6O0P+1XuxsuKOdT3r3tml06YwQdE43/gZ0iqjDZioPdwFU0qRCAGMDOJQUIW4ysC ZfCNtQIMzC/H0z72wschD2ppMS8AR0MaSWYmMuiheNyUc7r+S6Y1nKw1xJlZ9Zo0hvV2 LA4Q== 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=1+HS7tUeKRCOuApaK6WCy3HoJTamuAgVD3+QpJW63e8=; b=BfrJmjjxWkyuMWV5sXI6HHWZpGSvcmxw5seaG2jPPKnGGIYgyAiSsKEPVIhJvaCZdx jT+kUYvt4+eBWgePw5Fo+bz+fZ/NfxCEdSnUcV1YnuxN9Nk/40PKrcfVc22cSd5KRUIe pB3C4O9QRr/pA2912CsKRbgFuhgKIYRATNE2C7X/nHXIXOHA3Xma2rf5ST+ulnULssxt CbN0l9vC4soMTXD2GV6k8m2VoracdddCUpJGMrYSt6s0DnlBTRewYmK0PffitFwr7skw DtxHcK9rgGFQYXqsXWJ7a5Tn5xxvq6Fu5A5UyyC3uKy/o+1dMbizkHLsHc96ihsEix+7 ftKw== X-Gm-Message-State: AOAM531/o9Z9Ch8+083X3VhwV4p/jq6/YlUDDLzMEhQWXo+EOa/DuiGK tCEpvNiVLY6LqdK1TDYykacYdg== X-Received: by 2002:a05:6000:144b:: with SMTP id v11mr24929658wrx.295.1622515657240; Mon, 31 May 2021 19:47:37 -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 e22sm16774014wme.48.2021.05.31.19.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:36 -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 v4 00/12] wcn36xx: Enable downstream consistent Wake on Lan Date: Tue, 1 Jun 2021 03:49:08 +0100 Message-Id: <20210601024920.1424144-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-20210531_194739_597630_75A5130E X-CRM114-Status: GOOD ( 18.96 ) 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: 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 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:42d 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.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 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 | 265 +++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 17 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 14 ++ 5 files changed, 412 insertions(+), 14 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx