From b1c3392ad232175be53eccd1454d1c8da1e48daf Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 23:37:51 +1100 Subject: [PATCH 1/2] wifi: apple: centauri: Quiesce Alpha for sleep on every N1 board The Alpha host-power and ACIPC sleep requests are the N1 firmware's protocol, but suspend and resume only ran them on apple,j813. J815 has the same N1 behind the same PCI functions and its own entry in the driver's board table. Run suspend wherever the native driver bound (c->wifi is set, which needs a board entry), still behind the TEST ONLY alpha_sleep_untested switch, and drop resume's board check: it only undoes requests suspend sent and returns at once otherwise. With the switch off nothing changes on any board. Fixes: 4cca392085a9 ("wifi: apple: centauri: quiesce Alpha for J813 system sleep") Suggested-by: Thomas Glanzmann Signed-off-by: Ryan Murray --- drivers/net/wireless/apple/centauri/centauri_wifi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/apple/centauri/centauri_wifi.c b/drivers/net/wireless/apple/centauri/centauri_wifi.c index 48d1deca69ab2..3916292f3133b 100644 --- a/drivers/net/wireless/apple/centauri/centauri_wifi.c +++ b/drivers/net/wireless/apple/centauri/centauri_wifi.c @@ -87,7 +87,7 @@ MODULE_PARM_DESC(station_link_addresses, "Diagnostic: use the netdev address for static bool alpha_sleep_untested; module_param(alpha_sleep_untested, bool, 0600); -MODULE_PARM_DESC(alpha_sleep_untested, "TEST ONLY: J813 Alpha host-power and ACIPC sleep handshake"); +MODULE_PARM_DESC(alpha_sleep_untested, "TEST ONLY: Alpha host-power and ACIPC sleep handshake"); struct centauri_rx_snapshot { __le32 version, count; @@ -2705,12 +2705,17 @@ static int alpha_resume_locked(struct centauri_wifi *wifi) return 0; } +/* + * The host-power and ACIPC sleep requests are the N1 firmware's own protocol, the same on + * every board this driver binds (one board entry each, same PCI functions). Resume only + * undoes what suspend sent, so it needs no gate of its own. + */ int centauri_wifi_resume(struct centauri *c) { struct centauri_wifi *wifi = c->wifi; int ret; - if (!wifi || !of_machine_is_compatible("apple,j813")) + if (!wifi) return 0; mutex_lock(&wifi->lock); ret = alpha_resume_locked(wifi); @@ -2723,8 +2728,7 @@ int centauri_wifi_suspend(struct centauri *c) struct centauri_wifi *wifi = c->wifi; int ret, restore; - if (!wifi || !of_machine_is_compatible("apple,j813") || - !READ_ONCE(alpha_sleep_untested)) + if (!wifi || !READ_ONCE(alpha_sleep_untested)) return 0; mutex_lock(&wifi->lock); if (wifi->transport_paused || wifi->connected || wifi->connecting || wifi->scan_request || From f63bd689379531c9753d65634ccb7ccd45d85724 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 25 Nov 2026 10:04:55 +0300 Subject: [PATCH 2/2] wifi: apple: centauri: Send the Alpha sleep handshake by default Alpha's host-power and ACIPC sleep handshake ran only with apple_centauri.alpha_sleep_untested=1. Without it the N1 firmware is not told the host goes to sleep, and a deep sleep is aborted and the Mac woken about a minute in. The handshake runs through full deep sleeps and wakes on J813 and J815 (MacBook Air 13" and 15" M5). Default it on, for a deep sleep only: across s2idle the firmware keeps running and nothing is sent, as before. alpha_sleep_untested=0 skips it. Signed-off-by: Nick --- drivers/net/wireless/apple/centauri/centauri_wifi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/apple/centauri/centauri_wifi.c b/drivers/net/wireless/apple/centauri/centauri_wifi.c index 3916292f3133b..5c01a1510f353 100644 --- a/drivers/net/wireless/apple/centauri/centauri_wifi.c +++ b/drivers/net/wireless/apple/centauri/centauri_wifi.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -85,9 +86,14 @@ static bool station_link_addresses; module_param(station_link_addresses, bool, 0400); MODULE_PARM_DESC(station_link_addresses, "Diagnostic: use the netdev address for each firmware link in this single-link WPA2 client"); -static bool alpha_sleep_untested; +/* + * Alpha's host-power and ACIPC sleep handshake, for a deep sleep. Without it the firmware never + * hears the host is going to sleep and aborts the deep sleep about a minute in; it runs through + * full deep sleeps and wakes on J813 and J815 (MacBook Air 13" and 15" M5). =0 skips it. + */ +static bool alpha_sleep_untested = true; module_param(alpha_sleep_untested, bool, 0600); -MODULE_PARM_DESC(alpha_sleep_untested, "TEST ONLY: Alpha host-power and ACIPC sleep handshake"); +MODULE_PARM_DESC(alpha_sleep_untested, "Alpha host-power and ACIPC sleep handshake (default 1)"); struct centauri_rx_snapshot { __le32 version, count; @@ -2728,7 +2734,8 @@ int centauri_wifi_suspend(struct centauri *c) struct centauri_wifi *wifi = c->wifi; int ret, restore; - if (!wifi || !READ_ONCE(alpha_sleep_untested)) + /* Only for a deep sleep: across s2idle the firmware keeps running as before. */ + if (!wifi || !READ_ONCE(alpha_sleep_untested) || !pm_suspend_via_firmware()) return 0; mutex_lock(&wifi->lock); if (wifi->transport_paused || wifi->connected || wifi->connecting || wifi->scan_request ||