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 ||