Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions drivers/net/wireless/apple/centauri/centauri_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/seq_file.h>
#include <linux/suspend.h>
#include <linux/unaligned.h>
#include <linux/workqueue.h>
#include <net/cfg80211.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 ||
Expand Down