Commit 1bd9c9eb authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg

wifi: iwlwifi: no power save during transition to D3

Transition to d3 is much faster if there is no power save during the
transition. Therefore a new flag was added to the device power cmd to
indicate the power save isn't allowed until the transition is completed.
Set this flag in _iwl_mvm_suspend, when the transition begins.
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230913145231.ced036106507.Ib5ed5a47ee35f624902bd8882dde3e559285965b@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent dfed221d
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* /*
* Copyright (C) 2012-2014, 2018-2022 Intel Corporation * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
* Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2015-2017 Intel Deutschland GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH
*/ */
...@@ -144,6 +144,8 @@ struct iwl_powertable_cmd { ...@@ -144,6 +144,8 @@ struct iwl_powertable_cmd {
* receiver and transmitter. '0' - does not allow. * receiver and transmitter. '0' - does not allow.
* @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK: * @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK:
* Device Retention indication, '1' indicate retention is enabled. * Device Retention indication, '1' indicate retention is enabled.
* @DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK:
* Prevent power save until entering d3 is completed.
* @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK: * @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK:
* 32Khz external slow clock valid indication, '1' indicate cloack is * 32Khz external slow clock valid indication, '1' indicate cloack is
* valid. * valid.
...@@ -151,6 +153,7 @@ struct iwl_powertable_cmd { ...@@ -151,6 +153,7 @@ struct iwl_powertable_cmd {
enum iwl_device_power_flags { enum iwl_device_power_flags {
DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),
DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1), DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1),
DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK = BIT(7),
DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12), DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12),
}; };
...@@ -162,7 +165,7 @@ enum iwl_device_power_flags { ...@@ -162,7 +165,7 @@ enum iwl_device_power_flags {
* @reserved: reserved (padding) * @reserved: reserved (padding)
*/ */
struct iwl_device_power_cmd { struct iwl_device_power_cmd {
/* PM_POWER_TABLE_CMD_API_S_VER_6 */ /* PM_POWER_TABLE_CMD_API_S_VER_7 */
__le16 flags; __le16 flags;
__le16 reserved; __le16 reserved;
} __packed; } __packed;
......
...@@ -489,6 +489,11 @@ int iwl_mvm_power_update_device(struct iwl_mvm *mvm) ...@@ -489,6 +489,11 @@ int iwl_mvm_power_update_device(struct iwl_mvm *mvm)
if (mvm->ext_clock_valid) if (mvm->ext_clock_valid)
cmd.flags |= cpu_to_le16(DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK); cmd.flags |= cpu_to_le16(DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK);
if (iwl_fw_lookup_cmd_ver(mvm->fw, POWER_TABLE_CMD, 0) >= 7 &&
test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
cmd.flags |=
cpu_to_le16(DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK);
IWL_DEBUG_POWER(mvm, IWL_DEBUG_POWER(mvm,
"Sending device power command with flags = 0x%X\n", "Sending device power command with flags = 0x%X\n",
cmd.flags); cmd.flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment