mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Baochen Qiang <quic_bqiang@quicinc.com>,
	Jeff Johnson <quic_jjohnson@quicinc.com>,
	Kalle Valo <quic_kvalo@quicinc.com>,
	Sasha Levin <sashal@kernel.org>,
	kvalo@kernel.org, ath11k@lists.infradead.org,
	linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 6.1 19/68] wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early
Date: Tue, 16 Jan 2024 14:53:18 -0500	[thread overview]
Message-ID: <20240116195511.255854-19-sashal@kernel.org> (raw)
In-Reply-To: <20240116195511.255854-1-sashal@kernel.org>

From: Baochen Qiang <quic_bqiang@quicinc.com>

[ Upstream commit 5082b3e3027eae393a4e86874bffb4ce3f83c26e ]

We are seeing below error randomly in the case where only
one MSI vector is configured:

kernel: ath11k_pci 0000:03:00.0: wmi command 16387 timeout

The reason is, currently, in ath11k_pcic_ext_irq_enable(),
ATH11K_FLAG_EXT_IRQ_ENABLED is set before NAPI is enabled.
This results in a race condition: after
ATH11K_FLAG_EXT_IRQ_ENABLED is set but before NAPI enabled,
CE interrupt breaks in. Since IRQ is shared by CE and data
path, ath11k_pcic_ext_interrupt_handler() is also called
where we call disable_irq_nosync() to disable IRQ. Then
napi_schedule() is called but it does nothing because NAPI
is not enabled at that time, meaning
ath11k_pcic_ext_grp_napi_poll() will never run, so we have
no chance to call enable_irq() to enable IRQ back. Finally
we get above error.

Fix it by setting ATH11K_FLAG_EXT_IRQ_ENABLED after all
NAPI and IRQ work are done. With the fix, we are sure that
by the time ATH11K_FLAG_EXT_IRQ_ENABLED is set, NAPI is
enabled.

Note that the fix above also introduce some side effects:
if ath11k_pcic_ext_interrupt_handler() breaks in after NAPI
enabled but before ATH11K_FLAG_EXT_IRQ_ENABLED set, nothing
will be done by the handler this time, the work will be
postponed till the next time the IRQ fires.

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231117003919.26218-1-quic_bqiang@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath11k/pcic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/pcic.c b/drivers/net/wireless/ath/ath11k/pcic.c
index 380f9d37b644..e3b65efcc868 100644
--- a/drivers/net/wireless/ath/ath11k/pcic.c
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
@@ -453,8 +453,6 @@ void ath11k_pcic_ext_irq_enable(struct ath11k_base *ab)
 {
 	int i;
 
-	set_bit(ATH11K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);
-
 	for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
 		struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
 
@@ -465,6 +463,8 @@ void ath11k_pcic_ext_irq_enable(struct ath11k_base *ab)
 		}
 		ath11k_pcic_ext_grp_enable(irq_grp);
 	}
+
+	set_bit(ATH11K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);
 }
 EXPORT_SYMBOL(ath11k_pcic_ext_irq_enable);
 
-- 
2.43.0


  parent reply	other threads:[~2024-01-16 19:55 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 19:53 [PATCH AUTOSEL 6.1 01/68] wifi: rt2x00: restart beacon queue when hardware reset Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 02/68] selftests/bpf: satisfy compiler by having explicit return in btf test Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 03/68] selftests/bpf: Fix pyperf180 compilation failure with clang18 Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 04/68] wifi: rt2x00: correct wrong BBP register in RxDCOC calibration Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 05/68] selftests/bpf: Fix issues in setup_classid_environment() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 06/68] soc: xilinx: Fix for call trace due to the usage of smp_processor_id() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 07/68] soc: xilinx: fix unhandled SGI warning message Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 08/68] scsi: lpfc: Fix possible file string name overflow when updating firmware Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 09/68] PCI: Add no PM reset quirk for NVIDIA Spectrum devices Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 10/68] bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 11/68] net: usb: ax88179_178a: avoid two consecutive device resets Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 12/68] wifi: ieee80211: fix PV1 frame control field name Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 13/68] scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 14/68] scsi: arcmsr: Support new PCI device IDs 1883 and 1886 Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 15/68] ARM: dts: imx7d: Fix coresight funnel ports Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 16/68] ARM: dts: imx7s: Fix lcdif compatible Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 17/68] ARM: dts: imx7s: Fix nand-controller #size-cells Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 18/68] wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus() Sasha Levin
2024-01-16 19:53 ` Sasha Levin [this message]
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 20/68] bnxt_en: Add 5760X (P7) PCI IDs Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 21/68] bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 22/68] bpf: Add map and need_defer parameters to .map_fd_put_ptr() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 23/68] bpf: Set need_defer as false when clearing fd array during map free Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 24/68] scsi: libfc: Don't schedule abort twice Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 25/68] scsi: libfc: Fix up timeout error in fc_fcp_rec_error() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 26/68] net: mvmdio: Avoid excessive sleeps in polled mode Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 27/68] net: wangxun: fix changing mac failed when running Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 28/68] bpf: Guard stack limits against 32bit overflow Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 29/68] bpf: Set uattr->batch.count as zero before batched update or deletion Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 30/68] wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 31/68] ARM: dts: rockchip: fix rk3036 hdmi ports node Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 32/68] ARM: dts: imx25/27-eukrea: Fix RTC node name Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 33/68] ARM: dts: imx: Use flash@0,0 pattern Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 34/68] ARM: dts: imx27: Fix sram node Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 35/68] ARM: dts: imx1: " Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 36/68] net: phy: at803x: fix passing the wrong reference for config_intr Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 37/68] ionic: pass opcode to devcmd_wait Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 38/68] ionic: bypass firmware cmds when stuck in reset Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 39/68] block/rnbd-srv: Check for unlikely string overflow Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 40/68] ARM: dts: imx25: Fix the iim compatible string Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 41/68] ARM: dts: imx25/27: Pass timing0 Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 42/68] ARM: dts: imx27-apf27dev: Fix LED name Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 43/68] ARM: dts: imx23-sansa: Use preferred i2c-gpios properties Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 44/68] ARM: dts: imx23/28: Fix the DMA controller node name Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 45/68] scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 46/68] ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 47/68] net: atlantic: eliminate double free in error handling logic Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 48/68] net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 49/68] block: prevent an integer overflow in bvec_try_merge_hw_page Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 50/68] md: Whenassemble the array, consult the superblock of the freshest device Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 51/68] cfi: Add CFI_NOSEAL() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 52/68] arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 53/68] arm64: dts: qcom: msm8998: Fix 'out-ports' " Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 54/68] ice: fix pre-shifted bit usage Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 55/68] arm64: dts: amlogic: fix format for s4 uart node Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 56/68] wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 57/68] libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 58/68] wifi: rtlwifi: add calculate_bit_shift() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 59/68] wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() Sasha Levin
2024-01-16 19:53 ` [PATCH AUTOSEL 6.1 60/68] wifi: cfg80211: free beacon_ies when overridden from hidden BSS Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 61/68] Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066 Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 62/68] Bluetooth: hci_sync: fix BR/EDR wakeup bug Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 63/68] Bluetooth: L2CAP: Fix possible multiple reject send Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 64/68] net/smc: disable SEID on non-s390 archs where virtual ISM may be used Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 65/68] bridge: cfm: fix enum typo in br_cc_ccm_tx_parse Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 66/68] i40e: Fix VF disable behavior to block all traffic Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 67/68] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry Sasha Levin
2024-01-16 19:54 ` [PATCH AUTOSEL 6.1 68/68] net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure Sasha Levin

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=20240116195511.255854-19-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_bqiang@quicinc.com \
    --cc=quic_jjohnson@quicinc.com \
    --cc=quic_kvalo@quicinc.com \
    --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

all inboxes | Powered by JetHome®