Commit bc0440ee authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: mld: add timer host wakeup debugfs



Add a debugfs file to be able to control how long, at most,
the device will sleep before waking up the host. This will
be useful to test certain "assert during suspend" scenarios
for the previous change.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250611222325.9f2a39cae1e1.Ie0003f21286fea50b507d0debe06332b030cd4cb@changeid
parent 7a7cb2eb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
 * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
 * Copyright (C) 2015-2017 Intel Deutschland GmbH
 */
@@ -19,9 +19,11 @@ enum iwl_d0i3_flags {
/**
 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
 * @IWL_WAKEUP_D3_HOST_TIMER: wake up on host timer expiry
 */
enum iwl_d3_wakeup_flags {
	IWL_WAKEUP_D3_CONFIG_FW_ERROR	= BIT(0),
	IWL_WAKEUP_D3_HOST_TIMER	= BIT(1),
}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */

/**
+7 −0
Original line number Diff line number Diff line
@@ -1317,6 +1317,13 @@ int iwl_mld_no_wowlan_suspend(struct iwl_mld *mld)
	struct iwl_d3_manager_config d3_cfg_cmd_data = {};
	int ret;

	if (mld->debug_max_sleep) {
		d3_cfg_cmd_data.wakeup_host_timer =
			cpu_to_le32(mld->debug_max_sleep);
		d3_cfg_cmd_data.wakeup_flags =
			cpu_to_le32(IWL_WAKEUP_D3_HOST_TIMER);
	}

	lockdep_assert_wiphy(mld->wiphy);

	IWL_DEBUG_WOWLAN(mld, "Starting the no wowlan suspend flow\n");
+5 −0
Original line number Diff line number Diff line
@@ -546,6 +546,11 @@ iwl_mld_add_debugfs_files(struct iwl_mld *mld, struct dentry *debugfs_dir)
#endif
	MLD_DEBUGFS_ADD_FILE(inject_packet, debugfs_dir, 0200);

#ifdef CONFIG_PM_SLEEP
	debugfs_create_u32("max_sleep", 0600, debugfs_dir,
			   &mld->debug_max_sleep);
#endif

	debugfs_create_bool("rx_ts_ptp", 0600, debugfs_dir,
			    &mld->monitor.ptp_time);

+2 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@
 * @addresses: device MAC addresses.
 * @scan: instance of the scan object
 * @wowlan: WoWLAN support data.
 * @debug_max_sleep: maximum sleep time in D3 (for debug purposes)
 * @led: the led device
 * @mcc_src: the source id of the MCC, comes from the firmware
 * @bios_enable_puncturing: is puncturing enabled by bios
@@ -252,6 +253,7 @@ struct iwl_mld {
	struct iwl_mld_scan scan;
#ifdef CONFIG_PM_SLEEP
	struct wiphy_wowlan_support wowlan;
	u32 debug_max_sleep;
#endif /* CONFIG_PM_SLEEP */
#ifdef CONFIG_IWLWIFI_LEDS
	struct led_classdev led;