linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.9 044/105] iwlwifi: pcie: set LTR to avoid completion timeout
Date: Mon, 14 Dec 2020 18:28:18 +0100	[thread overview]
Message-ID: <20201214172557.402820686@linuxfoundation.org> (raw)
In-Reply-To: <20201214172555.280929671@linuxfoundation.org>

From: Johannes Berg <johannes.berg@intel.com>

[ Upstream commit edb625208d84aef179e3f16590c1c582fc5fdae6 ]

On some platforms, the preset values aren't correct and then we may
get a completion timeout in the firmware. Change the LTR configuration
to avoid that. The firmware will do some more complex reinit of this
later, but for the boot process we use ~250usec.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201107104557.d83d591c05ba.I42885c9fb500bc08b9a4c07c4ff3d436cc7a3c84@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/iwl-csr.h  | 10 ++++++++++
 .../intel/iwlwifi/pcie/ctxt-info-gen3.c       | 20 +++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index cb9e8e189a1a4..1d48c7d7fffd4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -147,6 +147,16 @@
 #define CSR_MAC_SHADOW_REG_CTL2		(CSR_BASE + 0x0AC)
 #define CSR_MAC_SHADOW_REG_CTL2_RX_WAKE	0xFFFF
 
+/* LTR control (since IWL_DEVICE_FAMILY_22000) */
+#define CSR_LTR_LONG_VAL_AD			(CSR_BASE + 0x0D4)
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ	0x80000000
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE	0x1c000000
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL	0x03ff0000
+#define CSR_LTR_LONG_VAL_AD_SNOOP_REQ		0x00008000
+#define CSR_LTR_LONG_VAL_AD_SNOOP_SCALE		0x00001c00
+#define CSR_LTR_LONG_VAL_AD_SNOOP_VAL		0x000003ff
+#define CSR_LTR_LONG_VAL_AD_SCALE_USEC		2
+
 /* GIO Chicken Bits (PCI Express bus link power management) */
 #define CSR_GIO_CHICKEN_BITS    (CSR_BASE+0x100)
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
index 1ab1366004159..0fc2a6e49f9ee 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
@@ -252,6 +252,26 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
 
 	iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
 		    CSR_AUTO_FUNC_BOOT_ENA);
+
+	if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210) {
+		/*
+		 * The firmware initializes this again later (to a smaller
+		 * value), but for the boot process initialize the LTR to
+		 * ~250 usec.
+		 */
+		u32 val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
+			  u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+					  CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
+			  u32_encode_bits(250,
+					  CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
+			  CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
+			  u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+					  CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
+			  u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
+
+		iwl_write32(trans, CSR_LTR_LONG_VAL_AD, val);
+	}
+
 	if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
 		iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
 	else
-- 
2.27.0




  parent reply	other threads:[~2020-12-14 18:52 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 17:27 [PATCH 5.9 000/105] 5.9.15-rc1 review Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 001/105] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 002/105] mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 003/105] kprobes: Remove NMI context check Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 004/105] kprobes: Tell lockdep about kprobe nesting Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 005/105] ASoC: Intel: bytcr_rt5640: Fix HP Pavilion x2 Detachable quirks Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 006/105] tools/bootconfig: Fix to check the write failure correctly Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 007/105] net, xsk: Avoid taking multiple skbuff references Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 008/105] bpftool: Fix error return value in build_btf_type_table Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 009/105] vhost-vdpa: fix page pinning leakage in error path (rework) Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 010/105] powerpc/64s: Fix hash ISA v3.0 TLBIEL instruction generation Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 011/105] batman-adv: Consider fragmentation for needed_headroom Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 012/105] batman-adv: Reserve needed_*room for fragments Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 013/105] batman-adv: Dont always reallocate the fragmentation skb head Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 014/105] ipvs: fix possible memory leak in ip_vs_control_net_init Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 015/105] ibmvnic: handle inconsistent login with reset Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 016/105] ibmvnic: stop free_all_rwi on failed reset Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 017/105] ibmvnic: avoid memset null scrq msgs Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 018/105] ibmvnic: delay next reset if hard reset fails Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 019/105] ibmvnic: track pending login Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 020/105] ibmvnic: send_login should check for crq errors Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 021/105] ibmvnic: reduce wait for completion time Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 022/105] drm/rockchip: Avoid uninitialized use of endpoint id in LVDS Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 023/105] drm/panel: sony-acx565akm: Fix race condition in probe Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 024/105] can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous clk_disable_unprepare() Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 025/105] can: sja1000: sja1000_err(): dont count arbitration lose as an error Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 026/105] can: sun4i_can: sun4i_can_err(): " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 027/105] can: c_can: c_can_power_up(): fix error handling Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 028/105] can: kvaser_pciefd: kvaser_pciefd_open(): " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 029/105] samples/ftrace: Mark my_tramp[12]? global Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 030/105] scsi: storvsc: Fix error return in storvsc_probe() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 031/105] net: broadcom CNIC: requires MMU Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 032/105] vdpa: mlx5: fix vdpa/vhost dependencies Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 033/105] iwlwifi: pcie: invert values of NO_160 device config entries Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 034/105] perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 035/105] usb: ohci-omap: Fix descriptor conversion Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 036/105] zlib: export S390 symbols for zlib modules Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 037/105] mm/mmap.c: fix mmap return value when vma is merged after call_mmap() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 038/105] phy: usb: Fix incorrect clearing of tca_drv_sel bit in SETUP reg for 7211 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 039/105] arm64: dts: rockchip: Remove system-power-controller from pmic on Odroid Go Advance Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 040/105] iwlwifi: pcie: limit memory read spin time Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 041/105] arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 042/105] arm64: dts: rockchip: Reorder LED triggers from mmc devices on rk3399-roc-pc Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 043/105] iwlwifi: sta: set max HE max A-MPDU according to HE capa Greg Kroah-Hartman
2020-12-14 17:28 ` Greg Kroah-Hartman [this message]
2020-12-14 17:28 ` [PATCH 5.9 045/105] iwlwifi: mvm: fix kernel panic in case of assert during CSA Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 046/105] powerpc: Drop -me200 addition to build flags Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 047/105] arm64: dts: broadcom: clear the warnings caused by empty dma-ranges Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 048/105] ARC: stack unwinding: dont assume non-current task is sleeping Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 049/105] scsi: ufs: Fix unexpected values from ufshcd_read_desc_param() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 050/105] scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 051/105] interconnect: qcom: msm8916: Remove rpm-ids from non-RPM nodes Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 052/105] interconnect: qcom: qcs404: Remove GPU and display RPM IDs Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 053/105] ibmvnic: skip tx timeout reset while in resetting Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 054/105] irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 055/105] drm/exynos: depend on COMMON_CLK to fix compile tests Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 056/105] spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 057/105] arm-smmu-qcom: Ensure the qcom_scm driver has finished probing Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 058/105] habanalabs/gaudi: fix missing code in ECC handling Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 059/105] btrfs: do nofs allocations when adding and removing qgroup relations Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 060/105] btrfs: fix lockdep splat when enabling and disabling qgroups Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 061/105] soc: fsl: dpio: Get the cpumask through cpumask_of(cpu) Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 062/105] sched/idle: Fix arch_cpu_idle() vs tracing Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 063/105] intel_idle: Fix intel_idle() " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 064/105] arm64: tegra: Disable the ACONNECT for Jetson TX2 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 065/105] platform/x86: thinkpad_acpi: add P1 gen3 second fan support Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 066/105] platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 067/105] platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 068/105] platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 069/105] platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 070/105] platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 071/105] platform/x86: touchscreen_dmi: Add info for the Predia Basic tablet Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 072/105] platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tablet Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 073/105] can: m_can: m_can_dev_setup(): add support for bosch mcan version 3.3.0 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 074/105] s390: fix irq state tracing Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 075/105] intel_idle: Build fix Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 076/105] media: pulse8-cec: fix duplicate free at disconnect or probe error Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 077/105] media: pulse8-cec: add support for FW v10 and up Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 078/105] mmc: mediatek: Fix system suspend/resume support for CQHCI Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 079/105] mmc: mediatek: Extend recheck_sdio_irq fix to more variants Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 080/105] ktest.pl: Fix incorrect reboot for grub2bls Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 081/105] xen: add helpers for caching grant mapping pages Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 082/105] xen: dont use page->lru for ZONE_DEVICE memory Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 083/105] Input: cm109 - do not stomp on control URB Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 084/105] Input: i8042 - add Acer laptops to the i8042 reset list Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 085/105] pinctrl: jasperlake: Fix HOSTSW_OWN offset Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 086/105] pinctrl: amd: remove debounce filter setting in IRQ type setting Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 087/105] mmc: sdhci-of-arasan: Fix clock registration error for Keem Bay SOC Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 088/105] mmc: block: Fixup condition for CMD13 polling for RPMB requests Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 089/105] drm/amdgpu/disply: set num_crtc earlier Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 090/105] drm/i915/gem: Propagate error from cancelled submit due to context closure Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 091/105] drm/i915/display/dp: Compute the correct slice count for VDSC on DP Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 092/105] drm/i915/gt: Declare gen9 has 64 mocs entries! Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 093/105] drm/i915/gt: Ignore repeated attempts to suspend request flow across reset Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 094/105] drm/i915/gt: Cancel the preemption timeout on responding to it Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 095/105] drm/amdgpu: fix sdma instance fw version and feature version init Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 096/105] kbuild: avoid static_assert for genksyms Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 097/105] proc: use untagged_addr() for pagemap_read addresses Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 098/105] mm/hugetlb: clear compound_nr before freeing gigantic pages Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 099/105] zonefs: fix page reference and BIO leak Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 100/105] scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()" Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 101/105] x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 102/105] x86/membarrier: Get rid of a dubious optimization Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 103/105] x86/apic/vector: Fix ordering in vector assignment Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 104/105] x86/kprobes: Fix optprobe to detect INT3 padding correctly Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 105/105] compiler.h: fix barrier_data() on clang Greg Kroah-Hartman
2020-12-14 22:06 ` [PATCH 5.9 000/105] 5.9.15-rc1 review Jeffrin Jose T
2020-12-14 23:53 ` Shuah Khan
2020-12-16 13:20   ` Greg Kroah-Hartman
2020-12-15  2:27 ` Naresh Kamboju
2020-12-16 13:20   ` Greg Kroah-Hartman
2020-12-15 20:32 ` Guenter Roeck
2020-12-16 13:21   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214172557.402820686@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).