From patchwork Mon Dec 28 16:28:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 352752 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027769ejs; Mon, 28 Dec 2020 08:27:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxas97jVgAQ4sRy/GA9u0jnDJIyj2ZOvxp+ALP/owTYci7vD/2iHV2uIa1gXUBatuVXLYuj X-Received: by 2002:a92:d84e:: with SMTP id h14mr44945728ilq.87.1609172860900; Mon, 28 Dec 2020 08:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172860; cv=none; d=google.com; s=arc-20160816; b=Qnp0zDoRK0xxhpM/9magX3R6ToOk7iU06A4h3eYpza8RZzA3OXR58/oZLbVnVNmw/i euD06XZKiL8VeCvpthELr9v2rIo/Mqu8cqOmhOOVB7FcqeHGhxpL3go8sRP3Pw75+jVV 1pEgizmXLNImFnJ6OfKI2+jbh5GpaKC69OKF+g6PD37iAWHuVIQAy88/YfuVebVHGU73 3l2Wc/gvrOUab0sLOZmR5E4kQS72Kw8fk9V0LjVX04a4zhtBzm/VMcrRh9JmP2xUpEBk q7PwO3OsPHdPyiOW4PbPCcWREpX1ad4qNAJDifRvQ9gaWAVU2bqsaejsmOExite4hlSt WZgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=S1adgKW2786eCox9dJPibfwv2RDSykkFuQ+GS9l0/hY=; b=Q97Lp5fFM/xTGiI4dWEVVRU1cHz6f9me0mNz+O74MIwukeewaKyzD5ryziu+zTUTNy OdXsJZVLCHEWB8oA4FIlPzCKKfW+2F4i6fg5Xts8T7zlrn/LiEphj8ry0j9pwW0Kn2uk xm/POjN5TmORsBaBhCAwc4kde0wqu60tfGvP1SsrgwklphuU/EWL8+q6a8IzTWR/sbzI miZiOqsiIJWkd80MLszX2fTrUUQ0n/T3YfYoZoU66gRmzmDh4BXSVaTaZ8IDgNFQYLR3 6w5/QBHFEcFHvlKYo86DdjMuTvqqDTHOUHj3aq+tpSb3t7q99eBWY7cHz9sItCvLQW1z fU3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b="fY+/h9la"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=vtxSLFXe; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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 merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id l3si5378231ilh.41.2020.12.28.08.27.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b="fY+/h9la"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=vtxSLFXe; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=S1adgKW2786eCox9dJPibfwv2RDSykkFuQ+GS9l0/hY=; b=fY+/h9laBncIqxjf77jn1xWsrU 9bI4RBlXV7KTy/2PPXTT2XH9sFWBjTeurhwj8xqD/VIAEhJXDyNtUEp73D8xYD8fqLVBdL58MfrDT pwZws+CyDCB7Mr3Ml0nei+VNfFF6BA9qJJEaDRZG+m60XzWSJZO9sju1sdURRm5Ncx4vePk+vOXVu ruSqDvK6YsWY0xEi8V4WfZ0GbiIGFx1z5sqHYXL7Gt12Xg+rrPu/dm0XHoUVDzR7xR27H/3s4E4Ym byfrsFJRU/potioN7x3BHpni7hnWMYH/GAb0wVKlRcUYAmfO0sUYoB4Rc/RXLPdcLkFb7SX4FImSh 8H/rWsVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMv-0004Wi-56; Mon, 28 Dec 2020 16:27:37 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMr-0004Tp-9t for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:35 +0000 Received: by mail-wm1-x32e.google.com with SMTP id r4so10191394wmh.5 for ; Mon, 28 Dec 2020 08:27:30 -0800 (PST) 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=gECcxq2qw+zXmYQFUDiMPYjiAGwU+p9TRbbMFSRba1E=; b=vtxSLFXeaHiF+QAOu2TK/wOA3w6ZBJiMrCLOkYIheNFvQvUWhdpzJdN+dkJycymzvm 11suo+VXOmEqxJn8UiSf6Fzx3KdZjwCZ/wpmaNwdi89y2WhXt7TESZAc2dVckRL1cLuN iQVnfwp9p00L7q1n6qSmYkD0WzxAmRLhsREzJD/cPgx7839UAw4qSuEmPTog0p5Pe4a7 t/eC4wz4syf3NvX3sKPWjhvIHgxRvZXRO3eoYCbyggp+RbFXeRZ9NhKC2m11tjO1V1ox /D+j3uLPRnziFl6T3CRaSajtSuoO7jbaASy60h0kVRlDJ08/Kf3AtJXOTpnBSShZ07z8 0DzA== 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=gECcxq2qw+zXmYQFUDiMPYjiAGwU+p9TRbbMFSRba1E=; b=nyO43l9vieyoYB629pC5Q8no51vXmbRQ8xFaESNn3Fy8k1ViKG9BjA0i2tuwJbt+9a 8DXjNKU9nUTjSqRFOobfhCAPNI41cBy/09KsF44WvLA+vrS8pdWQOGnFxV+1ijSDlTNu bxtwonSBUrwde0R36CZvTPn3Z6xAxXAXoBGDotdLmDAY/F2wuofjNHkk73RT2Lx7d3tk GFy5zvUhEwN0vT6amzkgmdc3TTceHD7D4yNjrjiLXOEmEGbCSAdmE+UY7FR8PrmMuAgP e/8MWrNbtnaneoa87bE/wm5pP/xQu6wHUzwW/6Eb6ssdmNWhDdbBcJG5QVq4RyUDDKTH Rw8g== X-Gm-Message-State: AOAM5300rsVr7M806vfTWcRlM/22/53nqfISmQifD1sqh9XxLvZLHUiO jPVi4F5Xd8UdHTMmzTY2p0HxGg== X-Received: by 2002:a1c:3d55:: with SMTP id k82mr20770616wma.57.1609172849971; Mon, 28 Dec 2020 08:27:29 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id w21sm19523379wmi.45.2020.12.28.08.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:29 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 00/13] wcn36xx: Enable downstream consistent Wake on Lan Date: Mon, 28 Dec 2020 16:28:26 +0000 Message-Id: <20201228162839.369156-1-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201228_112733_649574_73FFF788 X-CRM114-Status: GOOD ( 15.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:32e 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org, benl@squareup.com Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 (13): 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: Flag WIPHY_WOWLAN_MAGIC_PKT wcn36xx: Add set_rekey_data callback wcn36xx: Add GTK offload to WoWLAN path wcn36xx: Add GTK offload info to WoWLAN resume wcn36xx: Do not suspend if scan in progress wcn36xx: Add Host suspend indication support wcn36xx: Add host resume request support drivers/net/wireless/ath/wcn36xx/hal.h | 20 +- drivers/net/wireless/ath/wcn36xx/main.c | 123 +++++++++- drivers/net/wireless/ath/wcn36xx/smd.c | 271 +++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 19 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 15 ++ 5 files changed, 434 insertions(+), 14 deletions(-) -- 2.29.2 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx