Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9180ac50 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach
Browse files

iwlwifi: configure the LTR



The LTR is the handshake between the device and the root
complex about the latency allowed when the bus exits power
save. This configuration was missing and this led to high
latency in the link power up. The end user could experience
high latency in the network because of this.

Cc: <stable@vger.kernel.org> [3.10+]
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 35a9ad8a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -563,6 +563,7 @@ enum iwl_trans_state {
 *	Set during transport allocation.
 * @hw_id_str: a string with info about HW ID. Set during transport allocation.
 * @pm_support: set to true in start_hw if link pm is supported
 * @ltr_enabled: set to true if the LTR is enabled
 * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
 *	The user should use iwl_trans_{alloc,free}_tx_cmd.
 * @dev_cmd_headroom: room needed for the transport's private use before the
@@ -589,6 +590,7 @@ struct iwl_trans {
	u8 rx_mpdu_cmd, rx_mpdu_cmd_hdr_size;

	bool pm_support;
	bool ltr_enabled;

	/* The following fields are internal only */
	struct kmem_cache *dev_cmd_pool;
+34 −1
Original line number Diff line number Diff line
@@ -68,13 +68,46 @@

/* Power Management Commands, Responses, Notifications */

/**
 * enum iwl_ltr_config_flags - masks for LTR config command flags
 * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status
 * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow
 *	memory access
 * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR
 *	reg change
 * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from
 *	D0 to D3
 * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register
 * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register
 * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD
 */
enum iwl_ltr_config_flags {
	LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0),
	LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1),
	LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2),
	LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3),
	LTR_CFG_FLAG_SW_SET_SHORT = BIT(4),
	LTR_CFG_FLAG_SW_SET_LONG = BIT(5),
	LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6),
};

/**
 * struct iwl_ltr_config_cmd - configures the LTR
 * @flags: See %enum iwl_ltr_config_flags
 */
struct iwl_ltr_config_cmd {
	__le32 flags;
	__le32 static_long;
	__le32 static_short;
} __packed;

/* Radio LP RX Energy Threshold measured in dBm */
#define POWER_LPRX_RSSI_THRESHOLD	75
#define POWER_LPRX_RSSI_THRESHOLD_MAX	94
#define POWER_LPRX_RSSI_THRESHOLD_MIN	30

/**
 * enum iwl_scan_flags - masks for power table command flags
 * enum iwl_power_flags - masks for power table command flags
 * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off
 *		receiver and transmitter. '0' - does not allow.
 * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management,
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ enum {
	/* Power - legacy power table command */
	POWER_TABLE_CMD = 0x77,
	PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
	LTR_CONFIG = 0xee,

	/* Thermal Throttling*/
	REPLY_THERMAL_MNG_BACKOFF = 0x7e,
+9 −0
Original line number Diff line number Diff line
@@ -480,6 +480,15 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
	/* Initialize tx backoffs to the minimal possible */
	iwl_mvm_tt_tx_backoff(mvm, 0);

	if (mvm->trans->ltr_enabled) {
		struct iwl_ltr_config_cmd cmd = {
			.flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
		};

		WARN_ON(iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
					     sizeof(cmd), &cmd));
	}

	ret = iwl_mvm_power_update_device(mvm);
	if (ret)
		goto error;
+1 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ static const char *const iwl_mvm_cmd_strings[REPLY_MAX] = {
	CMD(DTS_MEASUREMENT_NOTIFICATION),
	CMD(REPLY_THERMAL_MNG_BACKOFF),
	CMD(MAC_PM_POWER_TABLE),
	CMD(LTR_CONFIG),
	CMD(BT_COEX_CI),
	CMD(BT_COEX_UPDATE_SW_BOOST),
	CMD(BT_COEX_UPDATE_CORUN_LUT),
Loading