From f0323bfbcde677e05e0090c409db71f9cd1a4ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdurrahman=20Kaan=20Dike=C3=A7?= Date: Wed, 7 Oct 2026 00:37:45 +0300 Subject: [PATCH] wcn_bsp: the firmware's debug log off by default, and a resume leaves it as it was With the Marlin3 ARM log on the firmware pulls PCIe WAKE# within 0-2 s of every L2 entry to push log packets. sprd_ep_resume() turned it on after every resume and the sysfs default at every chip power-on (wifi-start's at+armlog=0 did not outlive Bluetooth's power-on). Off, three mem sleeps in a row with Wi-Fi up and PCIe wakeup enabled slept the full 20 s. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn --- upstream/modules/wcn_bsp/pcie/pcie.c | 6 +++++- upstream/modules/wcn_bsp/platform/sysfs.c | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/upstream/modules/wcn_bsp/pcie/pcie.c b/upstream/modules/wcn_bsp/pcie/pcie.c index a71e7f60..be8c68e1 100644 --- a/upstream/modules/wcn_bsp/pcie/pcie.c +++ b/upstream/modules/wcn_bsp/pcie/pcie.c @@ -1268,7 +1268,11 @@ static int sprd_ep_resume(struct device *dev) wcn_bus_change_state(priv, WCN_BUS_UP); atomic_set(&priv->is_suspending, 0); - wcn_set_armlog(true); + /* + * MU300: the vendor turned the firmware's ARM log on here after every resume. The firmware keeps the setting + * through D3hot, and with the log on it pulls PCIe WAKE# within 0-2 s of every L2 entry to push log packets: + * a system sleep with Wi-Fi up ended at once (FINDINGS 37). It is off by default (sysfs.c); leave it as it was. + */ mdbg_device_lock_notify(); for (chn = 0; chn < 16; chn++) { ops = mchn_ops(chn); diff --git a/upstream/modules/wcn_bsp/platform/sysfs.c b/upstream/modules/wcn_bsp/platform/sysfs.c index 9a99c39a..42cfac4a 100755 --- a/upstream/modules/wcn_bsp/platform/sysfs.c +++ b/upstream/modules/wcn_bsp/platform/sysfs.c @@ -1064,6 +1064,14 @@ int init_wcn_sysfs(void) atomic_set(&sysfs_info.is_reset, 0x0); sysfs_info.armlog_status = 1; #endif + /* + * MU300: the firmware's ARM log off, as in Android's user builds (it is turned on at every chip power-on + * from this value, and wifi-start's "at+armlog=0" did not outlive the next power-on). With it on, the + * firmware pulls PCIe WAKE# within 0-2 s of every L2 entry to push log packets, and a system sleep with + * PCIe wakeup enabled ended at once (FINDINGS 37). echo 1 > /sys/devices/virtual/misc/wcn/devices/armlog_status + * turns it on for debugging. + */ + sysfs_info.armlog_status = 0; return 0; }