From: Benjamin Li <benl@squareup.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
kvalo@codeaurora.org, wcn36xx@lists.infradead.org,
linux-wireless@vger.kernel.org
Cc: shawn.guo@linaro.org, loic.poulain@linaro.org,
bjorn.andersson@linaro.org
Subject: Re: [PATCH v3 00/12] wcn36xx: Enable downstream consistent Wake on Lan
Date: Thu, 25 Mar 2021 12:52:42 -0700 [thread overview]
Message-ID: <3f28186b-d6d3-590f-2dad-b0e00faf2872@squareup.com> (raw)
In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org>
On 3/19/21 9:15 AM, Bryan O'Donoghue wrote:
> 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
Tested-by: Benjamin Li <benl@squareup.com>
Independently re-tested on Square Terminal with WCN3680B using these steps
on a recently rebased tree (last month).
Used the Linaro DB410c Debian image as userspace & called nmcli to enable
WoWLAN instead of iw directly.
sudo nmcli dev wifi connect <SSID> password "<password>"
sudo nmcli connection modify <SSID> connection.autoconnect yes
# (^ need to set MAC address in device tree for autoconnect at boot)
sudo nmcli connection modify <SSID> wifi.wake-on-wlan magic
sudo service network-manager restart
- arping returns the WLAN MAC address without waking up the device from
suspend.
- ping wakes up the device from suspend (it does take ~8-16s without
LPM patches).
- Device stayed connected after leaving device in suspend for longer than
my network's GTK rekeying interval (1hr) and then waking from suspend.
>
> 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(-)
>
next prev parent reply other threads:[~2021-03-25 19:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 16:15 [PATCH v3 00/12] wcn36xx: Enable downstream consistent Wake on Lan Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 01/12] wcn36xx: Return result of set_power_params in suspend Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 02/12] wcn36xx: Run suspend for the first ieee80211_vif Bryan O'Donoghue
2021-03-19 16:57 ` Loic Poulain
2021-03-20 12:40 ` Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 03/12] wcn36xx: Add ipv4 ARP offload support in suspend Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 04/12] wcn36xx: Do not flush indication queue on suspend/resume Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 05/12] wcn36xx: Add ipv6 address tracking Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 06/12] wcn36xx: Add ipv6 namespace offload in suspend Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 07/12] wcn36xx: Add set_rekey_data callback Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 08/12] wcn36xx: Add GTK offload to WoWLAN path Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 09/12] wcn36xx: Add GTK offload info to WoWLAN resume Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 10/12] wcn36xx: Add Host suspend indication support Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 11/12] wcn36xx: Add host resume request support Bryan O'Donoghue
2021-03-19 16:15 ` [PATCH v3 12/12] wcn36xx: Enable WOWLAN flags Bryan O'Donoghue
2021-03-25 19:52 ` Benjamin Li [this message]
2021-03-26 1:46 ` [PATCH v3 00/12] wcn36xx: Enable downstream consistent Wake on Lan Bryan O'Donoghue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f28186b-d6d3-590f-2dad-b0e00faf2872@squareup.com \
--to=benl@squareup.com \
--cc=bjorn.andersson@linaro.org \
--cc=bryan.odonoghue@linaro.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=shawn.guo@linaro.org \
--cc=wcn36xx@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).