From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302458; b=dDjreBo67Z681UAkWdJls1WKQNgcurmTH+iLR0bUF8WEcU5xbVA1gOGBhJgGpL+7uAfN l0ZMC2fOI+lq1OcJ7LWxzKGOgEWJuiZbabUXwQFGnUEx2oYdOSyAgapJ5gd9Fa6cyev88 QW52SUZ2mrnNGANO3wAxIjNNxyg4sCN20PCo+XgNrIijO7By0nF4GA7nMhPWPHu2g7VWH 4ffqqtKROxgjUX+famyOXEa8fVgHddMd3WdmnWOKuMPfV7afj2/k/x3MaTjxr4LHSZkpu sZnDm+1ZxSV3z64AndOXPUEEBR3kmEvPsEPKiCojWBS1QIG8Z5mSDhnZ3G9of1seMUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302458; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=gI3U6dUlp30v59HKfCtRqIsiBkmd37Mua00ns5/+cmw=; b=oJlxf6tZgn95QVA4y9MvIqYGsrXwl2nAu/sWt/ggivKZZiK/q2rsmmWRjo8EZ1nHwDpA dewigenO7mq5KhiRuRZFtYXZ8HaydTznqb5bbUCfnKQGeedokDDymSDmek40EZKM0OGud tsu0YI1MZN1WJggzdKe3/vrhVm0JbbSxDR+FRsSXk4tBBcSwUAa8Fb4I18BaY+pvfNwfC RRjRAop3bKisrMHso6sBx4x73fQlRrBBscnX8WTUvZvZAc6E4LdtIqQsxQKs7U+JQcsKA CeMAt58F/wKEm8+xucgTmsovo4CpIIKWFNW6g4yUUWB42C8dZc+H3iOmAD3Fw+jlrEg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=AKZubi4o; arc=none smtp.remote-ip=209.85.218.46 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42AA5606A680 for ; Sat, 21 Nov 2026 23:07:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42AA5606A680 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=AKZubi4o Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c516a160f91so25235766b.2 for ; Sat, 21 Nov 2026 15:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302455; x=1795907255; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gI3U6dUlp30v59HKfCtRqIsiBkmd37Mua00ns5/+cmw=; b=AKZubi4otobKsA3C7KNDJTnh2xGTU6QkmoaLoeya3i0adiyTgnlv/EAJdwbueF2IYQ C9ChBOEaPMStkaQe4K/JWdNFSSdc3t/XjyZJdagWdnM6VjOlSGbYa/dwyHkfDuxuCJRF 3Tf++Hn2NFeU8zgvkjtMKTD+KHlly8/2vLa1aiVtSZp7kd6peIjTKroQVeMKQ+1xEnRs 0Y9uAPRtWvTMMI0cGmKetxwHQViblVZDN+8HfcyNB2ctGfnZvzDn2HXFkYmwJ4h20Um8 LfMpDTgZ1s0BeqOoZAb0s8+5h4WtN0pw+oUh3/Y44NGLBU4GLcKbskB/zCI9f0tkpZoa kWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302455; x=1795907255; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=gI3U6dUlp30v59HKfCtRqIsiBkmd37Mua00ns5/+cmw=; b=d4r//r4LgBMqCWfmU1l+EyJFi1TWkIwqMTUecF9Xhha+UZ5Djt4p80LhLsX2NM4nob Iayxl73FEW/bRCejDX0+8lKGa/uEFuBSyWbxgA8DqPha2AWbCHpyg2DquPEzwB30M7Iy NUjlIe93a3DBpf/ILalM61OJlNTOQIW0FldvIJxU1f4kZisUKfimEg9B53ojfgv9zmEi 3EUZuladOdA0v6tyWMl9QTjiu6DcGAY55QESdQM2x3e7Y4mF7nhU/1U3CI3NU/XYItl9 oNRQRa/DWooaltvmDXw7l6/94lQ4MYSIfecplK+q20RwKbTO08/ck/X/sfxaZG2yuwFa 6UEA== X-Forwarded-Encrypted: i=1; AL+hErEReyRa56W6Q/l6wDQX7uH2XC6JXIE7IBWiUOclmxLMF7h7QTNOy2TJ/ppbbABhPO5DcZuDu8/IjOIaq4s=@vger.kernel.org X-Gm-Message-State: APuU4Z9WECnKbj3KROutdEijUDs33KMOC8vgVLbVjY1cTTrV718Qn1Mn P9sHnMW+RSY5nVl3oVwuvduRSW+caauW+CM+IJe/lDF3Ykay0tf+dr5UTGPmrgMyfw== X-Gm-Gg: AZFdTZfCKMO4NgnHI8Ez6jQOZaRuQpzJujqxlh8B6Lg5QL1iGXt6LqmG9yIy7dCgFQ4 IEEc3maSbDRz7sLUg2dr2E25xnfsuDhJ0Xi6hALfyU9Qp/kXXML/OO6rB840BAmXnj9Wii5DYax LB4RRHteyaZWUfq0MODwR9wccwkb83MjoP8RmL7x8uPvhhEdyycmqogMWUzL+I52y/ojav8LWDG gtprfWltsIX5HCo23XqpBXcrD9STMZRmv/N0QXgay70UaNVMSsoRZ+j1tSFeC/F7vzfaYujUSb2 fDLoL5o5Pd1FLwWNAOA1hbKVRLF2389Mogd/vghly2kvTg+dIzrh22pzv6vUJCI0KQb4/kcyPig rYv6Xw9wtYIQI4efzmvcbDMMwqXTHrWnMjLTjJM6y1I02yCW588qTolxbYIe+rEU9fCMPU8BK09 AP+tlHqX7v7VzZ96p6xe9pn6+RomLcT93n2RHwRGzptI1KOrfMMdonkPv/XWgudD/tePswqEnVn wneNYztROCC21uw5cM34qMijlxObxyQ3ansCkTsL43adQlGUKHAkUQ7j9pKBigG+waXbr0JmM8K UzI1/M7LKhfv5icfgSJeioCgOPVtZdXf4JoktIA4d5OIaOrH+9grQo4tmyv4WASmZGT9SSKkQsV kOcnQr3Vx3hLlC6Z2kDA5SfTPOekKrgG/19IZ2UOIIC/BHwVn9BnbJ7PSI1+qd+zaqSmbLk9irR 6oDlpNotDzJpGQscR9X/Dhbsh9GB0HIRdc8M0udLRE9IqVIKUmhGgCDt5HuOEGryIvLcK9XtsPo E1DgsPqCFX3KggiKirqQSkc07MOA9Q4xU60zKvQPfMarm3vj3IRQRfowoUxTrwT/h0tgWm36wGb e2aZG7PfJwhSK8L/7uVOrvMOzfc0WbEdPig6iFjnjo4pH3MvP19iKFvaH2KPTEB9JMm3CO/u0PM = X-Received: by 2002:a17:907:d406:b0:c41:8e21:4d5a with SMTP id a640c23a62f3a-c513a47e37fmr603561966b.5.1795302455657; Sat, 21 Nov 2026 15:07:35 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:34 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 01/13] wifi: ath11k: initialise the CE descriptor waitqueue once per device Date: Sun, 22 Nov 2026 00:07:19 +0100 Message-ID: <20261121230731.1206043-2-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Firmware crash recovery reinitialises tx_ce_desc_wq in ath11k_connect_pdev_htc_service(), reached through ath11k_core_start() and ath11k_wmi_connect(), while a WMI command on a device without credit flow can still sleep on it in ath11k_wmi_cmd_send(). finish_wait() then unlinks the waiter from the reset list head: list_del corruption. prev->next should be ffffffc084293648, but was ffffff80075109a8. (prev=3Dffffff80075109a8) WARNING: CPU: 2 PID: 1782 at lib/list_debug.c:62 __list_del_entry_valid_or_report+0x134/0x174 CPU: 2 UID: 101 PID: 1782 Comm: hostapd Call trace: __list_del_entry_valid_or_report+0x134/0x174 (P) finish_wait+0x68/0xb8 ath11k_wmi_cmd_send+0x150/0x2f4 [ath11k] ath11k_wmi_vdev_set_param_cmd+0x64/0xd8 [ath11k] ath11k_mac_op_bss_info_changed+0xe8/0xf6c [ath11k] drv_link_info_changed+0x128/0x180 [mac80211] ieee80211_link_info_change_notify+0xe0/0x100 [mac80211] ieee80211_change_bss+0x1bc/0x250 [mac80211] nl80211_set_bss+0x1a0/0x328 [cfg80211] Initialise the queues once in ath11k_core_alloc(). Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: f951380a6022 ("ath11k: Disabling credit flow for WMI path") Reviewed-by: Baochen Qiang Tested-by: Florian Maurer # IPQ8074 hw2.0 AHB WLAN.HK= .2.9.0.1-02146 (backport to 6.18) Signed-off-by: Julius Bairaktaris --- v3: no change. drivers/net/wireless/ath/ath11k/core.c | 5 +++++ drivers/net/wireless/ath/ath11k/wmi.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index 766ae27306f4..8e4dab61a300 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2743,6 +2743,7 @@ struct ath11k_base *ath11k_core_alloc(struct device *= dev, size_t priv_size, enum ath11k_bus bus) { struct ath11k_base *ab; + int i; =20 ab =3D kzalloc(sizeof(*ab) + priv_size, GFP_KERNEL); if (!ab) @@ -2769,6 +2770,10 @@ struct ath11k_base *ath11k_core_alloc(struct device = *dev, size_t priv_size, INIT_LIST_HEAD(&ab->peers); init_waitqueue_head(&ab->peer_mapping_wq); init_waitqueue_head(&ab->wmi_ab.tx_credits_wq); + + for (i =3D 0; i < ARRAY_SIZE(ab->wmi_ab.wmi); i++) + init_waitqueue_head(&ab->wmi_ab.wmi[i].tx_ce_desc_wq); + init_waitqueue_head(&ab->qmi.cold_boot_waitq); INIT_WORK(&ab->restart_work, ath11k_core_restart); INIT_WORK(&ab->update_11d_work, ath11k_update_11d); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/a= th/ath11k/wmi.c index 82f85df481cb..5f2412982229 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -9102,7 +9102,6 @@ static int ath11k_connect_pdev_htc_service(struct ath= 11k_base *ab, ab->wmi_ab.wmi_endpoint_id[pdev_idx] =3D conn_resp.eid; ab->wmi_ab.wmi[pdev_idx].eid =3D conn_resp.eid; ab->wmi_ab.max_msg_len[pdev_idx] =3D conn_resp.max_msg_len; - init_waitqueue_head(&ab->wmi_ab.wmi[pdev_idx].tx_ce_desc_wq); =20 return 0; } --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302460; b=4uZ0ipw519pxCYrxVcz5yCbp/OfH+RdeKG/FXx+ArJ137wrQyD/t2YTCQQPJrthjDCtP iH1ajbocMIVtzBlf+8bu8NTYnbQR01WOniRtLO88ny0EvREIJDH08oJshFu6DUpv4OOvw nwTwM1P1skDY+MWb44Iwy2DnvfA+Q7sjnBdveSPwUs0lGhCYnybhDTIc3GxLVEF134dB5 +1Esz+D+rPQbrh5Qye3qdth0QltjwbhLRacT4HKiMX6/Pr9i6MQjP3bizb2B6kVSHLNwb dBYcDir/JZI8sCotKLUf3OnSuzUKujp67suB8iKm8DpHoaxTWJbW5lQdpIwJMlmybuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302460; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=OPsfghuAOvZXGmgP8YNMyy86FtkIG7/XEGKOG2j+8RA=; b=mjhJRkZajxJWbx4zCPMlVaKcm5FfahzUvH5NRP0LrfuCi6xBfwhXaup0VbjaEh6Rj31I QjkERNNBj4F8GQ4K8nwJ9TRUnCk1uYp9qPQfjW+QbLC6d/u+/hAFaBR0Bojzmf/lCYXaC AItdgZphmHt4cgbHu0JZ+wkv9beUH/nGy2JJWx7pXTTLNrIRi4xFYT01O6UdLRBkxSClf 5y0gZ7I0rePxuNilmdcEuKcIsZz3oaxYU9rkM7MngXJnEsN0amrMTk6nqvHZRr+ZKiwfn VHFM4HMBfzS9nkD/NQEKKmpIkJAbiBFVInb7RuwBkyVh/jfT0Ng86Dktu7g15XMJ+CA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=W0X2B71Z; arc=none smtp.remote-ip=209.85.218.49 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DB1E606A330 for ; Sat, 21 Nov 2026 23:07:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2DB1E606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=W0X2B71Z Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-c4d28f75d62so360106166b.0 for ; Sat, 21 Nov 2026 15:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302457; x=1795907257; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OPsfghuAOvZXGmgP8YNMyy86FtkIG7/XEGKOG2j+8RA=; b=W0X2B71ZJTucaJ/Bp6BW0FMPpswkNXe4wtLaX7UfB//Om+KNYhFCIsdtFFLNxndHNm YICs20ngVo+8diCreK2LjrLJTAbZ7PCPdp8dZiKlQTyHMnDuCrG+lvCS/Lqnd7jIG9Cq 9WGjq/2cqeeKNZFwVhX+IV9woP6jsBZ14CQl9Bl7coqT9WdJhbYwoKl3vpOJdG0Y2RFI pmBlYZp6sWSu/FozQH2LPoAlmt0wYD0f9mObmQO9KSOPsYwQseRdN6qrOBl4aRI0man7 4CndfXdHLLitu3Ew3tJPmK27nJAoO8lr7QNJJuNvy/KrmQ8rhBAl0IgOhfxL6K/Dl7KB q4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302457; x=1795907257; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OPsfghuAOvZXGmgP8YNMyy86FtkIG7/XEGKOG2j+8RA=; b=swBMtkUFntjmX5mnYELoZ0EIRbXt3YAi2/B+NXFTZ/JbJ18wmGEh6Zt9AcUGytEw4D hixess/me8XxULePa3xRU41VJNPRbF4Ttz504BOLeFkgSVmq9lWwu97AjmAAXeFZJ2p2 wWR+EEsBG/W2bYwiD++lDuN6y7eA8C6cNx+s/um6HOSPnxQ612io7xTedtBbKU7aHb/0 sfKqkY1ZGrP/8YtImsNvu4RHm5YROy9LWkzHF0mv6bqWnTaPgQwnJzfPtplSfjaSCIM+ muqk8p7ePBuYn+JKAJd8DngFHXkQHkMFhrkXRJDhWJi6n9rhJf5pnI1mP2ya5fKh89Dp B4Mw== X-Forwarded-Encrypted: i=1; AL+hErHIxGduNnhoOeRSqxQxpmy5xaasqfq7IrSGh4ZWWBtKzihrNPqIBwtdbzxIzkeo9XPURDkdmbnHU+w1ePM=@vger.kernel.org X-Gm-Message-State: APuU4Z8g7CHrUJiPavJCmnWR2aswVtvGf7iluZkL/NwmtZK2d/moA9wK zro3IzIGoIWFpxVQhTllf1sK/lLCafhgJxXqvmLv3xze2bYFHM8Ctp0j2DMOn2jCrQ== X-Gm-Gg: AZFdTZcSdxNaquDWz4quZzhBUqfXYpR1j/pKmPSzQN7CP6s5+u5JR64VQFRJtEnnTwl Ussn3iY0bzLLPc/J01XsPx5DVMkRXXsHGpNObGZn8+2j7wz5HA6MgE3SHunWM9lk7S136u8H6eX RDMYV98F6Fh/zoEbsqc1F5qhvdVDVC4jTzsQySsYfTgdrRpDjH+e8Y4HlqyNoBUboFnGGPtPeyu eCpls8ifczwvpNrv8vvJfvYGTeu+dKu6/doaORdIWd+PqrUh0i0BEJHbtutr+1XCF30aOwUJiCc d9H4WgGH2WPlpey4ZQ2QpXhevqwgmTr2kDB0s0h5AqPUi8eCW6x98YKRjrrwrrwmlefZaKIZxw2 fYcs5PObJey/i/6CX5b18d0zmBCPnJF2CSRAr12uWMpX6q65rpYJSbN/36l5hRQ78Eds0jKnG3A eL0cBwtea7rTkeeMFKDnSlBhsO6Cl3gyVQ1opgyCdMb3xGTNsE6Fu8L6+Q0MxN4jBgt9bbGlOJT giTJpiOoRp8/eY1zz4+x9Motu1FyLw/uHhD8roQ2OGKKt7CM63z8SvSBCJLV0dYEXCgCYg/YBn3 fGqec82gbGYvTBAPgtmVg6iI1smxPqyUClum90NdHM/4Gk+tObWyEFhU0OvyxkHEIgTfcvEOtVk vYbQvSF0n2zMYE81RUFrfMv605QLK9PsqjfxrKSsMfW/tZyuIqEcIdtImNK1hL6ERxo2uxNEFqi FcWpMWWXWV0TJtOgPFRHNPnWrTstyVZP1K7fAxDPJErecvVWS78EfOm5u9AmRZ0MEN/EgtfoUuQ CCG8HMW1Q9OKKF3XIyUpBZKznMQen1gxwlWYvqzB+GIPPNssMjMxdhrktAMIlsKd38UQONEPoqj BsrfIsYzlO4HyYvC//elz97YBZVbPtp++l5kdLjIJnGqC7c7wuf9IWOM7CqSnzNGFNS2D6F86EA = X-Received: by 2002:a17:906:1911:b0:c41:b94c:4538 with SMTP id a640c23a62f3a-c513acd297fmr440901566b.47.1795302457248; Sat, 21 Nov 2026 15:07:37 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:36 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 02/13] wifi: ath11k: keep the radios when a firmware recovery fails Date: Sun, 22 Nov 2026 00:07:20 +0100 Message-ID: <20261121230731.1206043-3-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On a firmware crash recovery ath11k_mac_allocate() keeps the registered radios, but the error paths of ath11k_core_start() and ath11k_core_qmi_firmware_ready() still call ath11k_mac_destroy(). A failed recovery thus frees an ieee80211_hw that mac80211 still uses and leaves ab->pdevs[i].ar NULL. A frame bridged to the radio then follows the freed hw: Unable to handle kernel paging request at virtual address ffffff8316cfd480 pc : sta_info_hash_lookup+0x4c/0xe4 [mac80211] Call trace: sta_info_hash_lookup+0x4c/0xe4 [mac80211] (P) sta_info_get_bss+0x1c/0x78 [mac80211] ieee80211_lookup_ra_sta+0x124/0x14c [mac80211] __ieee80211_subif_start_xmit+0xb8/0x3a0 [mac80211] ieee80211_subif_start_xmit+0x50/0x750 [mac80211] dev_hard_start_xmit+0x98/0x120 and driver removal dereferences the NULL ar: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000 pc : ath11k_dp_rx_pdev_free+0x34/0x12c [ath11k] Call trace: ath11k_dp_rx_pdev_free+0x34/0x12c [ath11k] (P) ath11k_dp_pdev_free+0x4c/0x84 [ath11k] ath11k_core_deinit+0xdc/0x168 [ath11k] ath11k_ahb_remove+0x30/0x90 [ath11k_ahb] Destroy the radios only when ATH11K_FLAG_REGISTERED is clear, as ath11k_mac_allocate() does. ath11k_core_pdev_create() has the same problem with the registration. During a recovery ath11k_mac_register() and ath11k_debugfs_pdev_create() return early, but when a later step such as ath11k_spectral_init() or ath11k_cfr_init() fails, the error path calls ath11k_mac_unregister() and ath11k_debugfs_pdev_destroy(). The first unregisters the radios from mac80211 while ATH11K_FLAG_REGISTERED stays set, so driver removal unregisters them a second time. The second removes the debugfs tree of the device with the macN directories, while ar->debug.debugfs_pdev keeps pointing to the removed directory; the next recovery's ath11k_spectral_init() and ath11k_cfr_init() create their files under it. Undo both there only when ATH11K_FLAG_REGISTERED is clear as well, which is when this call did them. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: 0366f42640a4 ("ath11k: Move mac80211 hw allocation before wmi_init c= ommand") Signed-off-by: Julius Bairaktaris --- v3: also skip ath11k_mac_unregister() and ath11k_debugfs_pdev_destroy() in = the error path of ath11k_core_pdev_create() while the device stays registered. Florian's Tested-by dropped, as the code changed. drivers/net/wireless/ath/ath11k/core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index 8e4dab61a300..5f4e7fbe0b25 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2073,11 +2073,13 @@ static int ath11k_core_pdev_create(struct ath11k_ba= se *ab) err_thermal_unregister: ath11k_thermal_unregister(ab); err_mac_unregister: - ath11k_mac_unregister(ab); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_mac_unregister(ab); err_dp_pdev_free: ath11k_dp_pdev_free(ab); err_pdev_debug: - ath11k_debugfs_pdev_destroy(ab); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_debugfs_pdev_destroy(ab); =20 return ret; } @@ -2231,7 +2233,8 @@ static int ath11k_core_start(struct ath11k_base *ab) err_reo_cleanup: ath11k_dp_pdev_reo_cleanup(ab); err_mac_destroy: - ath11k_mac_destroy(ab); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_mac_destroy(ab); err_hif_stop: ath11k_hif_stop(ab); err_wmi_detach: @@ -2315,7 +2318,8 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base= *ab) =20 err_core_stop: ath11k_core_stop(ab); - ath11k_mac_destroy(ab); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_mac_destroy(ab); err_dp_free: ath11k_dp_free(ab); mutex_unlock(&ab->core_lock); --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302461; b=bmyIgVXC1WCE8Wvf3VQY/w3Qw4WECMKXKiwahRSHyjXOzXfq2M42e2/23vcfTYziwxHu Yt6BYEjfl+LsIh9wGA+d+Qa+Q4RbGBPiqQZFWOiF+PCcj/UjfRf+w5Cra4+gqopKnnX5r Hbl+Y3pVNLBCIheQ9r6Z/3C9KRgDEn08FfME2Q/DKRw/JitMqQGKKMRn7iyWruiLNJDyV N1JEcPb7tTj7cVsT/HAINKiRDR2EydSBkv3Ze9qlH0+bdEqR48+Pm8I6ZRv4IHSXCd/R5 yBXfhMPEibS0iFlfeXSAZm0A8bvjf+clV6N9Vm8jLP5u6vE8+rQoaTzFQD9usHX62JQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302461; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=zcSc726+ApkS3y0S6C44eyfA/ilxfVvvD1+ezXLb36Q=; b=fwN620OGlKPZaav5ooWY2HJ+B91PF951exb/a5IDCKXT1ES6kEpy2ve9nnLvrdRDjFUt Sq/CUG6i5JaizZKPLO3TU3DpiyPrEtFRyceBM9D6nF0FzIpkNeM1UC6cU62jVNiGh9dEt uKK/K0p0iStDBbbszTfbZ2q2Imz8xxVPg7kOltVXI0lCK8YhsEBPS1vMFXjYfFvJ8EqLn Axa8nqCMJFYeGr6M/g9I4/T9Kw8e0gIcA5/J8bPnyrJOKercCLGUwojflgMnWBNG/DhUY X5s9YiOUwEIivSEvqsynGEhfVCCIom4W46GxI5BLfrE914coBGb4G3asKaH8qq0eKgQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=r9MGaone; arc=none smtp.remote-ip=209.85.218.52 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0332B606A6A7 for ; Sat, 21 Nov 2026 23:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0332B606A6A7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=r9MGaone Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-c5118deebcfso310935866b.1 for ; Sat, 21 Nov 2026 15:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302459; x=1795907259; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zcSc726+ApkS3y0S6C44eyfA/ilxfVvvD1+ezXLb36Q=; b=r9MGaoneRTSQq9HFtbgu5rMg05/5EDN0/4cGpdIzKtxTjj/jtlvEHTiJJjJOWnNMrf MD0kRgWKGukySP9etwtLKPPxHc1jG8SRvw5oRGSsrIbtxVsoV+N+KFjZX86QH1vU5Hua rw3tok7JW9P1qvpxD6PONN8SytZarfGveuM3Yi7GMTC2Wnig0nmjI5BfVTSCZZXjf174 JOKhGT/5bseaLvHl4Op4wA5KAMm0C7WIYjFg5e/K+e6J3z5ZPtkxMP0EUgmB2Pd5cuGk jR8STs+QgPYnjLFNfRFT48+XMNo0Oibe+Z3WxaR0m/lFCSdOPkdXLWGp5/WBFElyZAp6 fG/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302459; x=1795907259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zcSc726+ApkS3y0S6C44eyfA/ilxfVvvD1+ezXLb36Q=; b=XIdlWGtB3ZYpBdtkKteRHIZv3nMuV3vyHYlC7hPhBbnmbxwLX0hJWJHUCuzB5httCB s0kVQsPZc9HhJvn8ASDJraPYPK+f78r2pB2eS/PxMkeLUnKqOa2vpO6Wl//4IpzcGFxj b/KWzv6h4hdyRebDMrJzInV/j8hQ1P6AxjowdXBaOgpdzP2yY43/Petf7QZTFnqE30zz cIB4WVTx9dkwSEVPpSMeGygpOP27sJV2fL5AidLRwrUNf2qkmHqYSfOkS2zmFp/Y/IXT //zppjwWvJvw35/ldTUM67jIxY8fA7rGhBw0szbtr1n49XT3pc2ZcogHSD9Qq7vg0CEH zxHQ== X-Forwarded-Encrypted: i=1; AL+hErHRFR5EEIHiPSuuXdUPqISwACuBaTGQMkvd9FYOVUD00y5bYmupiTDA04LM2c2/QmYb/cVwLpZCIT3fqU8=@vger.kernel.org X-Gm-Message-State: APuU4Z+s/i+b24ZWONspjryiShFOFFCo/OZ1oTKu4ZzBqs+qtS5gIq2W IPb2I60KgUWx/hI6jm7mEl/9yiNiEPzM8JHDCAo/hgPQfoSuM3n3Ff4v5wOBW+62EQ== X-Gm-Gg: AZFdTZf6wbEdYvByb5dxMar9mmr7Y+zPrnwULh+oY1bTB446JCdVkJ51XNMjAfRYsPB xUFprF0KsEyngj4Sm7Lv03cDYSblH58FCZukeeGJnM/OsW21O1p50VVS4eAgOmeaKcUNCW6Fkd9 C3UiBd5U/uJPTZ+usZDGh1G26qaE51bHRcOab1J6UD87f9+3P2Uxk+v1wOzNKyKu7lKszKqPnAl 9XYRZKn/5Xbqubo4dyraO3Zxmnq4elTQBk5zR+wivaN6mvtIbsGGWvsSdoCSckNBNFYGsqHDeqB 5/cSliFPAa0YL+clpdKUx3IbwLekZZyPQ5AzF+g29btV+EIvl4HqsuD6b0U4mYaZkO3xSCDTlOF ZaWnIHucug/7eUuPHjJeOQQBJ6O1zNZ1NsIgkbFsY2+3FetSJ/AGV1dVPcJsEeOUS+ZPZFAZWSJ zmeX+d6quX390mmofVaS/NH36+G7/x0NzozuiP7aFhb0ruCtNZx860ZAxW3mDpNZTgmqSt95GFk n1iaC7/opcLMOYgTnjlepOiMftMXu5dJfEJ+qtTVQW/feYtQi80w6MMDK96M5vTrgBcrBNJ9nnc /hSX+OQ+Crfi5Ko9OJi6sOdOq7aUlu8vUn9RKyg0wsQXyx0Zikfd+Aa0kwyJVnJaM9V9JmBcmGQ qkM11oStuU2CSl306wkfMbn93s5moSZ2/R5gkr26qkWil6THKd/bss96Q16JMWy8W5EezzN8ZB4 G+FpgP/vof1H15RkBR2iTk14f0iXqQzWyczkXOtDFZEZ5nPq/Z3qJW9KShTiztl6Te6ARYE3r2Y DofNG5MLM+Lib2b0bSk0os2cqfxeWH+0vGeyj3HdiLfMiLxZxXAwmit0oinuRP0CtNNH/VPMbwI 5P7xJwDKlWsjIFzJ2MTn++vn8GpdHPiT5oxq3CreIJXVCbEKhT7EqjYztVj6JQIeDcC5P9IZnXY = X-Received: by 2002:a17:906:b009:b0:c29:4fcb:2886 with SMTP id a640c23a62f3a-c513ab47ff7mr440549966b.39.1795302459360; Sat, 21 Nov 2026 15:07:39 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:37 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 03/13] wifi: ath11k: keep the srng allocations when a firmware recovery fails Date: Sun, 22 Nov 2026 00:07:21 +0100 Message-ID: <20261121230731.1206043-4-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 32be3ca4cf78 ("wifi: ath11k: HAL SRNG: don't deinitialize and re-initialize again") recovery zeroes the hal state instead of freeing and reallocating it, but a failed recovery still calls ath11k_hal_srng_deinit(). This frees the ring pointer buffers and the ring configuration, which only probe allocates, while the rings still point into them. Driver removal then walks the copy engine rings through the freed buffers: ath11k c000000.wifi: failed to reconfigure driver on crash recovery ... Unable to handle kernel paging request at virtual address ffffffc080ee5090 pc : ath11k_hal_srng_access_begin+0xc/0x60 [ath11k] Call trace: ath11k_hal_srng_access_begin+0xc/0x60 [ath11k] (P) ath11k_ce_cleanup_pipes+0x16c/0x4cc [ath11k] ath11k_ahb_stop+0x2c/0x3c [ath11k_ahb] ath11k_core_deinit+0xec/0x168 [ath11k] ath11k_ahb_remove+0x30/0x90 [ath11k_ahb] Return the error and keep the allocations for ath11k_ahb_remove() and ath11k_pci_remove() to free. A recovery that fails before ath11k_ce_init_pipes() rebuilds the rings leaves them as ath11k_hal_srng_clear() zeroed them, lock included, and the same walk then reads the NULL tail pointer in ath11k_ce_completed_send_next(), at removal or in the next recovery. Nothing in dev_flags tells such a recovery from one that failed after the rings were rebuilt. Set ATH11K_FLAG_CE_RINGS_SETUP once ath11k_ce_init_pipes() has set the rings up, clear it where ath11k_hal_srng_clear() zeroes them, and let ath11k_ce_cleanup_pipes(), which every copy engine teardown goes through, return while it is clear. The rx_replenish_retry timer posts buffers to the copy engine rings and ath11k_core_reconfigure_on_crash() does not stop it, so it can fire on the zeroed rings too. Stop it before the copy engine cleanup, as ath11k_ahb_stop() does. Also test ATH11K_FLAG_CRASH_FLUSH in ath11k_ce_send() before it reaps a ring rather than after. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: 32be3ca4cf78 ("wifi: ath11k: HAL SRNG: don't deinitialize and re-ini= tialize again") Signed-off-by: Julius Bairaktaris --- v3: record whether the CE rings are set up in ATH11K_FLAG_CE_RINGS_SETUP and let ath11k_ce_cleanup_pipes() return while it is clear, instead of testing = HAL srng fields in the CE layer (Baochen Qiang, v1); stop rx_replenish_retry be= fore the CE cleanup; test CRASH_FLUSH in ath11k_ce_send() before reaping. drivers/net/wireless/ath/ath11k/ce.c | 9 ++++++--- drivers/net/wireless/ath/ath11k/core.c | 10 +++++----- drivers/net/wireless/ath/ath11k/core.h | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/at= h/ath11k/ce.c index 1e08b0970b14..af08a2a24c6d 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -718,6 +718,9 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_bu= ff *skb, u8 pipe_id, u8 byte_swap_data =3D 0; int num_used; =20 + if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) + return -ESHUTDOWN; + /* Check if some entries could be regained by handling tx completion if * the CE has interrupts disabled and the used entries is more than the * defined usage threshold. @@ -740,9 +743,6 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_bu= ff *skb, u8 pipe_id, ath11k_ce_poll_send_completed(ab, pipe->pipe_num); } =20 - if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) - return -ESHUTDOWN; - spin_lock_bh(&ab->ce.ce_lock); =20 write_index =3D pipe->src_ring->write_index; @@ -866,6 +866,9 @@ void ath11k_ce_cleanup_pipes(struct ath11k_base *ab) struct ath11k_ce_pipe *pipe; int pipe_num; =20 + if (!test_bit(ATH11K_FLAG_CE_RINGS_SETUP, &ab->dev_flags)) + return; + ath11k_ce_stop_shadow_timers(ab); =20 for (pipe_num =3D 0; pipe_num < ab->hw_params.ce_count; pipe_num++) { diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index 5f4e7fbe0b25..d6346e0ee047 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2290,6 +2290,8 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base= *ab) goto err_firmware_stop; } =20 + set_bit(ATH11K_FLAG_CE_RINGS_SETUP, &ab->dev_flags); + ret =3D ath11k_dp_alloc(ab); if (ret) { ath11k_err(ab, "failed to init DP: %d\n", ret); @@ -2340,12 +2342,14 @@ static int ath11k_core_reconfigure_on_crash(struct = ath11k_base *ab) ath11k_dp_pdev_free(ab); ath11k_cfr_deinit(ab); ath11k_spectral_deinit(ab); + timer_delete_sync(&ab->rx_replenish_retry); ath11k_ce_cleanup_pipes(ab); ath11k_wmi_detach(ab); ath11k_dp_pdev_reo_cleanup(ab); mutex_unlock(&ab->core_lock); =20 ath11k_dp_free(ab); + clear_bit(ATH11K_FLAG_CE_RINGS_SETUP, &ab->dev_flags); ath11k_hal_srng_clear(ab); =20 ab->free_vdev_map =3D (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - = 1; @@ -2354,15 +2358,11 @@ static int ath11k_core_reconfigure_on_crash(struct = ath11k_base *ab) =20 ret =3D ath11k_core_qmi_firmware_ready(ab); if (ret) - goto err_hal_srng_deinit; + return ret; =20 clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); =20 return 0; - -err_hal_srng_deinit: - ath11k_hal_srng_deinit(ab); - return ret; } =20 void ath11k_core_halt(struct ath11k *ar) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/= ath/ath11k/core.h index a0d725923ef2..593e54c59737 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -288,6 +288,7 @@ enum ath11k_dev_flags { ATH11K_FLAG_DEVICE_INIT_DONE, ATH11K_FLAG_MULTI_MSI_VECTORS, ATH11K_FLAG_FTM_SEGMENTED, + ATH11K_FLAG_CE_RINGS_SETUP, }; =20 enum ath11k_monitor_flags { --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302463; b=jZoIIUL/1ES26XfStPFXIZsICBDi4BybGGmBUpRvlXZsaMS3c9G7Agv+LsbQnkT/zb6L TBGpVlvM2zv+ny2l/U6ztoTAaLWz/50ZYE3itLhHSRI8Dw2NnvzznnIH41SWwNw4Y0HsY qlGo0+idzAhCqvumNVA4sVQs8qDjZeJ3ffNfZI5ElP+QFRNXXLwLCnRJgG3iCb0wegoV/ gjDk9AWiXi5YNceQWaHTnv60+HRYDYXTRw6dBjr9ZNZUejQeqcmY15dQCgx7oGanTT9g4 0/OQtWnp+1obiO8RwDjK5Fa0d6tpaFXAKqPh4dJi3bmiRWsPSYYE4D7x1oG29UjSrgQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302463; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=RzF4XgzG+OFQFl38cVbBCWJ0+gCFYYh6ZK+opbkd1ps=; b=ObdfIVAWd5CRvxiY5v3spbqMtSqiptiiiE5bggVoQFLSl6DARNVu6+inEaLnKqO4jhDZ WBiRPayklgNvk8a9MGiRh40RZg5AspPE5CnxQm4hY3Iyv84+h1SNPEswQmoL9xLu7O6Yj ZrKQJxBnmNZDPTNjr6MCgHh9A7R40SWA/fHS8USwFW3eptZYB6blVKelYFnxTNJn9rFo+ hDQ5C2/JW2MkfHLkW8OpCV4e8mX/4YWxOOZbMfrGvGBS38LmsdAJyYmJ+kq5wqtUNLLOB CKTKIhGDU/O76quOeWb3n78dFWEtkwH597Ux+RKtfxEG2/IlwkicAQw9ExHQPLP9KFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=perZYWZG; arc=none smtp.remote-ip=209.85.218.53 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F777606A682 for ; Sat, 21 Nov 2026 23:07:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7F777606A682 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=perZYWZG Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-c515319dd89so205408766b.1 for ; Sat, 21 Nov 2026 15:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302461; x=1795907261; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=RzF4XgzG+OFQFl38cVbBCWJ0+gCFYYh6ZK+opbkd1ps=; b=perZYWZGTcIuDNxZ1nNcXbkGt1MfSRoIGXrDThH6wtSW1YycsyCGWdVYa+8OuBNXO6 ByG7Yz1v6eqxlhboGR+icRKs0jVlLpigyx6mYblj2e9H3NWI6bTyM7mAMa//h1PbvvqN qbdp8HCTVlfjOYtvRI7owdNEzwYziZUVpRt4bLhY+hrcUIqUl6wov4QxDpDOOIl6j6+U WYYXYWCtDJc5+IibQH7Y0li79LmE+YD62U6UiWoeKUUCgvcMXX+WbJ+d2qVAieGmPTKb ButlWGnvBQD02CRn72fKLE3d+3CT9ArjqFmVNGuWUzQDYYE3ZHSowxpPVCUXd6mXEvwm J7GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302461; x=1795907261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=RzF4XgzG+OFQFl38cVbBCWJ0+gCFYYh6ZK+opbkd1ps=; b=yCxT6ydVrXDyPE53IK4dg4l3127PDIFd0b3z5RSrQj3DxwAjyX0X+jfG7afYT1hQYc v8Zl1BgdyFUjLYZEa6YKcVTyYH3eytPwc1aObt1ar8lg1PfLTnja/rT1otsQhHEc9Z9F oVZUESQ0WsLVw2jm3D1MHj0ee/vBQWDkBwBelIm43GJzn0rcrH8K1hn1DkZcJygotszF +S0pSiutg8h+2SNgTcoNIdBL0uG/wHNUTO6uXoqBzCwRgsxoasx5u595g2EqtirbBZlH MTpfADYhMAfJQ9ncqHz0f5mNX19JTacYL5OCbWIlpvkTIcwkzQcI3tMOOKrWge8ng/S6 07HQ== X-Forwarded-Encrypted: i=1; AL+hErHJWgf1cVXUacBnpWBjMM9wd0XAHeNwVgTvMFE8kEIpg+GgvL8UWTuDwfZSZqOrl0jv4gHb5U2ZUROkLi4=@vger.kernel.org X-Gm-Message-State: APuU4Z/MJnerSPoO4oikifFRt5TGmDX58PEV9dxojdqcU7qTCOy7NW9F vzy/yN354A1l/D+wqIJo4fqp0NgTErM5w7kjKj6VT6AkIXSjdJ96CZepwDdj5AC1dg== X-Gm-Gg: AZFdTZflNzMbOOCxIHXp4XGVq2APxkd6m2poaMq6XoL7TD3AasQlkiNtAyCXHk2rwyM Fben4rA979AjHBoyAsZ04xrYxcZn08JCFA7wdf+Fb1ZvHUIL0mhHgGiUzn/0D8ae25UsDQnTylz ldmbkuJ2qec+Prb6qJWQIfNyy8xxmWy1c/DaC1UCfXlCpDtGZIZ5hiB5ws3wL6YZEZQi6epFltf 5BDnkpoihi8F/pSbhLwodugj5KaqGe9yt4w1OQidNarbNIOlDwlkFWTNMkTuOrH5ZHFjstU4mKW tYcE/dTaya1rnqqB4qBWKeJ8jOi7I2BT5cn+BCt3e4aI1OdEJ1wrOO3KdddcWQUr8HWxHO2S/qu z7lvrLo0K0aSbkHHUFrqwhAsJU6FDwyNmZv74wxWOIq5qNMKstYklSJ0ZTDxwoVxYYLipOd7A3e UVNrybKduDxWJy/ZxvKIFyfl7T4YC5NSIT3N8LTzNC0KaVwSGeYpk/jEEk5EAPz9LdTaFX4ZaY5 rKEbLy/kkdmiBVsQNTLY/gSIt6LsqX1hp7FkATwQB/+tbWsSjqvXunb/JyDDO89kTRXzQFQge4c 1sRFhmY3+cfyIzYbD5IMJjbH4V3BvRkmTL4k1arhEMTy5AtmaP7JePQaGP8SfdyyEs40ZXtHs4C FLknCdh/Y4sIxvh+kJB+cIPGmR86+ApXB2A4jbSYMWJRcZWsX9okol2bst77rrAr7MpZ65T/IAd 6x9ia8Eq+cr10KIA5d/gwGy2esuo8Vy1xCINMKoQRldhHZBB9QOoSLI/cqEzQRb3m7mrJXtd3IV v+JkNopY73Ul3cF7LzWSnIRua6PI6vP2pLWCCpkCoxC97YfYl62ov5Frax4BX5NhQLSybUChrNY ajfISdZ72Ffg4E777f9D1gi9NvOfyJ1qEUDx4ZtRbVWszyRtSikUByz1Ud1CMZmAad3ZifgsvsA = X-Received: by 2002:a17:906:4750:b0:c3f:dce3:20d5 with SMTP id a640c23a62f3a-c513a88a462mr502393666b.22.1795302460965; Sat, 21 Nov 2026 15:07:40 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:39 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 04/13] wifi: ath11k: clear CRASH_FLUSH only after recovery rebuilds the rings Date: Sun, 22 Nov 2026 00:07:22 +0100 Message-ID: <20261121230731.1206043-5-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_core_reconfigure_on_crash() clears ATH11K_FLAG_CRASH_FLUSH right after ath11k_hal_srng_clear() zeroes the rings, but ath11k_ce_init_pipes() and ath11k_dp_alloc() rebuild them only later. A WMI command sent in between passes the CRASH_FLUSH check in ath11k_ce_send() and dereferences the NULL tail pointer of the cleared ring: Unable to handle kernel read from unreadable memory at virtual address 0 pc : ath11k_hal_srng_access_begin+0xc/0x60 [ath11k] lr : ath11k_ce_send+0x114/0x350 [ath11k] Call trace: ath11k_hal_srng_access_begin+0xc/0x60 [ath11k] (P) ath11k_htc_send+0x188/0x3c8 [ath11k] ath11k_wmi_cmd_send+0xc8/0x2f4 [ath11k] ath11k_wmi_send_peer_create_cmd+0x78/0xe0 [ath11k] ath11k_peer_create+0x138/0x500 [ath11k] Clear the flag once the rings are rebuilt, before ath11k_core_start() sends the first HTC message. If ath11k_core_start() or ath11k_core_pdev_create() then fails, the error path frees the data path rings with the flag clear. The stations stay in ab->peers, so removing one later, or removing the driver, makes ath11k_dp_tx_send_reo_cmd() write a REO command into the freed REO command ring. Set the flag again before ath11k_dp_free(). On targets that do not restart the firmware after the cold boot calibration, the QMI FW_READY handler clears the flag as well, also during a recovery. FW_READY follows the firmware start, so it arrives while the restart work is still rebuilding the rings. Clear the flag there only on the first boot, before that handler starts the firmware itself. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Julius Bairaktaris --- v3: set CRASH_FLUSH again before ath11k_dp_free() in the error path; clear = it in the FW_READY handler only on the first boot. drivers/net/wireless/ath/ath11k/core.c | 5 +++-- drivers/net/wireless/ath/ath11k/qmi.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index d6346e0ee047..7456a8422654 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2298,6 +2298,8 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base= *ab) goto err_firmware_stop; } =20 + clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); + if (ath11k_frame_mode =3D=3D ATH11K_HW_TXRX_RAW) set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags); =20 @@ -2323,6 +2325,7 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base= *ab) if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) ath11k_mac_destroy(ab); err_dp_free: + set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); ath11k_dp_free(ab); mutex_unlock(&ab->core_lock); err_firmware_stop: @@ -2354,8 +2357,6 @@ static int ath11k_core_reconfigure_on_crash(struct at= h11k_base *ab) =20 ab->free_vdev_map =3D (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - = 1; =20 - clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); - ret =3D ath11k_core_qmi_firmware_ready(ab); if (ret) return ret; diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index 7dc07339b957..a176e6498ec9 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -3291,10 +3291,10 @@ static void ath11k_qmi_driver_event_work(struct wor= k_struct *work) if (ab->hw_params.cbcal_restart_fw) break; =20 - clear_bit(ATH11K_FLAG_CRASH_FLUSH, - &ab->dev_flags); clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { + clear_bit(ATH11K_FLAG_CRASH_FLUSH, + &ab->dev_flags); ret =3D ath11k_core_qmi_firmware_ready(ab); if (ret) { set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302463; b=j2fVEAE06F2WxpEuEZbWQYV0xV8AJIztmL10c86qFRdB3lZI3LP3Z1wbesti0QDpnesm VuuPGtEOFrkwCE52t3BLqoS3QnEdsrkxlXeYeZg7Z6yfXJ4oKfqEHW8mF2hFwM7/iof3Q lDH//Mhkz+Y5evsZ+4DMBizAGTtV5UyYNLI9P8+9deOWYKjUYQAdgxCqkr6aMMMMV5kyD zrXNulJAaDUgVgbyga9RdNCmz/PV7B2ioilC/Ky4vTxZlly0zVboimGOYUHfhlbJXvgDv rT6pDfRB+nvl92uRYgtxkp/bo0rKovmB50PZxWgtzD6/gBL+Xb4sKvRjI2jUti2P4JQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302463; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=hlEiGChDshIaLlR9BvOU0o+rgL/gk2KuiaEP6jU9NU4=; b=lbxcv1gIJslla5o2f2YXYWm9UcGii/elpZ0FkBLm18rniYzkq/9Q3gWlMU3BX4NfYHOF o4Zqjc1RGKCckz4r/WjJ0ynUMa3TUHNYlZbEf/k2y4ver4uxrADBoA7x7fg8jTVzRDICa U4JH4bANGKrzQje7wxBFFPcQ2ksY/QZkeOZFUMZy2pIGzie8Fa8Lx5T087CJYapKo5W65 YaCacHLtg46ToWBMAxUiK/zghYGtj6FqplNEamliABg0A0nDd0UyoFpJ9KN4+IckDdC08 FHpIAup/UZL2Gz1zXdJg4sQTlddbVCFdYqE4v/jEXLVbUqmCPxvgilf9boWG8/KaE/A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=hViEOR77; arc=none smtp.remote-ip=209.85.218.43 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60360606A6B8 for ; Sat, 21 Nov 2026 23:07:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 60360606A6B8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=hViEOR77 Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c505b2e1cb9so391294666b.2 for ; Sat, 21 Nov 2026 15:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302462; x=1795907262; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hlEiGChDshIaLlR9BvOU0o+rgL/gk2KuiaEP6jU9NU4=; b=hViEOR77vvb48wZzRWUrPldcdOdYdzqZg1ZpZmKwlQcepmRMcwB+zvuKGYv3qrmsoo ZYVv/z7JZrcd8hJVzX4kKTi5isBqdwxd1LOeU3LshKJqyHFtfPT/hrLa5q+HpY/cpHV3 kmKsZDpYW0dwDyz9MAub1wiYW1p2BM6nNRpB56MCbUI9k1u49r+mxMHewH9oEDpvI6DB +NXYZiXd6TUtafpZew45jOmV3Fshk6hVING3m0z9jTFp6dZ2fWyaRWrs8OQXyra0LUw1 p+7tChwn69UVjX8JM5SO2+g61xschK0dVIaaC2bVUzChBdSzFsLxvPtrJQknzCmUx7qm 9E/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302462; x=1795907262; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=hlEiGChDshIaLlR9BvOU0o+rgL/gk2KuiaEP6jU9NU4=; b=MqoS3hcWHyeMfmo/mqdmkchY/K/gxJyjk6FdtUYyvSo7i/RNMWkYRaYOaBJAFgG9br aR/m6s3MmJvJC8pPox31pDP1cdzjWfHD/29qQcL3NM+qa5grnQ+fx21XAM7lp5FHR0LW n1Y2Q9DIAVmtwVoq8r5j1cTINSexez0EXb7mF3B/gHJjADfIyBZDV10q6XGrkGKyS1E2 lMV7WuoOwkiBezj8Ol33FnrC1rO2qwFl1fL5AH8NyREs/bz5EQXER0I1/effn+6ESiK5 se0s3vytModvTAyrmMguJhlkoh7WQhZTPBaFm1gGQGRrta2oUPbE8Ue1xXFbEEFUrkqN tIfw== X-Forwarded-Encrypted: i=1; AL+hErEEs0khtERc6SeKH4O43eCe4PUVI5YwbYByD0+2AvGbXnkX3HGzDoVbGr15oP6HcLIRSpDc/eAwSqjOodk=@vger.kernel.org X-Gm-Message-State: APuU4Z8/a/VZHkt5Wt0zxW+d7YRTYhnU5fsGS+uYLzmK1p8FAakB0MZf jf99kMFUay/dIyKFtaZX9NP9cuIO9Uq3quj7eLKD/48x+EPp4GgwLVHjJAypCuXSmg== X-Gm-Gg: AZFdTZf7zkZ4qKiqqqqEWUXwm/1CH4SajdMTKMhFz6+1dPcpDQmR4LUIB7tycs8sZP4 J7X0bxW4JdoMMbFO2tlQOHZyVb1x7wb8ho0tKfvLdWvuCSxM+jOLoDu+8btelmVj7glmHj8pzYg GlcKsp2HgLrvLDRiuJxSzlGao7bVCnX0B529XmMkU/age3isUSbUmYf6CGCm/PLUq/lZcbqvbOK 8dI//bD5wu7anWhRXA3ohAG/cgndvIveCmO9nC74vQXyevH+8WC2fGJOuAx4/pxR8HEi/VlRnI/ JrEL9ldrQ2wnCPnaQ4RbaaTNqwjeLxpku8M82Iplyiij262jY2RGOj6Gup62qyQSGvQuGpXveTe v0tWZMWfw23qkpGxICLGRcZ6gj7oYrE5qWT+xtaFJFMPndKnOIn8fc03+orM4pa/RhrR6MLertI JfjzSheQ9xdd+SN5oPHWQuRVgtl5s+MqY8EnLDeLS09nOR9ebPYWms7cRlpcJIJD5M4CZWeLs1m 8/QogoBOahJjlhzbLxtghJtwJ+sWm7cQBvq3gPw6pHmOPNd3N7731V9YB+63fbO433zxc83h1ca aqtBjNpMVU0FAMh9JWlgQVi4le5te1JX2rNHN8QEY0aOo4SMv5eeiySxGnUFUVwOgI7tH2cZbeb TERg7akVmFImbIhIRwsz9JUN9FBgy4TXe25vmFxlvAp+/BS6QCxqDoArm41iDvGKU5+rpQXJd4K 1k8ua4yhvL8hvTexFgjE1OiD4XuvCLqFgCVsEh/JKKZrJJJkdEu2ofrD0vcDt3bRHmMKhD3mv83 eGH03PjI8O92MUZ9xOzC/x4K36kVkNvpSQ915nEUmy36oZWf8mumoaWot6putIr/HpDUXTEN9Qr E4Is7MAuMzRLDKyFtz2ZP0WwJcDwBEJsNAWWKLqL/2R3qrLMONJIx4ADEA0UOMILYwX5tPymLvE = X-Received: by 2002:a17:906:1553:b0:c50:576f:b39e with SMTP id a640c23a62f3a-c513ab0cf13mr413314766b.26.1795302461807; Sat, 21 Nov 2026 15:07:41 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:41 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 05/13] wifi: ath11k: hold back WMI commands while the firmware restarts Date: Sun, 22 Nov 2026 00:07:23 +0100 Message-ID: <20261121230731.1206043-6-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_core_restart() brings the firmware up outside mac80211's restart, so cfg80211 operations keep sending WMI commands while the HTC services reconnect and before the firmware reports ready. These commands crash the restarting firmware again, and recovery then fails on the unified ready timeout: ath11k c000000.wifi: failed to receive wmi unified ready event: -110 ath11k c000000.wifi: failed to reconfigure driver on crash recovery With iw setting the RTS threshold in a loop from the moment the firmware stops, the firmware crashed 15, 15 and 11 times on three triggers before recovery succeeded. With this patch it crashed once per trigger (5 of 5). Return -ESHUTDOWN for commands from outside the restart worker while ATH11K_FLAG_RECOVERY is set. mac80211 replays the configuration when the driver restarts the hardware. Test the flag on every try of the send loop, not only on entry: a command that already waits for a WMI credit or a CE descriptor when the firmware crashes would otherwise be sent once the restart worker's own commands free one. Wake the waiters for CE descriptors in ath11k_core_pre_reconfigure_recovery(), as it already does for credits, so they return when the recovery starts. On targets that do not restart the firmware after the cold boot calibration, the QMI FW_READY handler clears the flag also during a recovery, while the restart worker is still bringing the firmware up. Clear it there only on the first boot. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Julius Bairaktaris --- v3: test RECOVERY on every try of the send loops, wake the CE descriptor waiters in ath11k_core_pre_reconfigure_recovery(), clear RECOVERY in the FW_READY handler only on the first boot. Florian's Tested-by dropped, as the code changed. drivers/net/wireless/ath/ath11k/core.c | 2 ++ drivers/net/wireless/ath/ath11k/qmi.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index 7456a8422654..e8d245f1023a 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2463,6 +2463,8 @@ void ath11k_core_pre_reconfigure_recovery(struct ath1= 1k_base *ab) } =20 wake_up(&ab->wmi_ab.tx_credits_wq); + for (i =3D 0; i < ARRAY_SIZE(ab->wmi_ab.wmi); i++) + wake_up(&ab->wmi_ab.wmi[i].tx_ce_desc_wq); wake_up(&ab->peer_mapping_wq); =20 reinit_completion(&ab->driver_recovery); diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index a176e6498ec9..aee32aec8732 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -3291,10 +3291,10 @@ static void ath11k_qmi_driver_event_work(struct wor= k_struct *work) if (ab->hw_params.cbcal_restart_fw) break; =20 - clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); + clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags); ret =3D ath11k_core_qmi_firmware_ready(ab); if (ret) { set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/a= th/ath11k/wmi.c index 5f2412982229..82b8481ba818 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -303,6 +303,17 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_pd= ev_wmi *wmi, struct sk_buf return ret; } =20 +/* + * While the firmware restarts, only the restart work talks to it. + * Tested on every try, so that a sender which already waits for a + * credit or a CE descriptor when the firmware crashes is held back too. + */ +static bool ath11k_wmi_cmd_held_back(struct ath11k_base *ab) +{ + return test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) && + current_work() !=3D &ab->restart_work; +} + int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb, u32 cmd_id) { @@ -314,7 +325,10 @@ int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, s= truct sk_buff *skb, =20 if (ab->hw_params.credit_flow) { wait_event_timeout(wmi_ab->tx_credits_wq, ({ - ret =3D ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id); + if (ath11k_wmi_cmd_held_back(ab)) + ret =3D -ESHUTDOWN; + else + ret =3D ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id); =20 if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH, &wmi_ab->ab->dev_flags)) @@ -324,7 +338,10 @@ int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, s= truct sk_buff *skb, }), WMI_SEND_TIMEOUT_HZ); } else { wait_event_timeout(wmi->tx_ce_desc_wq, ({ - ret =3D ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id); + if (ath11k_wmi_cmd_held_back(ab)) + ret =3D -ESHUTDOWN; + else + ret =3D ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id); =20 if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH, &wmi_ab->ab->dev_flags)) --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302466; b=kPDsZhTw7nO6ewvoCCXBt1nOGdbaNdPW47RdVARkjm+yYfYJHKXed2x6qKm6h/mmr0Dr OoWd+4lHBNp2AyY9JJJE+0Ok/U1yMWh9YuTaBN2ow5AjgvAu0URrItUuZbEmd7+BPmOGN SQ+Ui7Fe02g4bHqa/GUeCrF/hetgh2q2m147UmrCBQiiGZj8sL49sUp6jKDoLjM5YJ4ev dGSs2LW4IcxnC8gTikI+iAP63t6HPDNvZG1xItXiLWdjjVnaAKAE1jiL+zmi6BXMQx7vz 8MF2Kz7ELNXwjI9xZIFc0mAOL3MKftFiZUHsVzWO+z7pHL1LtrMm+OUwIRr+fGgSb3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302466; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=F8ANKK5K18HEbCqMKoJNZuWBCRpXtLBYrpTOrUncVlM=; b=wYNq2tvJm9XQr47q/lt02vBxKKfmbFOX41dyLEmQhD+WWFOFoJOryyUVtoG3qefyXdmZ te3bus8CoXabMLUE+L3Lr9jeAqYp+2nVD1bgCPujWORiRQMnygkx+pzlhfaKJm11DCfTl FsfG/2IU+z4NThNMZltsEyR/Yzlh4tlt3UAsV/k6x6fiuT/rAy8wnD0hVK47v0l0ZxZEU RaBcmnKDnpG1B0+6CcRyuUV7W+uKTKlhuopPaqantdDfXXOOfeKl9VqCECFV8v6k+Hgu7 pRzinlF0IJWqHEtdNOPKS4XH3z6mQl7OPPgD9vkEUBGpTCdEu9bUmbNJz9Zic3qgqhw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=YLxvM9lO; arc=none smtp.remote-ip=209.85.218.50 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3BF0606A332 for ; Sat, 21 Nov 2026 23:07:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C3BF0606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=YLxvM9lO Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-c4d21051042so360321466b.0 for ; Sat, 21 Nov 2026 15:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302464; x=1795907264; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=F8ANKK5K18HEbCqMKoJNZuWBCRpXtLBYrpTOrUncVlM=; b=YLxvM9lOh51yCpThdfwiEFEza0K0dYbM6wXgu35tDqk9pJVZNurcEdUfrHAG4KdW8i gy5WSOOJvTnPQ41t+JSOFPdJYQw4hpfyYHN1QuhZTB2kej81RiBecSKNfnDBiqgRr50F BXHpDMdSGvkIAPbNE4ACf4GvtnnobbyjMmF1WNBfdENu9zbuPPex9TXn0r7uZ2f87EzU X1P/6ouOx8XRqmo1yxiyj66XUXmLsBI4rXm0e9blG7WAWds60nLD9Oe/lTJg8ysm/NdY CxOWBaiyBE4CO82RyRRyZTuXRvjCyebss6snAqmtRR9ktbqGmR/FTMTWqdBd2uHWQmWt F0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302464; x=1795907264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=F8ANKK5K18HEbCqMKoJNZuWBCRpXtLBYrpTOrUncVlM=; b=Ml8IXZvVygte/DVrrFfGEShOCVxNR4fJdMxMIKkPO2ZpYRCsN7LueO89gFEhg8NhzT sc9HWqIzVJUldcecn/P/vnTM/m5Olqy0KddRbmXibYF/ZgjgD/ov41V6Xp3x26qpd4Yj 37a58BHsAaXXekfbnDJTEtkqCNBlgVwczpVmaXdKJhcFMgBsx8B3KH4jzIojuGl06g43 dNy5IUOfhQuSm7s/LEGOiDOFRRwjx4CYgHiyZ2R7AXThhRbST1ievPfQO22j1AQDf66j Odqg86bsyNznVMRkhAJ6Ahd9g+gk1F2C2vPc8bb1NnF2hGSvY+b48u/2BMB2rglQ3s2W dSRQ== X-Forwarded-Encrypted: i=1; AL+hErGIWFAZza3ommP88Xspx55h5IaZe4JGGjbiN3BI/lOb4HvWsQndJ6ZysJwR0/rvMD6FFvQ+ycjLyCO1IYA=@vger.kernel.org X-Gm-Message-State: APuU4Z/QFJLPRTA1ypOxEGQM3F+y93wxOO52KC11r/OPFhbd//+lppDe ZElp9ES7CESezOj8yAGJtTqVJ4ExfV8Ym7jQlaOWi1NFCjVOZ+gTfnojvBFVez8+gg== X-Gm-Gg: AZFdTZcyM1o1a/TbQftzESC4+pxu8QBCO/rDUa16cZlnIGOZP4ESf7dYHCrJA94RhTP wzHk7bfaOJW/VK2mrTp7OXAyAX6n5Lk7dLakIP53R6FsdJBVzNZS0kP/KqJ65SjI/PQWAbpf7Cb HunhO13ATlv0yFpMLuzG35VvLWrXkX7g4NKhtPEntuf9EJSEQ+z6XxcttzFtto7Gi99wCrQoFsb bwkiXZIGir0dLpCLi8TlRaU6WqqYLK6rxN9cuRZihCBwlyrwHFcu8lGX0VlTc2I2PmAWJWxa0RR G6iwAFvZJv8NBAEp/VMLOb2u12heYLa2lJJ+P4yHmubxv9/WYvofEHoW4YmrOxJxSwr7xBRdqJB K+8aOvnui1jJohIEC4eVCbx1gfFO3iXvuYkAEJ2fj+5cKqtceQ1K9JfnoZFJfVRljLevpulry0R qGheYj+Sfyq3LWe5Qr0V9kve0GsxW62YPvNZLuhnhUMND0v8GYY+b77+dIj6EQFg/lx0AnL6bbk b+brPQrjfkSrQ2T2mSVTcHAmAMr0bFHBZyZieW7XK9iBTB9677ngwim7hB255tWdkssi2mAWx2m OlmEuBLzm8nAHpRdoeoOm/+MrlgWfpMLmbtzvJBCocoYVVDyqTycPm/pTrLmWXaQcQjbg7i2UcK JeFOr8dy3FpqilEoX028uJxURpVDbTZ0D0au/tRCQeEFmRmB/imLRpR6AKU1LBCgHcqxW34CSjA 1Dyjw0++8ynyIoA0gQOFQDfiwM8TztxJ0I9kqRyXXpqfCsieruXCCYU1yAoTIv8voaNdWhIkhRv X1TO0GN3IhVQObQZFWz75cXqAoJ/slsT30l9YiG3lOnPbFdhEmhxbZ+wJmFOdT6Bm5Q/6/tRxd9 x8iP3UuDyTRtHxNQNwPH8QOaVDlXFgWl9j+3W61J59beADsuOIGkk1/ZhShn+KJLyhfy82/4JO0 = X-Received: by 2002:a17:907:6ea9:b0:c2e:856:2a08 with SMTP id a640c23a62f3a-c513a3a6598mr657443866b.1.1795302464094; Sat, 21 Nov 2026 15:07:44 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:42 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 06/13] wifi: ath11k: don't disable ext IRQs twice Date: Sun, 22 Nov 2026 00:07:24 +0100 Message-ID: <20261121230731.1206043-7-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Florian Maurer ath11k_core_reconfigure_on_crash() disables the IRQs at the start of every firmware recovery and ath11k_core_qmi_firmware_ready() enables them again at its end. If a recovery fails, they stay disabled. The next recovery disables them again, so the disable depth of the ext IRQs goes to two and the single enable_irq() leaves them masked. The DP rings would then not be serviced after an otherwise successful recovery. This is the same kind of imbalance as the one fixed for suspend/resume by commit e56c9d429ba0 ("wifi: ath11k: fix unbalanced IRQ enable/disable during suspend/resume"), but caused by a failed recovery. NAPI already handles this: it is only disabled if it is enabled. The ext IRQs are only enabled together with NAPI, so only disable them if NAPI is enabled as well. The pcic ext IRQ code has the same pattern, so change it there too. The PCI CE IRQs (ath11k_pcic_ce_irqs_disable()) can have the same imbalance after a failed recovery; they are not changed here. The AHB CE IRQs are not affected, as they are enabled and disabled through register bits without a disable depth. On IPQ8074 (AHB) this shows up when a failed recovery (forced with a test patch) is followed by another firmware crash: the recovery reports success, but TX completions stop, TX fails with "failed to transmit frame -12" and the firmware asserts again repeatedly. With this change the same sequence recovered 3 out of 3 times. The pcic change is compile-tested only. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 Fixes: f7a74e131d3f ("wifi: ath11k: disable interrupts during firmware cras= h recovery") Signed-off-by: Florian Maurer Signed-off-by: Julius Bairaktaris --- v3: new in this series, from Florian Maurer's series [1], unchanged. [1] https://lore.kernel.org/r/cover.1793531790.git.fmaurer@disroot.org drivers/net/wireless/ath/ath11k/ahb.c | 4 ++-- drivers/net/wireless/ath/ath11k/pcic.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/a= th/ath11k/ahb.c index 27d01411b6e9..3ff7d5f27f5e 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -235,9 +235,9 @@ static void __ath11k_ahb_ext_irq_disable(struct ath11k_= base *ab) for (i =3D 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { struct ath11k_ext_irq_grp *irq_grp =3D &ab->ext_irq_grp[i]; =20 - ath11k_ahb_ext_grp_disable(irq_grp); - + /* The IRQs are only enabled together with NAPI */ if (irq_grp->napi_enabled) { + ath11k_ahb_ext_grp_disable(irq_grp); napi_synchronize(&irq_grp->napi); napi_disable(&irq_grp->napi); irq_grp->napi_enabled =3D false; diff --git a/drivers/net/wireless/ath/ath11k/pcic.c b/drivers/net/wireless/= ath/ath11k/pcic.c index 2259adc3bbdc..2e7dfa8388b0 100644 --- a/drivers/net/wireless/ath/ath11k/pcic.c +++ b/drivers/net/wireless/ath/ath11k/pcic.c @@ -455,9 +455,9 @@ static void __ath11k_pcic_ext_irq_disable(struct ath11k= _base *ab) for (i =3D 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { struct ath11k_ext_irq_grp *irq_grp =3D &ab->ext_irq_grp[i]; =20 - ath11k_pcic_ext_grp_disable(irq_grp); - + /* The IRQs are only enabled together with NAPI */ if (irq_grp->napi_enabled) { + ath11k_pcic_ext_grp_disable(irq_grp); napi_synchronize(&irq_grp->napi); napi_disable(&irq_grp->napi); irq_grp->napi_enabled =3D false; --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302467; b=Oq/pTbGSbiDaWpdYAws9o2IfDtX7K2a1bR/pDzm1IppdiKXY13gls5d9SbeR9effgoEV RQKOl6Q+JjF2hGfy5mmMOSDGpt6qDvGw7v7Po0uN+KgHiPhGeboxGIU93VVeGPv3AOV4t FsgSNzB36SAEIEmUuzj3WC0u5zmOCX1ziZZjcgPlD/zw12R8GCkVTCjgF7UzBkOO4z5CN o4EUdR6TIRubw+Hu8htoX47VZFbHFWWyQ55kA4uxQcKEZJerbrYOjjuXiMKH/9bxsgnXQ 2zimGMA6JeMCnSlbuSJkKlBQWqZDhL0Q3J14GvEU7DPbr0w0SfyZuRjit4+u1OjrVxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302467; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=6btR2aaFXry8/+OvCG761RoKG42Ek6YtGx/y9HYL3Ck=; b=TVhc6K1s4SzXmfxUG/DISiGWejV9q5HOEh7jEUEUljf3sbfGXLnrb6woK5mRQrbvfFDI CGGDel1P1ehK4qA1XMVqQTPKGtFxE93RmknYtiKhwT4Mf9YSLCMMt3N6rtPdJq0bkeaB1 kGnSQA+KNV+dVYy7jUsAtfCrIvDgcfbu5gob3FFMQboa5MDlGS1MgUI2If2Owi31yMZqe xwex8TkJGskpOjpbJ1vR+aXN5AqUhGIikdl/MLprUgF4FKf0DfYvWy1FMaUea2c0ruqLR TxjFIZKCuez/AJOYktulV+QT2jESnz+atSZzcmDowYSskQQCx77ssROUxu3l0nMAJcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=HVjAoiGm; arc=none smtp.remote-ip=209.85.218.47 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B3BA60A2622 for ; Sat, 21 Nov 2026 23:07:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4B3BA60A2622 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=HVjAoiGm Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-c505b2e1cb9so391300666b.2 for ; Sat, 21 Nov 2026 15:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302466; x=1795907266; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6btR2aaFXry8/+OvCG761RoKG42Ek6YtGx/y9HYL3Ck=; b=HVjAoiGmKzeE58aE4rLmdcQ/r4u75DFDxLTKLE054NvRD91UQDoWR3Pc5gR+is2KIa D6oh0FYI2e5QMZYOYn2AakT269LA8bNEYuLZ4ffcTfDsKvOtbQTCDC4o0LwczQ958b1I 5uMi1gDDnMdV2AzsLMmGdYDxWp75IWZoTcWQNRVIloP/7or1u3IOSErK+aeSVw8LAeeY PRnA5h4LY4EjaGnGN1fD+IibMcXBFlJL6VEEplQspXY3FYClObVGgeSRQDSSId6r0/Xx GP+E6ZRWE5owkMPpND4PsJImNhbVcixE/YmfRTFdsEN+Ip+6zYXBCSCd1TiAWdEMlU+v jHFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302466; x=1795907266; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6btR2aaFXry8/+OvCG761RoKG42Ek6YtGx/y9HYL3Ck=; b=QLBF0CrLah2CNtD0aQQByf1B/PsZOjtPqFR3MyWO9NbymE7/J7ThBosWvcQT1ddh4i yXtafNepS9KwWJ6M7hEEaPssA05UU5vjXPp/N6lpMd+Yg/JE4Z0SMeIZyt1zYRKD7bq8 vSC1gDCJbsto1Wl7d7EkfgtCTpGbACLo4xoDK8bSOt32KMUnM0A6nX31RDWTxvJzHjOa SonT1rdUvhbNg3UHR0TxM+nOClV9fmV1QCGyoca0jMM22G/VxMUVlxXt1VoRvKTJQDYJ qYTyL7EeLl73AzQR8h+cOB5z614sYcIZeNNIZU5Xt8Jy4aaMhQnsa6LS0HI+JBtWVFH7 QBqg== X-Forwarded-Encrypted: i=1; AL+hErHViCT/vkm9efkjYLAH7hMROy/qY6Lm0u6c+Os3VXKxjeDYIZltQ3gbJTtgAiir7qoFeT0bAQzOEIHx57Y=@vger.kernel.org X-Gm-Message-State: APuU4Z/+Gf/8LrGN2Co+xzXfrU0FwRM9fAVvLT4b205M0uW23L4IJCH8 6lVfxkrY84FHuXXDEyw/mfRZm7hjm2tjaPbC0ZYx7qkRt2R/cdSvLdxhgxSN4nt+Bg== X-Gm-Gg: AZFdTZeFArQReKhppxT7TiTXxCa5WKOBwk1J/Qy3Mz1bi4ShcpPpyrqEHCzRLrQvwe/ csNxz6uTAUksrkoaH9wfdMu4NgWJFsFoPKWfGOGBtf9WSgrNVgbunLOHj3rzQvEcMCMZz2o+SrN JTK3XtQDyQPD4T4LyYgEsfrar+rM2iXHgB6/tKESsRqfw/Zmv6d/pKSgofGMrEXt2wA/dZ5W7vA kR3WU0Co+YAioQAiU03Fk+L5b5JzUaaOmklgLLdPAHmdCNBoEY/IT9tkcmz4QS6rGI4tzVb9rkL Bap3sxvR3tBsZThaMkXY8ocexs3vNi62Xqev0cbUbw6zqJywgvMvhAw920eq1Ei05fYDJouA0N3 rPDJaU2EVJgjX1Bcggvw4wTRYt5SmAYhIUhzQDHhhp8xVTMa982fLqSQcn0h5nzjJK57XEsHHcR vA584JWttvEdua6S+7AdtM4YMyBZ5WyXK4PLnDea3KzkF/T9UUeZt6TAMup1ygZVH6HxsUUilBD +mmiRsFJInubyXjLzdc7/ObIRG2Wc1bJk8mULXqN2ydDV+MosJ7+1LpjaOvVaLzoLVhcN2Ihwzd nTIo09SPOMggSTHuxtAOfrlKh4iSeFxy+B9XfOJ1nlo/lnW+TkLQy8BgbaH40czfzH85dXCuMhz KOJoZRas4h3HyFcrcW7xa/mgGI7HISLLyk5opdm9BoHzabfa5VdsyZgaw5l+ROPmdaN+CnrYJuG SD2nntaD+D7UBB7hUHQRABkYCuin5GGt53w7e/0BJCviy4hA/OI3vLPD75Wrp9amTxiLnbWv1hp KvTICTplyBDVAZajy+llLcYbzrW+ZEljSKF6T/U/J/dXiSOpBob8ZVbDNOwbYxKaKHgvkPbD1rh IGTxXf+7Gba+3I5FnAya1ihFNuFDyVabrjsKg/vBu9T4n0h3dQ36Ry1Y0sugQz04Y9sneI6Hr8k = X-Received: by 2002:a17:906:694f:b0:c50:ff1c:22be with SMTP id a640c23a62f3a-c513aace676mr469413066b.16.1795302465698; Sat, 21 Nov 2026 15:07:45 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:44 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 07/13] wifi: ath11k: depend on RPMSG instead of selecting it Date: Sun, 22 Nov 2026 00:07:25 +0100 Message-ID: <20261121230731.1206043-8-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Florian Maurer Commit 32ec8488d75d ("wifi: ath11k: fix sporadic WLAN initialization failures") made ATH11K_AHB select RPMSG, QRTR and QRTR_SMD. Selecting RPMSG makes it impossible for ATH11K_AHB to depend on QCOM_RPROC_COMMON, which is needed to use the remoteproc SSR notifier when ath11k_ahb is built in. Adding that dependency gives a recursive dependency error: symbol RPMSG is selected by ATH11K_AHB symbol ATH11K_AHB depends on QCOM_RPROC_COMMON symbol QCOM_RPROC_COMMON is selected by QCOM_Q6V5_ADSP symbol QCOM_Q6V5_ADSP depends on QCOM_SYSMON symbol QCOM_SYSMON depends on RPMSG RPMSG has no prompt and is selected by the rpmsg bus drivers (GLINK, SMD, virtio). ath11k_ahb needs one of these transports anyway, so it can depend on RPMSG like QRTR_SMD and QCOM_SYSMON do. QRTR and QRTR_SMD are still selected. Signed-off-by: Florian Maurer Signed-off-by: Julius Bairaktaris --- v3: new in this series, from Florian Maurer's series [1], unchanged. [1] https://lore.kernel.org/r/cover.1793531790.git.fmaurer@disroot.org drivers/net/wireless/ath/ath11k/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/Kconfig b/drivers/net/wireless= /ath/ath11k/Kconfig index 99f625b82fe1..2b608d4ed263 100644 --- a/drivers/net/wireless/ath/ath11k/Kconfig +++ b/drivers/net/wireless/ath/ath11k/Kconfig @@ -13,7 +13,7 @@ config ATH11K_AHB tristate "Atheros ath11k AHB support" depends on ATH11K depends on REMOTEPROC - select RPMSG + depends on RPMSG select QRTR select QRTR_SMD help --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302470; b=A5Xx5GDjPeyAwtgOEv34CX3T4sjZ5BCjKmOaWfoaVLoGD6LhkHLxdCbouh7AnxeTHNw1 OpTrQj1rEOZiO8YkTtpkSUqrkhkIjPOyZadx8R2htPfMoT7rI35s+eRV5R1Aom5q7zSky dyZovT2EZKiNCTFlGtbFjjHXpcX3CwmuP3p+4ApY7rNDLfgSKM/SuSe3/+gw5kHSrrOG3 CvyqWYWJH10aX7LP7L3Cs+opTo4OsyHH5YCb6nHdJ6etOv2EUWV8P0jJP5yYYYZHyY2yu ST3VuvyMSPqnVaSY+lYBNLGxbCeAWxCIsUaMzYvceY/IywfpaPY9AgN+y60DO2RBDXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302470; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=tpQhoYWqRN3wyjl4/Pm/giPsZJPxZ0KHVMsW8Smmq8A=; b=r0VHNrqMd6YiNyvzHDP9udRWZZQjlszbvNCEWD001agwKQDM5Agb3BgSiTe56dOS+/+/ U+hnFZWfZUmcPhrni4ijOwM1UN5PZcX90waPfH061p1woluw8+trRiaXdEGOrshWAKW/9 4dvrRHWu0/LmEUcKs8SUBRiUtjqT1jC7VOdn22TnAkDezIFQWnb58wLm0d9yA+uKcGnNY sCqNOurHo4o/eBRGBTAeNqul2TM6MeNXgBVuRIM/RzrQJTUi2nsfEYdrzF2WiOBIph/jW nzcRN3SWHfpTs7hs1dw2r878yxvZ4xqNg6YSxZ230VCkHVy2JQSMqHHsUQW3nZRfUBA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=JcBzBLkB; arc=none smtp.remote-ip=209.85.218.52 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9731960A3803 for ; Sat, 21 Nov 2026 23:07:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9731960A3803 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=JcBzBLkB Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-c513a854320so364442666b.0 for ; Sat, 21 Nov 2026 15:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302468; x=1795907268; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tpQhoYWqRN3wyjl4/Pm/giPsZJPxZ0KHVMsW8Smmq8A=; b=JcBzBLkBbabbjnUzyZkJCTQOUMeZlV++pXiJqlIgCLN7/S2luV7Ylz0Gbzc21vv+Cj WDJ/Wer0cG4EA2LOHv0Snh+7boeFsKAn10PQw1nvGfLzPqDnIsJizo+e96ORX4cR1k5g KdXwBDjhvNSMMmH1aws+gHSkSIS7JnSMdpXLzvvEFoUWHUM0yTOgppDsFU0QcZfSCIbh t19bZ1M2DUOJZ2z2Lej8KFQ2w/8T2QVzoHNqmqZ2lDb/sTVVn9rhZ9Rmp7cgY3Pk7I+M c4pu7B0wdO9C6p7CAawrldEhuDa6sT1wsl2dnQr2VzW7Atpsx9G0nwdsWU6zUZNat7Fg i9HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302468; x=1795907268; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tpQhoYWqRN3wyjl4/Pm/giPsZJPxZ0KHVMsW8Smmq8A=; b=hkervYrGUgHFXshJukhRhKUNQOXpueYhqUdNwqJO7OOrdNnne2aRPkFam9aUf7aeUr 80J5zNaeN/MhBfDcJFWgi6q5vSiZpArHzgph6/b7pwMrX4YNxq0UvNUNicWZ5CkCtUJY Ik+dXzdvlsk6CcYsMqAYB0ySIHBuLYh0bXwxIWefQOFdab76wYFOEoJtYzrYgGEbFYT9 MzYqtQVJ/C16ZKvVcavsY00+wG4FsJQL9HdKZ3+09UPQya/QSZsM7YeNawNlSY042IWf DIB+Hei7leKq9zhPvRBEDMakOW7dQFCmvnKJtm8QTAtp1p2nwhIg86DJGJLedqWJDZez Lznw== X-Forwarded-Encrypted: i=1; AL+hErGkTTt5g5A7VkjtQyFn16Izooeeue6XHsU/vjDI2/AfRAv/htF4cf//onphoPbCyCZwjDIWYzE8bsEGvb0=@vger.kernel.org X-Gm-Message-State: APuU4Z9z+WWpkOm/qwoUDyZxFxWyjGFCyKb6kFcL9Woc7MiNi78XfGl7 vABjWp1Tw1urDim4oupy2azFKohtMvIwRcCBMzU5d/IPqSgMHXukFB7VwUi2gfyAYg== X-Gm-Gg: AZFdTZeLnLunAj4zI20n3dsGT2UZHQzxZUnehZzrLjUK7qEThb1ytl3ngt7R1hwU9zt vH6QdZ4hOyZwaQyMvsTNdLja9AsKTX1iFZCMbu6FhtLs8oXkimIjYL+0qqv4A2KYY4+EnRsoHsY 5zKT1t63n3XHm28aQCHlSDNfs3CAb0/rWp82fcWbAoFSRgZyoF3raQWclxcNgc2bPniP6XGfG+e wgIAFwV35wMKEJheYtm16G+5OyuatzbtjnfbiFFqcQzkcKXhGZ6TBq/zpTPmDUhFl8XQ4ImivhV GVsbok5bNv8HEh1sHTQltF6WNolkCkuSED8oGGxSWzUIvBPgvbvzKRNpSDXVvGov8js2331zc8q 32teKItI7r/wGEsbPLqKsJheCVD2kLLss4ZBnv85mFAa4uytkZyOu5WiDO/Cbupv1jex3C2ILIM KiXQ8Nu92zuA7LpLdGSisQmNUo2VnMZl117eTSxz8wFdbT/3z7QFvRo8BwUduhQXRGE85itU8qR 1bHTVaIlFK6COaPA/kGNgYqpxtBc3o49pyGMhwNyb1syq/vLxOcsjN42uOPtZzjmniWeQdgtAll ZSTxzEhnuj9eROakk/bhRyLPby1AeMa+t382Xvp8ztTt/aJkGHOqgo7pAu011n0EyqADB1nPrFx 61H5pd+AHXV9EI0og+/BAcDt2U0PgKfAkaZ32cIaoMtmQQzftdQgYO8lswGj5zoX5SARW0xbdXr qHA6OE48LEXvDO2M6xIGuLkq/hvxkvD31SMsnBjw1jJIBsiOnzsJ9Lildg01LqclhhzL/G5+rJ1 g8fjgaZAuRO2kvtMq40LiUUCA6oq3NHYliXwN+OD0NmzsmXJIfgQcDRk9JE2ewgW93XcoBwTqft YJiTA6dw1asEpTyUyc/Qv/AAfA0+N1/igOcw3YEHpFDQJFhEsah+N2wRVxczFTC8iuo4gIsc8Ec = X-Received: by 2002:a17:906:f8d2:b0:c50:bf14:8eb1 with SMTP id a640c23a62f3a-c513a84d84emr489568866b.14.1795302468046; Sat, 21 Nov 2026 15:07:48 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:46 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 08/13] wifi: ath11k: ahb: stop TX before WCSS is reset on a firmware crash Date: Sun, 22 Nov 2026 00:07:26 +0100 Message-ID: <20261121230731.1206043-9-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Florian Maurer On IPQ8074 a firmware crash is handled by remoteproc, which stops the remote processor and thereby resets WCSS. ath11k sets ATH11K_FLAG_CRASH_FLUSH, which stops the TX paths, only when it handles the QMI server exit event. That event results from the glink teardown in rproc_stop() and is handled asynchronously, so it can be processed after WCSS is already in reset. A TX in that window writes a ring head pointer to the reset block, which ends in an asynchronous SError: remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss SError Interrupt on CPU3, code 0x00000000bf000002 -- SError pc : ath11k_dp_tx+0x45c/0x878 [ath11k] Kernel panic - not syncing: Asynchronous SError Interrupt remoteproc sends a QCOM_SSR_BEFORE_SHUTDOWN notification with crashed set before it stops the processor. Register for it, like ath10k does on SNOC, set ATH11K_FLAG_CRASH_FLUSH there and wait with synchronize_rcu() for TX paths which have not seen the flag yet. ath11k_dp_tx() is called by mac80211 within RCU read-side critical sections or with BHs disabled. Check the flag in ath11k_ce_send() again under ce_lock, so that this also covers WMI and HTC. This stops new TX descriptors, for data and for everything sent through CE. Ring pointer updates from the RX and TX completion paths (NAPI, CE tasklets) are not stopped by this. A crash during the restart work of an earlier crash, after the QMI firmware start and before ath11k_core_qmi_firmware_ready() clears ATH11K_FLAG_CRASH_FLUSH after ath11k_dp_alloc(), is not covered yet: the flag set by the notifier is cleared again, and CE/HTC sends from the restart work can still reach the reset WCSS. mac80211 data queues are still stopped at that point. That window is a few milliseconds and will be addressed separately. The SSR subsystem name depends on the remoteproc driver, so add it to hw_params. Only IPQ8074 sets it for now. qcom_register_ssr_notifier() must be reachable from ath11k_ahb, so add the same Kconfig dependency on QCOM_RPROC_COMMON as ath10k SNOC has. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 Signed-off-by: Florian Maurer Signed-off-by: Julius Bairaktaris --- v3: new in this series, from Florian Maurer's series [1], unchanged. [1] https://lore.kernel.org/r/cover.1793531790.git.fmaurer@disroot.org drivers/net/wireless/ath/ath11k/Kconfig | 1 + drivers/net/wireless/ath/ath11k/ahb.c | 59 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/ahb.h | 2 + drivers/net/wireless/ath/ath11k/ce.c | 7 +++ drivers/net/wireless/ath/ath11k/core.c | 1 + drivers/net/wireless/ath/ath11k/hw.h | 1 + 6 files changed, 71 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/Kconfig b/drivers/net/wireless= /ath/ath11k/Kconfig index 2b608d4ed263..7dcc2c3543eb 100644 --- a/drivers/net/wireless/ath/ath11k/Kconfig +++ b/drivers/net/wireless/ath/ath11k/Kconfig @@ -13,6 +13,7 @@ config ATH11K_AHB tristate "Atheros ath11k AHB support" depends on ATH11K depends on REMOTEPROC + depends on QCOM_RPROC_COMMON || QCOM_RPROC_COMMON=3Dn depends on RPMSG select QRTR select QRTR_SMD diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/a= th/ath11k/ahb.c index 3ff7d5f27f5e..893a3270394e 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -20,6 +20,7 @@ #include "pcic.h" #include #include +#include =20 static const struct of_device_id ath11k_ahb_of_match[] =3D { /* TODO: Should we change the compatible string to something similar @@ -832,6 +833,60 @@ static const struct ath11k_hif_ops ath11k_ahb_hif_ops_= wcn6750 =3D { .ce_irq_disable =3D ath11k_pci_disable_ce_irqs_except_wake_irq, }; =20 +static int ath11k_ahb_ssr_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct ath11k_ahb *ab_ahb =3D container_of(nb, struct ath11k_ahb, ssr_nb); + struct ath11k_base *ab =3D container_of((void *)ab_ahb, struct ath11k_bas= e, + drv_priv); + struct qcom_ssr_notify_data *notify =3D data; + + if (action !=3D QCOM_SSR_BEFORE_SHUTDOWN || !notify->crashed) + return NOTIFY_DONE; + + /* WCSS can be reset before the QMI server exit event sets the flag. + * ath11k_dp_tx() runs in RCU read-side sections or with BHs disabled + * and ath11k_ce_send() checks the flag under ce_lock, so after + * synchronize_rcu() no new TX descriptors are queued. + */ + ath11k_dbg(ab, ATH11K_DBG_AHB, "firmware crashed, stopping tx\n"); + set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); + synchronize_rcu(); + + return NOTIFY_OK; +} + +static void ath11k_ahb_register_ssr_notifier(struct ath11k_base *ab) +{ + struct ath11k_ahb *ab_ahb =3D ath11k_ahb_priv(ab); + void *handle; + + if (!ab->hw_params.ssr_name) + return; + + ab_ahb->ssr_nb.notifier_call =3D ath11k_ahb_ssr_notifier; + handle =3D qcom_register_ssr_notifier(ab->hw_params.ssr_name, + &ab_ahb->ssr_nb); + if (IS_ERR(handle)) { + ath11k_warn(ab, "failed to register ssr notifier: %ld\n", + PTR_ERR(handle)); + return; + } + + ab_ahb->ssr_handle =3D handle; +} + +static void ath11k_ahb_unregister_ssr_notifier(struct ath11k_base *ab) +{ + struct ath11k_ahb *ab_ahb =3D ath11k_ahb_priv(ab); + + if (!ab_ahb->ssr_handle) + return; + + qcom_unregister_ssr_notifier(ab_ahb->ssr_handle, &ab_ahb->ssr_nb); + ab_ahb->ssr_handle =3D NULL; +} + static int ath11k_core_get_rproc(struct ath11k_base *ab) { struct ath11k_ahb *ab_ahb =3D ath11k_ahb_priv(ab); @@ -1230,6 +1285,8 @@ static int ath11k_ahb_probe(struct platform_device *p= dev) if (ret) goto err_ce_free; =20 + ath11k_ahb_register_ssr_notifier(ab); + ret =3D ath11k_core_init(ab); if (ret) { ath11k_err(ab, "failed to init core: %d\n", ret); @@ -1247,6 +1304,7 @@ static int ath11k_ahb_probe(struct platform_device *p= dev) return 0; =20 err_ce_free: + ath11k_ahb_unregister_ssr_notifier(ab); ath11k_ce_free_pipes(ab); =20 err_hal_srng_deinit: @@ -1288,6 +1346,7 @@ static void ath11k_ahb_free_resources(struct ath11k_b= ase *ab) { struct platform_device *pdev =3D ab->pdev; =20 + ath11k_ahb_unregister_ssr_notifier(ab); ath11k_ahb_free_irq(ab); ath11k_hal_srng_deinit(ab); ath11k_ahb_release_smp2p_handle(ab); diff --git a/drivers/net/wireless/ath/ath11k/ahb.h b/drivers/net/wireless/a= th/ath11k/ahb.h index 8c1eb1e8e6b1..d7ea47f42edf 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.h +++ b/drivers/net/wireless/ath/ath11k/ahb.h @@ -23,6 +23,8 @@ struct ath11k_base; =20 struct ath11k_ahb { struct rproc *tgt_rproc; + struct notifier_block ssr_nb; + void *ssr_handle; struct { struct device *dev; struct iommu_domain *iommu_domain; diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/at= h/ath11k/ce.c index af08a2a24c6d..08fd0ab353e4 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -745,6 +745,12 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_b= uff *skb, u8 pipe_id, =20 spin_lock_bh(&ab->ce.ce_lock); =20 + /* Check again with BHs disabled, see ath11k_ahb_ssr_notifier() */ + if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) { + ret =3D -ESHUTDOWN; + goto err_ce_unlock; + } + write_index =3D pipe->src_ring->write_index; nentries_mask =3D pipe->src_ring->nentries_mask; =20 @@ -791,6 +797,7 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_bu= ff *skb, u8 pipe_id, err_unlock: spin_unlock_bh(&srng->lock); =20 +err_ce_unlock: spin_unlock_bh(&ab->ce.ce_lock); =20 return ret; diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index e8d245f1023a..d4845a1300d9 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -91,6 +91,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = =3D { .coldboot_cal_mm =3D true, .coldboot_cal_ftm =3D true, .cbcal_restart_fw =3D true, + .ssr_name =3D "q6wcss", .fw_mem_mode =3D 0, .num_vdevs =3D 16 + 1, .num_peers =3D 512, diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/at= h/ath11k/hw.h index 4996536fbd14..ce52c61d661d 100644 --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -191,6 +191,7 @@ struct ath11k_hw_params { bool coldboot_cal_mm; bool coldboot_cal_ftm; bool cbcal_restart_fw; + const char *ssr_name; int fw_mem_mode; u32 num_vdevs; u32 num_peers; --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302471; b=C8fW2liZhTp5xoN8gjaKDGS8xycb/pfHjSqBb2ctBP0UKkM/7X3YZ4kGmR2ALz7vnz66 DMhnVfp/9RDsFtKKukimZsTCdzIO8n90LKy5ZUGmHq1XMDOkAvffMQQKlJisic/M5oXFb 3Mhv1/Zs+9k+SLKbI1OJjqwUW/JWyBx1HSOvx8PdzueUTqigH18JV8OmzK0pjkSjDr6q9 tSk7ESBie6FZUlTKzx2AEuku43QTUhWybFPjpPJu8K9HoQXKj5D5F7jFUKoFtaGN1lcI1 /2kvLeBsXM9TX3XSOG1BwMP1NrD1sGmwVaT4ihNeWsLhTUPdiAJmZ6At/uu0LX6FciA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302471; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=JnwF+oS5w2IlCzPszI1C/3O+0i/sc/fD9zkOECKdkbE=; b=3b7P/06xQyVRen2vuseH6rg/eSxWDlz+RZzUVySgr9n27UQdZ+ZeTDREaSu/PiPL1ibR QOUhd4rxWZPtHtwJrwvrgh27miZSs4IqxC5NKMi6xkXp/w5a3ATT5L0ohIpoqwtE49M8/ 2R6AVT0bK9Z9SOVoL699cOpRHtjAskAOfo8lVWiDjbOMphofwmR7jXSfpUilZQT6t/Sob icsQTwWNEJNG6Zs44g5RXcS1YlnZba+Zafz3lPxQ678dbgl/l3lvq3f477aUBPT5zdnmF tI67XDUbaNaBhdAN5XSTQCMcFjbYpUPGj+7VJbhHwbgjMqejJX+Nx+YitSlU0iXvTlw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=i+meoJfj; arc=none smtp.remote-ip=209.85.218.50 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F7AE606A684 for ; Sat, 21 Nov 2026 23:07:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1F7AE606A684 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=i+meoJfj Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-c51373ae637so323925266b.3 for ; Sat, 21 Nov 2026 15:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302469; x=1795907269; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JnwF+oS5w2IlCzPszI1C/3O+0i/sc/fD9zkOECKdkbE=; b=i+meoJfjw67kG37zzbxyTSd6hvDpHY019EfJMc48D6DqYE5B6ujS0xSXpt0jKLw3hP AKp3vn9hFue7ICWpJfQufVTGM4ZYqoZFQmLCm0P/futHFDImBFjt8NwjuckZsSyvt4SC HXoBaGB2ZO6xwUi8BLFefY0tDSnFHLqIf4ws+diAGqR+Cme1X6u3lPxHo9gMvlsI3wxQ 1Fjy5H4Yjv0RTaPY5AYCLh2BvppVsluWlqcL+ZycsdWDgmzpHHhPt3ojlc5+6MYyFJMe QG+KnutGYDPAod6wXfEOw4YaYyXjeT86VTd4P153WntU8rUOge1v/KC2iXOMHsRnbr40 0b3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302469; x=1795907269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=JnwF+oS5w2IlCzPszI1C/3O+0i/sc/fD9zkOECKdkbE=; b=hnh4zEzw1eLNYxMR8s9WMsiMaIyTY0F/pF9bJ53sYqptYbFRHaDSTbgiJeqqCf/LYB +YvyfITiBN58q7WtywepVo75EaXO3xnmGrZUdt08ZnA9Zh0C8z5MmmzGnEXo9LbWAebN gHKLGvn647o8uLQ5Na0KqB0xPE0s9qQ2Xycf28RE2JMo1b9V0qZh6dy7Mxs5k/3d8LEF 6QuUZI4dXOJZ0HNIodOqM4oDPDJZXE5S7gyxOtoj7uKO0wE4bChvfaEQFhKhQG0sKSH/ stV60NamSeNYm0ZAtjc9vJR1EL877qunerfR7shQcy9Jg9NQobk42XYPBW6HN97eGP/U zCZw== X-Forwarded-Encrypted: i=1; AL+hErHPpVHQdFjSxIxtXp6HGsqPM+AC1QRCNzjvGml3sxccyRmrKgg/TpPSRYO5kDNrg4L1X2WFbcwJTlRYY/U=@vger.kernel.org X-Gm-Message-State: APuU4Z9tu3ctgggn0pa6d/5i73TexavtzwYKszOwgcPaKOM1fMs2gAVk UqCpfWG+t+CLA5LtNogJ+K2KiJPIG5Yxxycgvr7cJqoG9Uf6J1FfEHGJ3iNqsVBu7g== X-Gm-Gg: AZFdTZfs8mALRhs3o7WMAc/gmGARmD8WrfjxGXZqG0BcvQP6nOfoI+siqeOGaVeN7ww RwtImbkjx3hwAvhEMs+4OEAYKxOzK/fa+OOe5wONvLNClyPsMbFxDUJQpmAeiBrj1WUThfLKPgl Qm5RiR6nvIaDePHVBuatWoaf/M5gt3Hz5zcTVaRQbIFCPg/6KmgmoZpvrCc9ArbO77JotXILmhi c0LjF9Wlz7JPMXjOZOsWSQ+G3ASvleEz9Xx88YutLl//EOOOw2xfg9qIxiKAyKJAoi/mFsandZv L3kzNpdzNcuIURp+3I8J4Ymkf/TflEOfghRCqVE3DxFdUGN6ecmd9SO0VoycLa4DtgPbKLBkKeu l91bHtVWFGEm82Xa3GlOvfHM+nVaOAPGXLHQ+qFeSraewrvvPxhrbPWatmE+yg4nAweSI+JXWze fuTSy/J9H40neVVJRoV3H0TkqC+voW+A3CTHGlEjRJn13HvJBEoclDgZl0ga8P+2u5RTau+ia3c oUSnVWol3HaRlj+PG57KSr6Rb66TBVaUHRtDeLw2+xXkupaTPW7bemeK2TSF872h/CibOgSqaSL znxcgsZGVc9nEyblNbJnnWEKrp8d9TA4c+pDB0bEyqTpy6h2cALco50+SR+SXqa/eDAioLnn0Fx GH+567HTzcIUynP8/3bGnOAexHfO9aJgF18SykRQp9WckyE9yzJ0TN3w8oTreRoqO8J/AY+1JlX u3dMHLdDDu3fUR4fdMWwpbtFor90x63LudycZr7ifKL9839ZV1EpSIw0aWZxTV9qtTVPOSInYe2 a5djn3G/6S3WWyAwZPvvzfnBPGoXUSNnsAl6eBN8Gg26TT/iSedmY+x7t4tMqmDG1+Bf7N7qNEA czShGcwGeYR4vsEoBCYiWIyIbfJArPNrAlV964QRyJJXNZHn56nSNbtP6PfdFOT8KF0uUZ2N1zs = X-Received: by 2002:a17:906:115a:b0:c1f:983f:d8a with SMTP id a640c23a62f3a-c513a89ec1emr503984666b.24.1795302469619; Sat, 21 Nov 2026 15:07:49 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:48 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 09/13] wifi: ath11k: release the QMI handle when the QMI service init fails Date: Sun, 22 Nov 2026 00:07:27 +0100 Message-ID: <20261121230731.1206043-10-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_qmi_init_service() returns an error without releasing the QMI handle it initialised when alloc_ordered_workqueue() or qmi_add_lookup() fails. Its caller ath11k_core_soc_create() does not call ath11k_qmi_deinit_service() in that case, so the handle's socket, workqueue and receive buffer are leaked. Release the handle on both error paths. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index aee32aec8732..3ce7c4e5c51c 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -3334,7 +3334,8 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) ab->qmi.event_wq =3D alloc_ordered_workqueue("ath11k_qmi_driver_event", 0= ); if (!ab->qmi.event_wq) { ath11k_err(ab, "failed to allocate workqueue\n"); - return -EFAULT; + ret =3D -EFAULT; + goto err_release_handle; } =20 INIT_LIST_HEAD(&ab->qmi.event_list); @@ -3347,9 +3348,14 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) if (ret < 0) { ath11k_warn(ab, "failed to add qmi lookup: %d\n", ret); destroy_workqueue(ab->qmi.event_wq); - return ret; + goto err_release_handle; } =20 + return ret; + +err_release_handle: + qmi_handle_release(&ab->qmi.handle); + return ret; } =20 --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302474; b=M5Pk30WXprMggg1DVJtRL9WCPQ+s3jozmTtD9CSe8QRcTxCSySpNLdUgmBh1I09Rr2hv a567XK9I2IEPtlmzHgZ6wRsPld/uDbovtGDiCpSjAEnC6iaN3mdnFxJQ9le8Azg6q1T75 r2leFQD9LwVV2n93HuwLdx4saFIxmN4aEMtlDA7D0qB/q8SBXXXVdesSib7p23Vz053N+ FdCsb6Na/Qajgt6B6eATN7nQ+ILbrCjk7Pkpa2tlwCLGNio8YjW9DBaC6+7H/8BHr85A/ wzEoZS37h/q+PSd9h6glCU92hIw2vU/T5W3ILFRpW39DWAPmLElsMg7Z5UAWaWBAd3Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302474; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=70WNgqL5GZRExFkcGtbsYLJh4cOMmVFtlMmJCmnLrEM=; b=B578fXz3HliWt98R9eRw8gXa+XJG9oV4ED6b2oWT6CbMJfjIJAESp7hLbuytZLVDVQZ8 cOomK9WEEsMBJDg1/0TxSTbOb/370/7mqELmWKKAU9v0fP90YHe34t4axNcHpQ6s9eG/e wp3d5efJqGbPHM+co65FrLZ3Dh/zX21Vs7nQz7AAGWoyLCnFOOPdRO5Glg+uGQouaSUzo WYOopEUNbCyxOsqFMQnhnWo1usKjvIONGLWW7PQvHY7YtZPGFgkeSiy9P4vFCcXWFQCw7 WvaQbh+Yog+4vc5PygpLA96NmVG8l8/te1HIfxR6MXv/Jb/+aX9VDGNgPT2jlk+Jcsw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b="iAn/gKCe"; arc=none smtp.remote-ip=209.85.218.51 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D454606A6BF for ; Sat, 21 Nov 2026 23:07:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D454606A6BF Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=iAn/gKCe Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-c505b2e1cb9so391308166b.2 for ; Sat, 21 Nov 2026 15:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302472; x=1795907272; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=70WNgqL5GZRExFkcGtbsYLJh4cOMmVFtlMmJCmnLrEM=; b=iAn/gKCeDVxoppGDtERRfbQtMG3UyulV8/ug+KryZz+U+gatkxGk/JS19etoExrH2k AQDxCI1HLDqRdvHjeTjkJcwJnA/EC9FBoQ+J04FXLfTGwjnIrW6hMev3wb3CFzIIDd8N LSfHhbvgmEAdprpqNr4KUJFCCL4gjwqobaNVo5RKM8ppN1ru9ZI2afW/1XWVGu8EJUGV 3ZK/Z7DNajvIBLzox6xzSvxQc6RrYW1PxER/wpwslJmmaAn+DI5sxDD7RjPBUFBmvhSb RPuAACm4PImYIPWTSquQPsmGxBfcFdsFfwpR3jnWEV2VwAF9THfKW0fTfUAp4hjNcjB7 5PCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302472; x=1795907272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=70WNgqL5GZRExFkcGtbsYLJh4cOMmVFtlMmJCmnLrEM=; b=Cr8FrbmhjDgBBRTsMgy5DQHyYWkEq0iU5vdP7/0LxbdXYM3LQKDqIvskLLGEL/edg8 f4001X9PpJnBRdvZYuc75gpCa1SgkpOwwGczH3jKUvSJft/fZjjisE3T/z78lulhIJya AMTdpAsOu47cCAT0zFeC+dzzfa7Yr1pJ+1y3YY/QVyoDvSBiTCDmdB44TQW8OsxSyfHy V3JyGbEddzapP7ne3qwgGKELuxKcLOWgNM8aKoGasxDkg3gcSYnmpNCpVFwYxCU9QUf/ MjyYqfI9lZWLodQIL6nW+481dlSOBFWKrUWzgLoDB4EuWk9nfnaO/0BoYnpUglVJ0QhC RNxg== X-Forwarded-Encrypted: i=1; AL+hErEsq0/6MhEqArD50pTwcWLJVTYBRYnSL+0xQNpHST4QrzqeF7tKqrgHUjPrDou5TI/K4DESQf1lwtkrkCs=@vger.kernel.org X-Gm-Message-State: APuU4Z82wHICIUSflR4ByL9I0f2FO0MH4nMT7tT4DjISQZXl3Lk0l1nB IkHiTqDCrbEogIBogL9H0Z3oRcDsDDRHP1NL9FD6EcCfNjmddtxhzNpmMcgYRdGi6A== X-Gm-Gg: AZFdTZe185FWLw+JaWWw9wrvZWiOq5Tmj28u8I7+pkuPDSC1x1vvbSfJ8Zop6gyxcon 51HJ4Qgzvt2Lmx2AJkqMlz0Ab5uBQnx2Yq4lOdKjJF+qphoTDGBmWUjVp7F0B3w4lHIcCB3gU9c m+Nk+R4A0/zNC//Abzko1jQNryCBTh4SVcMg5XhJhJYMmOcqMfu+DZOiHJH/zKUqqwEW1syQsap WiqeQ5kQkzitMw7w4c961l6QNc0doSotWdf3n3qrMHByJqaUXFpfDcUQMpiVCDyELQkrHLMiRnQ a72Hg+jNAi9OSGlXjv4kfngqRELhYdFqJzqjd5DtFUm+1wx5dujDpZKCRhWVV9ClMZ1ZzoWEj43 6eVkoZksLbSCbINxhVC2RI3r5s0aAP1h3vK2HuPULtQuU4G9guDchLve4IABy5Jh7MAcNA3pfVX QqfbxkzwM6Zw01UBFsJA6I6C3bDhBtU93V8KBnGPvh9kbFXXWRXTGwuMshoxLJVt8cr4hMyrsdf nZGySS09tJgNYaVeArVdt0ErF2nydBzoVPYV5eJcWkxYftROmkMJD3oNjSNCKT04pR4nwCH//UM wtOq2baSXoTHFzOtNM7fGQwLiJL56OUdonIwVLV2Fjnechl51lW2/cYCkCs/1rSqdDR8oV4ES1b qZEQwXFiB07/UPJqR0wu6NZ+4IoSF0dtpurM3n93ZHCV5lm6PPR/3O6HkhogRqT95nf5OfExf9r EO0AqF42apzjILCvQgOxMhrpMVnB0wP7yr4EPp3Ss3xLgfcOlSoPEFcJM7IpR8wXrsW6028B4QB SpooFtpsyF+/GFHNwtF3oXQmRot4H2e9oV3xSf7ZF+qVQjL65YdSttUW0Ew1liRWzkx6a7Hp/gO TZ2IAIVyvXqcudtv0bekim9Jm70OXrq+IP6OiBIhdE+YD2Lf5mW64Q+hPJIK6PaP9vZEocsgNE8 = X-Received: by 2002:a17:907:1396:b0:c48:a838:c16d with SMTP id a640c23a62f3a-c513ab4925bmr425452666b.30.1795302471991; Sat, 21 Nov 2026 15:07:51 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:50 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 10/13] wifi: ath11k: ahb: configure the IRQs before the firmware is booted Date: Sun, 22 Nov 2026 00:07:28 +0100 Message-ID: <20261121230731.1206043-11-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_ahb_probe() calls ath11k_ahb_config_irq() after ath11k_core_init(), which has already initialised the QMI client, created the debugfs directory, registered the PM notifier and booted the remote processor. When the IRQ configuration fails, the error path only unregisters the SSR notifier and frees the CE pipes and the resources below them, then frees ab: the firmware keeps running and the QMI client, whose callbacks post events into ab->qmi, the debugfs files and the PM notifier stay behind. The order was swapped by commit 166e22b38aa3 ("ath11k: ahb: call ath11k_core_init() before irq configuration") because the ext IRQ setup needs hw_params.max_radios. hw_params is now set in ath11k_core_pre_init(), which ath11k_ahb_probe() calls before it maps the resources, so configure the IRQs before ath11k_core_init() again, as ath11k_pci_probe() does, and free them when ath11k_core_init() fails. Nothing can fail after the firmware is booted then. The SSR notifier is now registered after the IRQ setup, which it disables on a shutdown, and unregistered in the new err_free_irq path. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: 166e22b38aa3 ("ath11k: ahb: call ath11k_core_init() before irq confi= guration") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/ahb.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/a= th/ath11k/ahb.c index 893a3270394e..736fd368f8c6 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -1285,26 +1285,29 @@ static int ath11k_ahb_probe(struct platform_device = *pdev) if (ret) goto err_ce_free; =20 - ath11k_ahb_register_ssr_notifier(ab); - - ret =3D ath11k_core_init(ab); + ret =3D ath11k_ahb_config_irq(ab); if (ret) { - ath11k_err(ab, "failed to init core: %d\n", ret); + ath11k_err(ab, "failed to configure irq: %d\n", ret); goto err_ce_free; } =20 - ret =3D ath11k_ahb_config_irq(ab); + ath11k_ahb_register_ssr_notifier(ab); + + ret =3D ath11k_core_init(ab); if (ret) { - ath11k_err(ab, "failed to configure irq: %d\n", ret); - goto err_ce_free; + ath11k_err(ab, "failed to init core: %d\n", ret); + goto err_free_irq; } =20 ath11k_qmi_fwreset_from_cold_boot(ab); =20 return 0; =20 -err_ce_free: +err_free_irq: ath11k_ahb_unregister_ssr_notifier(ab); + ath11k_ahb_free_irq(ab); + +err_ce_free: ath11k_ce_free_pipes(ab); =20 err_hal_srng_deinit: --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302476; b=YMFLKsgpDgBp9QjKN3fPLAwyi8w7l9RQV95VVAsoyHnCMLs64wgNGkOFNCeBCLEefZld 9zZlE1BuDja+J9dYeum//F5L5kLStI8WJnfmiB4UXZ3L77ZPGW2V/rQqfrk2eLMZ8PyuQ UtY5xHcv2yTaazbEcP4o3cCONKltcz+0xKAnphxiL/jeMr2frHmZYD4+JaNnWwJOBAn+l 7wsV7lDA8ZFma2d53gqnKrZ5g9zmWFeXKNUKiLsK1VLd3KjqBLN0g7b3PqS0WhPi9qepO 3zASg2A9YEva0YZlig5i9ehGPgNaWfc4vLZbzZkpx88K0N23I3t2OYJYcAxJKtkmLVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302476; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=s88wbEfs1LyrsI8Y5Ny0Pr/96EyRBnxWAeHAPxpjPjY=; b=cx0+7q9voX1iG0Z+Ym2ZZf8Vvg+JVqPGwcdyhZh3oy8ilp/THUeO1ZtjuPqQ6SF6WOmY 5KHOTrtNiJpvjEEUIJZ0N0QUmdZ/RuAivt08GqDbFYJAVaHCcyq03t1vrmBxQrwPplnr3 C32L4g87r53/lFfPxDl8VpQeRvGKwDvar04S4LIstKRlD/xAvDaOP/5vDQCQlrkBf4lSe LnYRcUI/EvQ2kJI5GATN+mjhOLrxTuppfAerkTRmHHxjq9xX9m9CuHSgvyIwja+cpodfg 2J1iSI1aj5/iOwwtHJ1inNeUzmHt831l1LmW+cpaJWBurZ207QtQSXb+l9cNZmqRY/A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=UXsXM8VU; arc=none smtp.remote-ip=209.85.218.43 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F39460A3803 for ; Sat, 21 Nov 2026 23:07:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5F39460A3803 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=UXsXM8VU Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c4203bbb1e9so337990766b.3 for ; Sat, 21 Nov 2026 15:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302474; x=1795907274; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=s88wbEfs1LyrsI8Y5Ny0Pr/96EyRBnxWAeHAPxpjPjY=; b=UXsXM8VUxKGW99RINHuFf7j8UKpu+ylu5fmYvOWf8Api27Hx8/jxc3tK0a268TsKTv 62N3C6BGhJBREMSW5Mc22tx58eaeWDD6YJc+e/iO/u1SoGqF0825XqGBOIirAyCPZssB JxgxQfdB+0gReyZkQmPM6oY+XLU8Pr3iIpGfKxdgaKWnTkGHUI2MZabNGFQCgDK83Ovx 1cAMenaxZaMx45dQ9xGQ+3XTHk/bUo+onKlscg0oV7jE0PvGo4HBPAGCfXwMLTjsWnYv tVP1CAQqwNT1afmJXpXQXJTcyr1jLVh6nI+zLUdgmXXU9uZ2cOfGBcUADaj71SZt9xb2 w9tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302474; x=1795907274; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=s88wbEfs1LyrsI8Y5Ny0Pr/96EyRBnxWAeHAPxpjPjY=; b=aa1v8AP+3/9eBl6hGKaxpnbazujzeec1qzdA5UY340/rHb6xzJrt5rwMZ/5LPqVnnI IWTM3FfusTkNBXSlRSqqG82RupyEBaT4/NXzIMuNKhrPSH7+ZpDjkmG97XRzOT1DN+Qx HUxR4hUp2Ta4FW3s8pUIsh5rHh8cXQZvQNmVxbELz8EbLrBTU1na93AHCletqR+vGfg7 TYetVc1plH+P3U6Ga4tzsKE4VjWq8XXpjFE2lBwwfuDX1qC0QoaJVjleSYn5iFyNO9Gj bMpadAUD3BgiB1TsHZ6jPIZswG+DFlIYfne7TPqdU5V3qlbQrgxSv3TAvOq05gs7JveG Uv+A== X-Forwarded-Encrypted: i=1; AL+hErGbDrE5Iw0B/axVsbFsRMO7gCvnNb/3FQ4MtaepYSn/yzehixzo9/U+xRoCnnAmiKUsG0lxPNTxncWXb4Q=@vger.kernel.org X-Gm-Message-State: APuU4Z/TpkYEiiGtzHVrsbsPKYdLaymMRbH3CFcYm4UGjiPY3FhD1lFS 6NUnkcfuT2MNx2RpQBFK9fz2Ot+07K4K2s6qWGAKBW63nS8XBP754DWyLOCOrvo1ng== X-Gm-Gg: AZFdTZdHtQ3tgaAckB9Z7qTxs6KdI/7RXsc2dgjXwOtlu6NU33kX43dTxLyoaxb1qW8 2ydUpD12JWIUi1/5EQMCJkKSejE+QPYxmCUw3ERzuk3hLsn2sHam6yUYhXoyWxEyimsKT1Za93O VkYcgZsv9Lmc9QFMnx5tIznFDSxCGN6Iafa2lXd5SrVtLB4ZK8kNWK0IBgPKt3dNZsUKNOW1yUQ n10EhEDSvb1joIpDdznptZCdrDCJZlIWcmGT8HSqfVEHSOwfDw2Sdh1VrjRX4yHT4wCJeovuQE+ eZWiZcR/JMFIt4PW7BahR7YSnh1zleNXfIDVtoCXzfbiAwQSCM9dMRRpTlXORiEBTpS/Og5Ii7Y UP5+xBigFDHbEspZEa5D8xtYfRpNTrrshN5XEnF5RU4vI2w7U8I4NreW9Cy5w2V4piAstneBCdx vnbbyx4U10T34Ivk8ikTPdVQy1/1CbkHeLu4DCzagdpSQqVVj6yR50QNdgANRPniSssv3N5f2Gn Yh79Md+ZEzxmN/9PhSjVPrmEqLzusp4VgNs4XhpEH8tHRiRWCyE4MdAIR0mBmH+AmPYiJ8Eo0jl sWMVQZNl1ADKooDLgKt6WCIQG9pVE7AxF9ZgPtchEE8Ah5LAgsc9dCjZ2h4MYa/J7GzyuT3P0n/ 38z2WH1O8ajMfe8pAz/ATX9Sz1/3zUTbNsJHGy0EaGMd150RHkVKyf/k/wkdOUdr5D9XQozrSJB RoqHvkYQwpwKPJVII0vUYUDZTnSnDcQyS4NmNhjFKEUUm29AwqoogeDk15EVIek6LNQDiaLDZpJ M9K1Pq46GlaKkcw98Ir5ux4lpeo5S4AU8P1DI0slFv0B7bKK436pakMOpbbAAPsTFVnXLptf5kp aphTnToaYwlOgZWh0/MDG1NtxpZqtUgYA+TWmLLFD4ddRg1RsuwE/1DmUVjQ7q7zoyJwHzcAF28 = X-Received: by 2002:a17:906:f5a9:b0:c41:4c20:5a80 with SMTP id a640c23a62f3a-c513aadb0femr716344166b.44.1795302473838; Sat, 21 Nov 2026 15:07:53 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:53 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 11/13] wifi: ath11k: free the queued QMI events when the QMI service is torn down Date: Sun, 22 Nov 2026 00:07:29 +0100 Message-ID: <20261121230731.1206043-12-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_qmi_deinit_service() releases the QMI handle, cancels the event work and destroys its workqueue, but frees no event still on qmi->event_list. Releasing the handle reports the exit of every server it knew, so ath11k_qmi_ops_del_server() queues a SERVER_EXIT event there on every removal with a known server, and the event work stops early once ATH11K_FLAG_UNREGISTERING is set and leaves the rest of the list. These events are leaked. Free the events left on the list once the handle is released and the work is cancelled, when nothing can add or take one any more. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/qmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index 3ce7c4e5c51c..4a3837958e01 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -3361,9 +3361,18 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) =20 void ath11k_qmi_deinit_service(struct ath11k_base *ab) { + struct ath11k_qmi_driver_event *event, *tmp; + qmi_handle_release(&ab->qmi.handle); cancel_work_sync(&ab->qmi.event_work); destroy_workqueue(ab->qmi.event_wq); + + /* The handle is released and the work gone: free what is left */ + list_for_each_entry_safe(event, tmp, &ab->qmi.event_list, list) { + list_del(&event->list); + kfree(event); + } + ath11k_qmi_m3_free(ab); ath11k_qmi_free_target_mem_chunk(ab); } --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302478; b=zvt1VmTca/1vnUzEylzjplGOeiLHpFKIlxk0v4g2ddvZqd4FnxJlv1rVsueWprB7r16/ Z/s3OQI+G9hmoWWRejl6HvHEXh2VzLaP78pDSJc3MGQKlqqBONQgDtiyMRCp232doz5K6 90iUNV+lrAxLtsFREr2h1CCofAYoZiUrrSgPil5gwYBB5BY7Q78btxlyycac2EfGw02mx /EqjV3R7J2t/Sgvz2jQ3NvyVd0ggHkZhnfQTf7MxIUij1oK14/GltGDwoYSer4MBDiDXa ZWp4B/1TkXgszIe7WVE9hOb10BkmzxWy3BIMSK9JAYGtqJ5NWeMjp2SjCq1T+qPzriQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302478; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=N10Pu+rjXEwRh6rFEvXB74UrxCEUGq3zOsw8RXTnZyU=; b=D2hDhWFS+AInKLKHgIiAFMSVuDEC0RvNzT6ox7EUl2uzPG1Xl4sHamJTW6abkU+BG01U PYSdchq4JitXzMF04kC/yXhQw1XJtkqkJe420R0+eN3uoubYE+lXbeA9fd+AZdGLto7rC D2wjJV7uUATh/PPiv4LCh9/ksXnXH4ZuoyzXYdG/zYcq1CqD6JX50mGtQabPh4a0u7l7t ez1UVM+V/qdfXwT/boneDkMJJZ3R7oX9WPULSMqc+Gu1FY8KcIWac5xKeLRsVM4Y99cAW v0alZOWGyrZdNNz3pARj499Ac6DWxMraxrZ3xNBj6wU2LoF9oN52I0tBTJim5DsJLBQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b="slD2S4/F"; arc=none smtp.remote-ip=209.85.218.51 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96ED660A5BC4 for ; Sat, 21 Nov 2026 23:07:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96ED660A5BC4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=slD2S4/F Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-c5133831027so305102466b.2 for ; Sat, 21 Nov 2026 15:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302475; x=1795907275; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=N10Pu+rjXEwRh6rFEvXB74UrxCEUGq3zOsw8RXTnZyU=; b=slD2S4/FfwBsSPhEWt0vNiLorcVfe2DWeyWTgm90xlYLOUjtCEa2vA9kDZsQUExKPJ IQuVyCZ7HoA1+HZgBrona7aeSS/ggMavDNr8jLDpKt2XNDiIatSE3MLeQNPqJ/KRGRc7 XybScZZXoe4NcdGOG+PaPr2sYDI0O3+8OoxFqVG50BNtkKZ2tSNJtBGzDWe+GoZkfRPm GBsOXY/nGUWEExE8Iiw8/a4w5Ej3qhrvnXfy5MuZSXTa47maOMKOJhlKYnrdddHGyoOa aeIVeJkQSWlZjee0PL4MvpvPIGT+bElGKjG4e8V4hr5t/BHzzn7hekOHxCHFn6He8n6z TnpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302475; x=1795907275; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=N10Pu+rjXEwRh6rFEvXB74UrxCEUGq3zOsw8RXTnZyU=; b=MF7/S0YD2U6xgIDKOWP5uOUul69Wb3y7taYqhdt84QznkV3anebFLKyGswzzAeJ45G CDqIqee+E3T/RfUlHuuVRzxsRvKBlS55Mvyutqqnjv3bKmir+TEyjcAWLrJp6JWnyi4O CjLXJebrtfwK7Bh+B2Mt+EEjDh5GN0llKoe9S7awwCMnOo3da0Rb+RQ3LiWsAA1eQ6a9 6eQzMhwUy0+xUqzvJLoat64u1WvpZVqlVIlIfoYbSV13H65homIiwWgygj/j3ODxaAc5 r0eoFcfDu5qEqk1e5ZKqIQbINgxx6VHCqQG1qYihoArE3dJqyNyHD8hJ5qPMTExTs0ru 4GyQ== X-Forwarded-Encrypted: i=1; AL+hErFBHaoZtSwToUgKuKG7ft0vNoU7j5tuvkfa13H0Vllx8XwzB3z0R2QMXngLNESQ002r1HydAVaheg5IzUA=@vger.kernel.org X-Gm-Message-State: APuU4Z8mZbjEYRa+RJ8A5KM6ZkOO/OSXZnlJl/3NMD6Qi7gUKKBh7x85 nL0EmeLOxF0aLVH3+V8+zjpbOT+AJBXbscufCgt7zygkbbzh411KbFZD0uAPNulMxw== X-Gm-Gg: AZFdTZcdYwTS0SIfSn22B/p7Fd0rhNXB1kWpeM3V8qmpdrSFRKMvtMGJhqbW62l71sv fu8GUgVGNsnc5vcyI7tV83EkdzDQQUYoECCEYKsqgJ74rBxFIJqaekvu8zLlnx9nL4s6pVzJKKd V0B7NSRrh2MuAEpR0zCLoqfCRCDDokgSQZd14M933AMyoLsCnkv67z6sJClMQXqQOsDQUM1VKq3 Zdb87rAfQShRCU+jsOSZe3n9+FUts1J39h/GyTXJaH2qSphYbcxZmdSVBpy2sLYxnrT23RRNPqn mMkY5Tax3TotBJ3XTAORf5jyO9Ny1nr0FSo7zCyZwiYVR4c+92YuNrqPuuCmdUS/Uk/Y3Y3ahCW IIm7QQ20q2CHdznGNTq9xLmX53oho7FQparPjmfSm6xuclGnlFn2VfYs519Mp1EaG7z2KnkWsc0 fHoHlUVUnoWHQoIBVgfeGMcmv1YkVLsRQEMY9xioRPHaYmvLq/b48uph8heeJbZMhxAeP0ofhPQ 6DtDYIhddDHy5VcfN+4A8KcL8NwMLYw1HgHV5MKJZa7SlllXVffyWuzZ7jsw7RVMUkkARlnRrup nvba7G6JlnpuWEHI0DkQggWOX2QzFlszIc23bke70l6oE0MOd9h8Q7QPWYBwsavi80g2CbvIpzz JyMrjWaJ1L3oRxTbftPqdktkt5BCxwdJ2FLAZKVfD4mLxnnpi9NpRHaMSwbFETttjuiq9WJek4a GAPuXk+jviP6Q3zELbYKb990BttU9jQP44nxTSIJUqIHb1Ne5tBoZstkliu6u5yKjza3HVjlTP9 Nkz+uHAZ6LM0TZH4bi4xbxSVvz44fH/sqrZ0P6k07jz4vmvyDz/pOl8dsVr8bllZmQCDsjoMuNy QE/wb5ag1DFCmxZCbsfYMwnrUS0Pgtbm4wr7In/pGTxYPkPb4evNzu95UXzH/2HR7a0WLvtuIpc = X-Received: by 2002:a17:907:c08:b0:c46:88ef:2e46 with SMTP id a640c23a62f3a-c513a433bf6mr703179366b.1.1795302474845; Sat, 21 Nov 2026 15:07:54 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:54 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 12/13] wifi: ath11k: stop the restart work before WCSS goes down Date: Sun, 22 Nov 2026 00:07:30 +0100 Message-ID: <20261121230731.1206043-13-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the firmware crashes again while the restart work of the previous crash sets up the rings, remoteproc takes WCSS down while that work still writes ring registers, which ends in an asynchronous SError: remoteproc remoteproc0: crash detected in q6wcss: type fatal error remoteproc remoteproc0: recovering q6wcss SError Interrupt on CPU3, code 0x00000000bf000002 -- SError Workqueue: ath11k_wq ath11k_core_restart [ath11k] pc : ath11k_dp_link_desc_setup+0x2f4/0x3c8 [ath11k] Kernel panic - not syncing: Asynchronous SError Interrupt Call trace: ath11k_dp_link_desc_setup+0x2f4/0x3c8 [ath11k] (P) ath11k_dp_alloc+0x9c/0x600 [ath11k] ath11k_core_qmi_firmware_ready+0xb0/0x5fc [ath11k] ath11k_core_restart+0xf4/0x180 [ath11k] The previous patch stops new TX in the QCOM_SSR_BEFORE_SHUTDOWN notification, but nothing stops the restart work. It keeps waiting for the firmware that went down, up to 10 seconds for a QMI response and 5 seconds for the WMI service ready event, and when it gives up, its error path writes the copy engine registers and sends the QMI mode OFF request again, by then possibly to the next firmware instance before that has been started. The restart work of the new crash only runs after it, as both are the same work item. NAPI, the CE tasklets and the rx_replenish_retry timer also keep updating ring pointers. End all use of the firmware in the notification, before remoteproc stops WCSS. ath11k_core_firmware_going_down() sets ATH11K_FLAG_FW_DOWN and ends the waits of the start sequence: the QMI transactions waiting for a response, the HTC control response, the WMI service ready and unified ready events and the HTT version response, which are waited for with ath11k_core_wait_for_fw() now, and the WMI send loops, which test the flag on every try. While it is set, ath11k_qmi_firmware_start() and ath11k_qmi_firmware_stop() return at once and every QMI request gets -ESHUTDOWN instead of waiting for a response. It then flushes the QMI event work and cancels the restart work, so a running restart unwinds while WCSS is still accessible and a queued one does not run. The completions can now be completed at any time, so initialise them once per device. From then on the QMI event work handles only server exits. The QMI client cannot tell a server arrival of the firmware that goes down from one of the next firmware: the GLINK edge is still up during the notification, and a NEW_SERVER of the old firmware can still be on its way to the client. Only the QRTR name server orders them: the GLINK stop unregisters the QRTR endpoint, which queues a BYE for the node to the name server, and the name server removes the node's servers when it handles the BYE, in the order of its socket. remoteproc sends QCOM_SSR_AFTER_SHUTDOWN after that. There, start a new QMI client with a new lookup, which reaches the name server after the BYE, then release the old client, which reports the exit of a server it knew. Two clients are used in turn, so that the old one is released only once the new one exists. Events carry the number of the client that posted them. A server exit is handled from any client: it sets CRASH_FLUSH and RECOVERY and runs ath11k_core_pre_reconfigure_recovery(), which stop the host's use of the firmware that is gone and wake its waiters without sending it anything. Every other event is handled only from the current client, and only its server arrival clears ATH11K_FLAG_FW_DOWN. Its FW_INIT_DONE then queues the next restart work. The old client is never used for the next firmware, as an arrival of the firmware that went down can still reach it: the new client becomes current only once its lookup is sent, so if it cannot be set up, events other than a server exit stay dropped and ATH11K_FLAG_FW_DOWN stays set until a later shutdown notification sets one up. The notification can come before ath11k_qmi_init_service() and after ath11k_qmi_deinit_service(), so the QMI locks, lists and event work are now initialised in ath11k_core_alloc(), and the client is set up, torn down and restarted under one lock. Without a client there is nothing to restart, and a client set up later sends its lookup after the notification. The AHB notifier then disables the ext IRQs with NAPI and the CE IRQ lines, kills the CE tasklets and deletes the replenish timer, and only then sets ATH11K_FLAG_CRASH_FLUSH, which the restart work clears once the rings are set up. The CE IRQ lines are now requested disabled and ath11k_ahb_start() enables them, so that the notification also finds them in a known state before the first start. This is done on every shutdown, crashed or not, as WCSS goes down either way. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/ahb.c | 71 ++++- drivers/net/wireless/ath/ath11k/ahb.h | 2 + drivers/net/wireless/ath/ath11k/core.c | 75 +++++ drivers/net/wireless/ath/ath11k/core.h | 4 + drivers/net/wireless/ath/ath11k/dp_tx.c | 11 +- drivers/net/wireless/ath/ath11k/htc.c | 22 +- drivers/net/wireless/ath/ath11k/qmi.c | 380 ++++++++++++++++++++---- drivers/net/wireless/ath/ath11k/qmi.h | 38 ++- drivers/net/wireless/ath/ath11k/wmi.c | 32 +- 9 files changed, 535 insertions(+), 100 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/a= th/ath11k/ahb.c index 736fd368f8c6..7fcf12a1e007 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -363,9 +363,32 @@ static void ath11k_ahb_ce_irqs_disable(struct ath11k_b= ase *ab) } } =20 +static void ath11k_ahb_ce_irq_lines(struct ath11k_base *ab, bool enable) +{ + struct ath11k_ahb *ab_ahb =3D ath11k_ahb_priv(ab); + int i, irq; + + if (ab_ahb->ce_irqs_masked =3D=3D !enable) + return; + + for (i =3D 0; i < ab->hw_params.ce_count; i++) { + if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) + continue; + + irq =3D ab->irq_num[ATH11K_IRQ_CE0_OFFSET + i]; + if (enable) + enable_irq(irq); + else + disable_irq(irq); + } + + ab_ahb->ce_irqs_masked =3D !enable; +} + static int ath11k_ahb_start(struct ath11k_base *ab) { ath11k_ahb_ce_irqs_enable(ab); + ath11k_ahb_ce_irq_lines(ab, true); ath11k_ce_rx_post_buf(ab); =20 return 0; @@ -656,8 +679,8 @@ static int ath11k_ahb_config_irq(struct ath11k_base *ab) tasklet_setup(&ce_pipe->intr_tq, ath11k_ahb_ce_tasklet); irq =3D platform_get_irq_byname(ab->pdev, irq_name[irq_idx]); ret =3D request_irq(irq, ath11k_ahb_ce_interrupt_handler, - IRQF_TRIGGER_RISING, irq_name[irq_idx], - ce_pipe); + IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, + irq_name[irq_idx], ce_pipe); if (ret) { ath11k_err(ab, "failed request_irq for %d\n", irq); ath11k_ahb_free_ce_irqs(ab, i); @@ -841,15 +864,45 @@ static int ath11k_ahb_ssr_notifier(struct notifier_bl= ock *nb, drv_priv); struct qcom_ssr_notify_data *notify =3D data; =20 - if (action !=3D QCOM_SSR_BEFORE_SHUTDOWN || !notify->crashed) + switch (action) { + case QCOM_SSR_BEFORE_SHUTDOWN: + break; + case QCOM_SSR_AFTER_SHUTDOWN: + /* The GLINK edge, and the QRTR node behind it, is gone now */ + ath11k_qmi_firmware_went_down(ab); + return NOTIFY_OK; + default: return NOTIFY_DONE; + } + + /* + * remoteproc takes WCSS down once this returns, crashed or not, and a + * register access after that ends in an asynchronous SError. WCSS is + * still accessible here: stop every user of it before returning. + */ + ath11k_dbg(ab, ATH11K_DBG_AHB, "firmware going down, crashed %d\n", + notify->crashed); + ath11k_core_firmware_going_down(ab); + + /* + * The restart work is gone, so nothing enables the interrupts again + * until the restart work of the next firmware calls + * ath11k_ahb_start() and ath11k_hif_irq_enable(). disable_irq() keeps + * a CE interrupt that is still pending from calling the handler. + */ + mutex_lock(&ab->core_lock); + ath11k_ahb_ext_irq_disable(ab); + ath11k_ahb_ce_irq_lines(ab, false); + ath11k_ahb_kill_tasklets(ab); + timer_delete_sync(&ab->rx_replenish_retry); + mutex_unlock(&ab->core_lock); =20 - /* WCSS can be reset before the QMI server exit event sets the flag. - * ath11k_dp_tx() runs in RCU read-side sections or with BHs disabled - * and ath11k_ce_send() checks the flag under ce_lock, so after - * synchronize_rcu() no new TX descriptors are queued. + /* + * ath11k_dp_tx() runs in RCU read-side sections or with BHs disabled, + * REO commands are sent with BHs disabled and ath11k_ce_send() checks + * the flag under ce_lock, so after synchronize_rcu() nothing is queued + * to the rings. Set it only now, as the restart work clears it. */ - ath11k_dbg(ab, ATH11K_DBG_AHB, "firmware crashed, stopping tx\n"); set_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags); synchronize_rcu(); =20 @@ -1291,6 +1344,8 @@ static int ath11k_ahb_probe(struct platform_device *p= dev) goto err_ce_free; } =20 + /* requested with IRQF_NO_AUTOEN, enabled in ath11k_ahb_start() */ + ath11k_ahb_priv(ab)->ce_irqs_masked =3D true; ath11k_ahb_register_ssr_notifier(ab); =20 ret =3D ath11k_core_init(ab); diff --git a/drivers/net/wireless/ath/ath11k/ahb.h b/drivers/net/wireless/a= th/ath11k/ahb.h index d7ea47f42edf..4dee29f0c562 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.h +++ b/drivers/net/wireless/ath/ath11k/ahb.h @@ -25,6 +25,8 @@ struct ath11k_ahb { struct rproc *tgt_rproc; struct notifier_block ssr_nb; void *ssr_handle; + /* CE IRQ lines disabled by ath11k_ahb_ssr_notifier() */ + bool ce_irqs_masked; struct { struct device *dev; struct iommu_domain *iommu_domain; diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index d4845a1300d9..0795ba7e038c 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2471,6 +2471,76 @@ void ath11k_core_pre_reconfigure_recovery(struct ath= 11k_base *ab) reinit_completion(&ab->driver_recovery); } =20 +/** + * ath11k_core_wait_for_fw() - wait for an event of the firmware start seq= uence + * @ab: device + * @done: completion of the event, reinitialised by the caller before the + * request that triggers the event is sent + * @timeout: timeout in jiffies + * + * Return: the remaining jiffies, 0 on timeout, or -ESHUTDOWN when the fir= mware + * is going down, see ath11k_core_firmware_going_down(). + */ +long ath11k_core_wait_for_fw(struct ath11k_base *ab, struct completion *do= ne, + unsigned long timeout) +{ + long time_left; + + /* + * Pairs with smp_mb() in ath11k_core_firmware_going_down(): + * either the flag is seen here, or its complete_all() comes after the + * caller reinitialised @done and ends the wait. + */ + smp_mb(); + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) + return -ESHUTDOWN; + + time_left =3D wait_for_completion_timeout(done, timeout); + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) + return -ESHUTDOWN; + + return time_left; +} + +/** + * ath11k_core_firmware_going_down() - stop using a firmware that goes down + * @ab: device + * + * Called by the bus before the firmware and the hardware it runs on are t= aken + * down, while the hardware is still accessible. Every wait of the firmware + * start sequence ends with -ESHUTDOWN, no WMI command is sent, and the + * function returns once the restart work and the QMI event work have + * finished, so neither of them accesses the hardware afterwards or talks = to + * the next firmware. QMI events other than a server exit are dropped until + * the client started by ath11k_qmi_firmware_went_down() finds the server = of + * the next firmware, which clears ATH11K_FLAG_FW_DOWN. + * + * Context: process context, not from the restart work or the QMI event wo= rk. + */ +void ath11k_core_firmware_going_down(struct ath11k_base *ab) +{ + int i; + + ath11k_qmi_firmware_going_down(ab); + /* Pairs with smp_mb() in ath11k_core_wait_for_fw() */ + smp_mb(); + + ath11k_qmi_abort_txns(ab); + complete_all(&ab->htc.ctl_resp); + complete_all(&ab->wmi_ab.service_ready); + complete_all(&ab->wmi_ab.unified_ready); + complete_all(&ab->dp.htt_tgt_version_received); + wake_up(&ab->wmi_ab.tx_credits_wq); + for (i =3D 0; i < ARRAY_SIZE(ab->wmi_ab.wmi); i++) + wake_up(&ab->wmi_ab.wmi[i].tx_ce_desc_wq); + wake_up(&ab->qmi.cold_boot_waitq); + + /* The QMI event work queues the restart work, so flush it first */ + flush_work(&ab->qmi.event_work); + cancel_work_sync(&ab->restart_work); +} +EXPORT_SYMBOL(ath11k_core_firmware_going_down); + static void ath11k_core_post_reconfigure_recovery(struct ath11k_base *ab) { struct ath11k *ar; @@ -2783,6 +2853,11 @@ struct ath11k_base *ath11k_core_alloc(struct device = *dev, size_t priv_size, init_waitqueue_head(&ab->wmi_ab.wmi[i].tx_ce_desc_wq); =20 init_waitqueue_head(&ab->qmi.cold_boot_waitq); + ath11k_qmi_init_state(ab); + init_completion(&ab->htc.ctl_resp); + init_completion(&ab->wmi_ab.service_ready); + init_completion(&ab->wmi_ab.unified_ready); + init_completion(&ab->dp.htt_tgt_version_received); INIT_WORK(&ab->restart_work, ath11k_core_restart); INIT_WORK(&ab->update_11d_work, ath11k_update_11d); INIT_WORK(&ab->reset_work, ath11k_core_reset); diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/= ath/ath11k/core.h index 593e54c59737..232d9be475cc 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -289,6 +289,7 @@ enum ath11k_dev_flags { ATH11K_FLAG_MULTI_MSI_VECTORS, ATH11K_FLAG_FTM_SEGMENTED, ATH11K_FLAG_CE_RINGS_SETUP, + ATH11K_FLAG_FW_DOWN, }; =20 enum ath11k_monitor_flags { @@ -1289,6 +1290,9 @@ int ath11k_core_resume(struct ath11k_base *ab); int ath11k_core_suspend(struct ath11k_base *ab); int ath11k_core_suspend_late(struct ath11k_base *ab); void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab); +void ath11k_core_firmware_going_down(struct ath11k_base *ab); +long ath11k_core_wait_for_fw(struct ath11k_base *ab, struct completion *do= ne, + unsigned long timeout); bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab); =20 const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless= /ath/ath11k/dp_tx.c index cac970c92806..01ef11a7a9a7 100644 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c @@ -998,9 +998,10 @@ int ath11k_dp_tx_htt_h2t_ver_req_msg(struct ath11k_bas= e *ab) struct sk_buff *skb; struct htt_ver_req_cmd *cmd; int len =3D sizeof(*cmd); + long time_left; int ret; =20 - init_completion(&dp->htt_tgt_version_received); + reinit_completion(&dp->htt_tgt_version_received); =20 skb =3D ath11k_htc_alloc_skb(ab, len); if (!skb) @@ -1017,9 +1018,11 @@ int ath11k_dp_tx_htt_h2t_ver_req_msg(struct ath11k_b= ase *ab) return ret; } =20 - ret =3D wait_for_completion_timeout(&dp->htt_tgt_version_received, - HTT_TARGET_VERSION_TIMEOUT_HZ); - if (ret =3D=3D 0) { + time_left =3D ath11k_core_wait_for_fw(ab, &dp->htt_tgt_version_received, + HTT_TARGET_VERSION_TIMEOUT_HZ); + if (time_left < 0) + return time_left; + if (time_left =3D=3D 0) { ath11k_warn(ab, "htt target version request timed out\n"); return -ETIMEDOUT; } diff --git a/drivers/net/wireless/ath/ath11k/htc.c b/drivers/net/wireless/a= th/ath11k/htc.c index 07fc959ed74c..312002e19cac 100644 --- a/drivers/net/wireless/ath/ath11k/htc.c +++ b/drivers/net/wireless/ath/ath11k/htc.c @@ -522,28 +522,30 @@ int ath11k_htc_wait_target(struct ath11k_htc *htc) { int i, status =3D 0; struct ath11k_base *ab =3D htc->ab; - unsigned long time_left; + long time_left; struct ath11k_htc_ready *ready; u16 message_id; u16 credit_count; u16 credit_size; =20 - time_left =3D wait_for_completion_timeout(&htc->ctl_resp, - ATH11K_HTC_WAIT_TIMEOUT_HZ); + time_left =3D ath11k_core_wait_for_fw(ab, &htc->ctl_resp, + ATH11K_HTC_WAIT_TIMEOUT_HZ); if (!time_left) { ath11k_warn(ab, "failed to receive control response completion, polling.= .\n"); =20 for (i =3D 0; i < ab->hw_params.ce_count; i++) ath11k_ce_per_engine_service(htc->ab, i); =20 - time_left =3D - wait_for_completion_timeout(&htc->ctl_resp, + time_left =3D ath11k_core_wait_for_fw(ab, &htc->ctl_resp, ATH11K_HTC_WAIT_TIMEOUT_HZ); =20 if (!time_left) status =3D -ETIMEDOUT; } =20 + if (time_left < 0) + status =3D time_left; + if (status < 0) { ath11k_warn(ab, "ctl_resp never came in (%d)\n", status); return status; @@ -603,7 +605,7 @@ int ath11k_htc_connect_service(struct ath11k_htc *htc, struct sk_buff *skb; unsigned int max_msg_size =3D 0; int length, status; - unsigned long time_left; + long time_left; bool disable_credit_flow_ctrl =3D false; u16 message_id, service_id, flags =3D 0; u8 tx_alloc =3D 0; @@ -666,8 +668,10 @@ int ath11k_htc_connect_service(struct ath11k_htc *htc, } =20 /* wait for response */ - time_left =3D wait_for_completion_timeout(&htc->ctl_resp, - ATH11K_HTC_CONN_SVC_TIMEOUT_HZ); + time_left =3D ath11k_core_wait_for_fw(ab, &htc->ctl_resp, + ATH11K_HTC_CONN_SVC_TIMEOUT_HZ); + if (time_left < 0) + return time_left; if (!time_left) { ath11k_err(ab, "Service connect timeout\n"); return -ETIMEDOUT; @@ -836,7 +840,7 @@ int ath11k_htc_init(struct ath11k_base *ab) return ret; } =20 - init_completion(&htc->ctl_resp); + reinit_completion(&htc->ctl_resp); =20 return 0; } diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index 4a3837958e01..232a2d4e8c85 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1705,6 +1705,55 @@ static const struct qmi_elem_info qmi_wlfw_fw_init_d= one_ind_msg_v01_ei[] =3D { }, }; =20 +struct ath11k_qmi_txn_waiter { + struct list_head list; + struct qmi_txn *txn; +}; + +static int ath11k_qmi_txn_wait(struct ath11k_base *ab, struct qmi_txn *txn) +{ + struct ath11k_qmi_txn_waiter waiter =3D { .txn =3D txn }; + int ret; + + spin_lock(&ab->qmi.txn_wait_lock); + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) { + spin_unlock(&ab->qmi.txn_wait_lock); + qmi_txn_cancel(txn); + return -ESHUTDOWN; + } + list_add(&waiter.list, &ab->qmi.txn_waiters); + spin_unlock(&ab->qmi.txn_wait_lock); + + ret =3D qmi_txn_wait(txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); + + spin_lock(&ab->qmi.txn_wait_lock); + list_del(&waiter.list); + spin_unlock(&ab->qmi.txn_wait_lock); + + /* ath11k_qmi_abort_txns() ends the wait without a response */ + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) + return -ESHUTDOWN; + + return ret; +} + +/** + * ath11k_qmi_abort_txns() - end the waits for QMI responses + * @ab: device + * + * Called after ATH11K_FLAG_FW_DOWN is set. The waiters in + * ath11k_qmi_txn_wait() return -ESHUTDOWN, and new ones are not started. + */ +void ath11k_qmi_abort_txns(struct ath11k_base *ab) +{ + struct ath11k_qmi_txn_waiter *waiter; + + spin_lock(&ab->qmi.txn_wait_lock); + list_for_each_entry(waiter, &ab->qmi.txn_waiters, list) + complete(&waiter->txn->completion); + spin_unlock(&ab->qmi.txn_wait_lock); +} + /* clang stack usage explodes if this is inlined */ static noinline_for_stack int ath11k_qmi_host_cap_send(struct ath11k_base *ab) @@ -1760,12 +1809,12 @@ int ath11k_qmi_host_cap_send(struct ath11k_base *ab) =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "host cap request\n"); =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_HOST_CAP_REQ_V01, QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_host_cap_req_msg_v01_ei, &req); @@ -1775,7 +1824,7 @@ int ath11k_qmi_host_cap_send(struct ath11k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) goto out; =20 @@ -1794,7 +1843,7 @@ static int ath11k_qmi_fw_ind_register_send(struct ath= 11k_base *ab) { struct qmi_wlanfw_ind_register_req_msg_v01 *req; struct qmi_wlanfw_ind_register_resp_msg_v01 *resp; - struct qmi_handle *handle =3D &ab->qmi.handle; + struct qmi_handle *handle =3D ab->qmi.handle; struct qmi_txn txn; int ret; =20 @@ -1838,7 +1887,7 @@ static int ath11k_qmi_fw_ind_register_send(struct ath= 11k_base *ab) =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "indication register request\n"); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_IND_REGISTER_REQ_V01, QMI_WLANFW_IND_REGISTER_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_ind_register_req_msg_v01_ei, req); @@ -1849,7 +1898,7 @@ static int ath11k_qmi_fw_ind_register_send(struct ath= 11k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to register fw indication: %d\n", ret); goto out; @@ -1911,7 +1960,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct a= th11k_base *ab) } } =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_respond_mem_resp_msg_v01_ei, &resp); if (ret < 0) goto out; @@ -1919,7 +1968,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct a= th11k_base *ab) ath11k_dbg(ab, ATH11K_DBG_QMI, "respond memory request delayed %i\n", delayed); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_RESPOND_MEM_REQ_V01, QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_respond_mem_req_msg_v01_ei, req); @@ -1930,7 +1979,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct a= th11k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait qmi memory request: %d\n", ret); goto out; @@ -2129,12 +2178,12 @@ static int ath11k_qmi_request_device_info(struct at= h11k_base *ab) if (!ab->hw_params.hybrid_bus_type) return 0; =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlfw_device_info_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_DEVICE_INFO_REQ_V01, QMI_WLANFW_DEVICE_INFO_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_device_info_req_msg_v01_ei, &req); @@ -2145,7 +2194,7 @@ static int ath11k_qmi_request_device_info(struct ath1= 1k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait qmi target device info request: %d\n", ret); @@ -2207,14 +2256,14 @@ static int ath11k_qmi_request_target_cap(struct ath= 11k_base *ab) memset(&req, 0, sizeof(req)); memset(&resp, 0, sizeof(resp)); =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, qmi_wlanfw_cap_resp_msg_v01_e= i, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_cap_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "target cap request\n"); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_CAP_REQ_V01, QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_cap_req_msg_v01_ei, &req); @@ -2225,7 +2274,7 @@ static int ath11k_qmi_request_target_cap(struct ath11= k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait qmi cap request: %d\n", ret); goto out; @@ -2356,7 +2405,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath= 11k_base *ab, memcpy_toio(bdf_addr, temp, len); } =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_bdf_download_resp_msg_v01_ei, &resp); if (ret < 0) @@ -2365,7 +2414,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath= 11k_base *ab, ath11k_dbg(ab, ATH11K_DBG_QMI, "bdf download req fixed addr type %d\n", type); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_bdf_download_req_msg_v01_ei, req); @@ -2374,7 +2423,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath= 11k_base *ab, goto err_iounmap; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS= )); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait board file download request: %d\n", ret); @@ -2603,14 +2652,14 @@ int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_ba= se *ab) req.size =3D 0; } =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_m3_info_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "m3 info req\n"); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_M3_INFO_REQ_V01, QMI_WLANFW_M3_INFO_REQ_MSG_V01_MAX_MSG_LEN, qmi_wlanfw_m3_info_req_msg_v01_ei, &req); @@ -2621,7 +2670,7 @@ int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base= *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait m3 information request: %d\n", ret); goto out; @@ -2652,14 +2701,14 @@ static int ath11k_qmi_wlanfw_mode_send(struct ath11= k_base *ab, req.hw_debug_valid =3D 1; req.hw_debug =3D 0; =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_wlan_mode_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "wlan mode req mode %d\n", mode); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_WLAN_MODE_REQ_V01, QMI_WLANFW_WLAN_MODE_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req); @@ -2670,7 +2719,7 @@ static int ath11k_qmi_wlanfw_mode_send(struct ath11k_= base *ab, goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { if (mode =3D=3D ATH11K_FIRMWARE_MODE_OFF && ret =3D=3D -ENETRESET) { ath11k_warn(ab, "WLFW service is dis-connected\n"); @@ -2747,14 +2796,14 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct a= th11k_base *ab) req->shadow_reg_v2_valid =3D 0; } =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_wlan_cfg_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "wlan cfg req\n"); =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_WLAN_CFG_REQ_V01, QMI_WLANFW_WLAN_CFG_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_wlan_cfg_req_msg_v01_ei, req); @@ -2765,7 +2814,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath= 11k_base *ab) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "failed to wait wlan config request: %d\n", ret); goto out; @@ -2793,12 +2842,12 @@ static int ath11k_qmi_wlanfw_wlan_ini_send(struct a= th11k_base *ab, bool enable) req.enablefwlog_valid =3D true; req.enablefwlog =3D enable ? 1 : 0; =20 - ret =3D qmi_txn_init(&ab->qmi.handle, &txn, + ret =3D qmi_txn_init(ab->qmi.handle, &txn, qmi_wlanfw_wlan_ini_resp_msg_v01_ei, &resp); if (ret < 0) goto out; =20 - ret =3D qmi_send_request(&ab->qmi.handle, NULL, &txn, + ret =3D qmi_send_request(ab->qmi.handle, NULL, &txn, QMI_WLANFW_WLAN_INI_REQ_V01, QMI_WLANFW_WLAN_INI_REQ_MSG_V01_MAX_LEN, qmi_wlanfw_wlan_ini_req_msg_v01_ei, &req); @@ -2809,7 +2858,7 @@ static int ath11k_qmi_wlanfw_wlan_ini_send(struct ath= 11k_base *ab, bool enable) goto out; } =20 - ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)= ); + ret =3D ath11k_qmi_txn_wait(ab, &txn); if (ret < 0) { ath11k_warn(ab, "qmi failed wlan ini request, err =3D %d\n", ret); goto out; @@ -2831,6 +2880,9 @@ void ath11k_qmi_firmware_stop(struct ath11k_base *ab) =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "firmware stop\n"); =20 + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) + return; + ret =3D ath11k_qmi_wlanfw_mode_send(ab, ATH11K_FIRMWARE_MODE_OFF); if (ret < 0) { ath11k_warn(ab, "qmi failed to send wlan mode off: %d\n", ret); @@ -2845,6 +2897,9 @@ int ath11k_qmi_firmware_start(struct ath11k_base *ab, =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "firmware start\n"); =20 + if (test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)) + return -ESHUTDOWN; + if (ab->hw_params.fw_wmi_diag_event) { ret =3D ath11k_qmi_wlanfw_wlan_ini_send(ab, true); if (ret < 0) { @@ -2909,7 +2964,8 @@ static int ath11k_qmi_process_coldboot_calibration(st= ruct ath11k_base *ab) ath11k_dbg(ab, ATH11K_DBG_QMI, "Coldboot calibration wait started\n"); =20 time_left =3D wait_event_timeout(ab->qmi.cold_boot_waitq, - (ab->qmi.cal_done =3D=3D 1), + (ab->qmi.cal_done =3D=3D 1 || + test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags)), ATH11K_COLD_BOOT_FW_RESET_DELAY); if (time_left <=3D 0) { ath11k_warn(ab, "coldboot calibration timed out\n"); @@ -2921,11 +2977,17 @@ static int ath11k_qmi_process_coldboot_calibration(= struct ath11k_base *ab) return 0; } =20 +static struct ath11k_qmi_client *ath11k_qmi_client(struct qmi_handle *qmi_= hdl) +{ + return container_of(qmi_hdl, struct ath11k_qmi_client, handle); +} + static int -ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, +ath11k_qmi_driver_event_post(struct ath11k_qmi_client *client, enum ath11k_qmi_event_type type, void *data) { + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_qmi_driver_event *event; =20 event =3D kzalloc_obj(*event, GFP_ATOMIC); @@ -2936,6 +2998,7 @@ ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, event->data =3D data; =20 spin_lock(&qmi->event_lock); + event->gen =3D client->gen; list_add_tail(&event->list, &qmi->event_list); spin_unlock(&qmi->event_lock); =20 @@ -3023,7 +3086,8 @@ static void ath11k_qmi_msg_mem_request_cb(struct qmi_= handle *qmi_hdl, struct qmi_txn *txn, const void *data) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, struct ath11k_qmi, handl= e); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; const struct qmi_wlanfw_request_mem_ind_msg_v01 *msg =3D data; int i, ret; @@ -3061,7 +3125,7 @@ static void ath11k_qmi_msg_mem_request_cb(struct qmi_= handle *qmi_hdl, } } =20 - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_REQUEST_MEM, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_REQUEST_MEM, NULL); } =20 static void ath11k_qmi_msg_mem_ready_cb(struct qmi_handle *qmi_hdl, @@ -3069,11 +3133,12 @@ static void ath11k_qmi_msg_mem_ready_cb(struct qmi_= handle *qmi_hdl, struct qmi_txn *txn, const void *decoded) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, struct ath11k_qmi, handl= e); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "firmware memory ready indication\n"); - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_MEM_READY, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_FW_MEM_READY, NULL); } =20 static void ath11k_qmi_msg_fw_ready_cb(struct qmi_handle *qmi_hdl, @@ -3081,7 +3146,8 @@ static void ath11k_qmi_msg_fw_ready_cb(struct qmi_han= dle *qmi_hdl, struct qmi_txn *txn, const void *decoded) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, struct ath11k_qmi, handl= e); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "firmware ready\n"); @@ -3091,7 +3157,7 @@ static void ath11k_qmi_msg_fw_ready_cb(struct qmi_han= dle *qmi_hdl, wake_up(&ab->qmi.cold_boot_waitq); } =20 - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_READY, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_FW_READY, NULL); } =20 static void ath11k_qmi_msg_cold_boot_cal_done_cb(struct qmi_handle *qmi_hd= l, @@ -3099,8 +3165,8 @@ static void ath11k_qmi_msg_cold_boot_cal_done_cb(stru= ct qmi_handle *qmi_hdl, struct qmi_txn *txn, const void *decoded) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, - struct ath11k_qmi, handle); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; =20 ab->qmi.cal_done =3D 1; @@ -3113,11 +3179,11 @@ static void ath11k_qmi_msg_fw_init_done_cb(struct q= mi_handle *qmi_hdl, struct qmi_txn *txn, const void *decoded) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, - struct ath11k_qmi, handle); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; =20 - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_INIT_DONE, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_FW_INIT_DONE, NULL); ath11k_dbg(ab, ATH11K_DBG_QMI, "firmware init done\n"); } =20 @@ -3167,7 +3233,8 @@ static const struct qmi_msg_handler ath11k_qmi_msg_ha= ndlers[] =3D { static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl, struct qmi_service *service) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, struct ath11k_qmi, handl= e); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; struct sockaddr_qrtr *sq =3D &qmi->sq; int ret; @@ -3184,7 +3251,7 @@ static int ath11k_qmi_ops_new_server(struct qmi_handl= e *qmi_hdl, } =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "wifi fw qmi service connected\n"); - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_SERVER_ARRIVE, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_SERVER_ARRIVE, NULL= ); =20 return ret; } @@ -3192,11 +3259,12 @@ static int ath11k_qmi_ops_new_server(struct qmi_han= dle *qmi_hdl, static void ath11k_qmi_ops_del_server(struct qmi_handle *qmi_hdl, struct qmi_service *service) { - struct ath11k_qmi *qmi =3D container_of(qmi_hdl, struct ath11k_qmi, handl= e); + struct ath11k_qmi_client *client =3D ath11k_qmi_client(qmi_hdl); + struct ath11k_qmi *qmi =3D client->qmi; struct ath11k_base *ab =3D qmi->ab; =20 ath11k_dbg(ab, ATH11K_DBG_QMI, "wifi fw del server\n"); - ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_SERVER_EXIT, NULL); + ath11k_qmi_driver_event_post(client, ATH11K_QMI_EVENT_SERVER_EXIT, NULL); } =20 static const struct qmi_ops ath11k_qmi_ops =3D { @@ -3204,12 +3272,42 @@ static const struct qmi_ops ath11k_qmi_ops =3D { .del_server =3D ath11k_qmi_ops_del_server, }; =20 +/* + * A firmware that goes down is not talked to any more, see + * ath11k_qmi_firmware_going_down(). A server exit is handled from any + * client: it reports a firmware that is gone, and its handling sets + * CRASH_FLUSH and RECOVERY and runs ath11k_core_pre_reconfigure_recovery(= ), + * which stop the host's use of that firmware and wake its waiters without + * sending anything to a firmware. Only a server found by the client that + * ath11k_qmi_firmware_went_down() started afterwards belongs to the next + * firmware, and its arrival ends ATH11K_FLAG_FW_DOWN. + */ +static bool ath11k_qmi_event_stale(struct ath11k_qmi *qmi, + struct ath11k_qmi_driver_event *event) +{ + struct ath11k_base *ab =3D qmi->ab; + + lockdep_assert_held(&qmi->event_lock); + + if (event->type =3D=3D ATH11K_QMI_EVENT_SERVER_EXIT) + return false; + + if (qmi->stopping || event->gen !=3D qmi->gen) + return true; + + if (event->type =3D=3D ATH11K_QMI_EVENT_SERVER_ARRIVE) + clear_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags); + + return test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags); +} + static void ath11k_qmi_driver_event_work(struct work_struct *work) { struct ath11k_qmi *qmi =3D container_of(work, struct ath11k_qmi, event_work); struct ath11k_qmi_driver_event *event; struct ath11k_base *ab =3D qmi->ab; + bool stale; int ret; =20 spin_lock(&qmi->event_lock); @@ -3217,6 +3315,7 @@ static void ath11k_qmi_driver_event_work(struct work_= struct *work) event =3D list_first_entry(&qmi->event_list, struct ath11k_qmi_driver_event, list); list_del(&event->list); + stale =3D ath11k_qmi_event_stale(qmi, event); spin_unlock(&qmi->event_lock); =20 if (test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags)) { @@ -3224,6 +3323,13 @@ static void ath11k_qmi_driver_event_work(struct work= _struct *work) return; } =20 + if (stale) { + ath11k_dbg(ab, ATH11K_DBG_QMI, + "drop event %d of a firmware that went down\n", + event->type); + goto next; + } + switch (event->type) { case ATH11K_QMI_EVENT_SERVER_ARRIVE: ret =3D ath11k_qmi_event_server_arrive(qmi); @@ -3309,14 +3415,52 @@ static void ath11k_qmi_driver_event_work(struct wor= k_struct *work) ath11k_warn(ab, "invalid qmi event type: %d", event->type); break; } +next: kfree(event); spin_lock(&qmi->event_lock); } spin_unlock(&qmi->event_lock); } =20 +/* + * Makes @client current. stopping is left as it is: only + * ath11k_qmi_firmware_going_down() and ath11k_qmi_firmware_went_down() + * change it, under event_lock. + */ +static void ath11k_qmi_set_client(struct ath11k_qmi *qmi, + struct ath11k_qmi_client *client, + bool clear_stopping) +{ + lockdep_assert_held(&qmi->client_lock); + + spin_lock(&qmi->event_lock); + qmi->handle =3D &client->handle; + qmi->gen =3D client->gen; + if (clear_stopping) + qmi->stopping =3D false; + spin_unlock(&qmi->event_lock); +} + +/** + * ath11k_qmi_init_state() - initialise the QMI state used by the bus + * @ab: device + * + * Sets up the locks, lists and works that ath11k_qmi_firmware_going_down(= ) and + * ath11k_qmi_firmware_went_down() use, before the bus can call them. + */ +void ath11k_qmi_init_state(struct ath11k_base *ab) +{ + INIT_LIST_HEAD(&ab->qmi.event_list); + spin_lock_init(&ab->qmi.event_lock); + INIT_WORK(&ab->qmi.event_work, ath11k_qmi_driver_event_work); + spin_lock_init(&ab->qmi.txn_wait_lock); + INIT_LIST_HEAD(&ab->qmi.txn_waiters); + mutex_init(&ab->qmi.client_lock); +} + int ath11k_qmi_init_service(struct ath11k_base *ab) { + struct ath11k_qmi_client *client =3D &ab->qmi.clients[0]; int ret; =20 memset(&ab->qmi.target, 0, sizeof(struct target_info)); @@ -3324,46 +3468,152 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) ab->qmi.ab =3D ab; =20 ab->qmi.target_mem_mode =3D ab->hw_params.fw_mem_mode; - ret =3D qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX, - &ath11k_qmi_ops, ath11k_qmi_msg_handlers); - if (ret < 0) { - ath11k_warn(ab, "failed to initialize qmi handle: %d\n", ret); - return ret; - } =20 ab->qmi.event_wq =3D alloc_ordered_workqueue("ath11k_qmi_driver_event", 0= ); if (!ab->qmi.event_wq) { ath11k_err(ab, "failed to allocate workqueue\n"); - ret =3D -EFAULT; - goto err_release_handle; + return -EFAULT; } =20 - INIT_LIST_HEAD(&ab->qmi.event_list); - spin_lock_init(&ab->qmi.event_lock); - INIT_WORK(&ab->qmi.event_work, ath11k_qmi_driver_event_work); + mutex_lock(&ab->qmi.client_lock); =20 - ret =3D qmi_add_lookup(&ab->qmi.handle, QMI_SERVICE_ID_WLFW, + client->qmi =3D &ab->qmi; + client->gen =3D ab->qmi.last_gen; + ret =3D qmi_handle_init(&client->handle, ATH11K_QMI_RESP_LEN_MAX, + &ath11k_qmi_ops, ath11k_qmi_msg_handlers); + if (ret < 0) { + ath11k_warn(ab, "failed to initialize qmi handle: %d\n", ret); + goto err_unlock; + } + + /* + * The lookup is sent under client_lock: if a shutdown notification + * started before it, ath11k_qmi_firmware_went_down() takes the lock + * after it and restarts this client; stopping, set under event_lock, + * keeps the client's events dropped until then. + */ + ath11k_qmi_set_client(&ab->qmi, client, false); + + ret =3D qmi_add_lookup(&client->handle, QMI_SERVICE_ID_WLFW, ATH11K_QMI_WLFW_SERVICE_VERS_V01, ab->qmi.service_ins_id); if (ret < 0) { ath11k_warn(ab, "failed to add qmi lookup: %d\n", ret); - destroy_workqueue(ab->qmi.event_wq); - goto err_release_handle; + qmi_handle_release(&client->handle); + goto err_unlock; } =20 - return ret; + ab->qmi.client_live =3D true; + mutex_unlock(&ab->qmi.client_lock); =20 -err_release_handle: - qmi_handle_release(&ab->qmi.handle); + return 0; + +err_unlock: + mutex_unlock(&ab->qmi.client_lock); + destroy_workqueue(ab->qmi.event_wq); =20 return ret; } =20 +/** + * ath11k_qmi_firmware_going_down() - stop handling events of the firmware + * @ab: device + * + * Sets ATH11K_FLAG_FW_DOWN. From now on only server exits are handled, un= til + * ath11k_qmi_firmware_went_down() started a new client and that client fo= und + * the server of the next firmware. + */ +void ath11k_qmi_firmware_going_down(struct ath11k_base *ab) +{ + spin_lock(&ab->qmi.event_lock); + ab->qmi.stopping =3D true; + set_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags); + spin_unlock(&ab->qmi.event_lock); +} + +/** + * ath11k_qmi_firmware_went_down() - start the QMI client for the next fir= mware + * @ab: device + * + * Called after ath11k_qmi_firmware_going_down(), once the transport of the + * firmware is gone. The QRTR name server has then been told that the node= of + * that firmware is gone before the lookup of the new client reaches it, so + * the new client only finds servers of a firmware started later. Releasing + * the old client afterwards reports the exit of a server it knew. + * + * The old client can still receive an arrival of the firmware that went + * down, so it is never used for the next firmware: if the new client cann= ot + * be set up, every event other than a server exit stays dropped and + * ATH11K_FLAG_FW_DOWN stays set until a later shutdown notification sets = one + * up. Without any client, before + * ath11k_qmi_init_service() or after ath11k_qmi_deinit_service(), there is + * nothing to restart; a client set up later sends its lookup after this. + * + * Context: process context, not from the QMI event work. + */ +void ath11k_qmi_firmware_went_down(struct ath11k_base *ab) +{ + struct ath11k_qmi *qmi =3D &ab->qmi; + struct ath11k_qmi_client *old, *next; + bool stopping; + int ret; + + mutex_lock(&qmi->client_lock); + + spin_lock(&qmi->event_lock); + stopping =3D qmi->stopping; + if (!qmi->client_live) + qmi->stopping =3D false; + spin_unlock(&qmi->event_lock); + + if (!stopping || !qmi->client_live) + goto unlock; + + old =3D ath11k_qmi_client(qmi->handle); + next =3D old =3D=3D &qmi->clients[0] ? &qmi->clients[1] : &qmi->clients[0= ]; + next->qmi =3D qmi; + next->gen =3D ++qmi->last_gen; + + ret =3D qmi_handle_init(&next->handle, ATH11K_QMI_RESP_LEN_MAX, + &ath11k_qmi_ops, ath11k_qmi_msg_handlers); + if (ret < 0) { + ath11k_err(ab, "failed to initialize qmi handle, staying down: %d\n", + ret); + goto unlock; + } + + ret =3D qmi_add_lookup(&next->handle, QMI_SERVICE_ID_WLFW, + ATH11K_QMI_WLFW_SERVICE_VERS_V01, + qmi->service_ins_id); + if (ret < 0) { + ath11k_err(ab, "failed to add qmi lookup, staying down: %d\n", + ret); + qmi_handle_release(&next->handle); + goto unlock; + } + + /* + * The next firmware is started only after this notification returns, + * so no event of the new client is posted before it is current. + */ + ath11k_qmi_set_client(qmi, next, true); + qmi_handle_release(&old->handle); + +unlock: + mutex_unlock(&qmi->client_lock); +} +EXPORT_SYMBOL(ath11k_qmi_firmware_went_down); + void ath11k_qmi_deinit_service(struct ath11k_base *ab) { struct ath11k_qmi_driver_event *event, *tmp; =20 - qmi_handle_release(&ab->qmi.handle); + /* No client is started after this one is released */ + mutex_lock(&ab->qmi.client_lock); + ab->qmi.client_live =3D false; + qmi_handle_release(ab->qmi.handle); + mutex_unlock(&ab->qmi.client_lock); + cancel_work_sync(&ab->qmi.event_work); destroy_workqueue(ab->qmi.event_wq); =20 diff --git a/drivers/net/wireless/ath/ath11k/qmi.h b/drivers/net/wireless/a= th/ath11k/qmi.h index 350816c81ee5..fac40fa6b5b0 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h @@ -77,6 +77,8 @@ struct ath11k_qmi_driver_event { struct list_head list; enum ath11k_qmi_event_type type; void *data; + /* ath11k_qmi::gen when the event was posted */ + u32 gen; }; =20 struct ath11k_qmi_ce_cfg { @@ -126,9 +128,21 @@ struct m3_mem_region { void *vaddr; }; =20 +struct ath11k_qmi; + +/* A QMI client, see ath11k_qmi_firmware_went_down() */ +struct ath11k_qmi_client { + struct qmi_handle handle; + struct ath11k_qmi *qmi; + /* stamped into the events the client posts */ + u32 gen; +}; + struct ath11k_qmi { struct ath11k_base *ab; - struct qmi_handle handle; + /* handle of the current client */ + struct qmi_handle *handle; + struct ath11k_qmi_client clients[2]; struct sockaddr_qrtr sq; struct work_struct event_work; struct workqueue_struct *event_wq; @@ -144,6 +158,24 @@ struct ath11k_qmi { struct m3_mem_region m3_mem; unsigned int service_ins_id; wait_queue_head_t cold_boot_waitq; + /* + * Under event_lock: gen of the current client, and stopping from + * ath11k_qmi_firmware_going_down() until ath11k_qmi_firmware_went_down() + * set the client for the next firmware. + */ + u32 gen; + bool stopping; + /* + * client_lock serialises ath11k_qmi_init_service(), + * ath11k_qmi_firmware_went_down() and ath11k_qmi_deinit_service(); + * client_live is set while a client exists. + */ + struct mutex client_lock; + u32 last_gen; + bool client_live; + /* protects txn_waiters, see ath11k_qmi_abort_txns() */ + spinlock_t txn_wait_lock; + struct list_head txn_waiters; }; =20 #define QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN 261 @@ -517,6 +549,10 @@ struct qmi_wlanfw_wlan_ini_resp_msg_v01 { int ath11k_qmi_firmware_start(struct ath11k_base *ab, u32 mode); void ath11k_qmi_firmware_stop(struct ath11k_base *ab); +void ath11k_qmi_abort_txns(struct ath11k_base *ab); +void ath11k_qmi_init_state(struct ath11k_base *ab); +void ath11k_qmi_firmware_going_down(struct ath11k_base *ab); +void ath11k_qmi_firmware_went_down(struct ath11k_base *ab); void ath11k_qmi_deinit_service(struct ath11k_base *ab); int ath11k_qmi_init_service(struct ath11k_base *ab); void ath11k_qmi_free_resource(struct ath11k_base *ab); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/a= th/ath11k/wmi.c index 82b8481ba818..467def051155 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -304,14 +304,16 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_p= dev_wmi *wmi, struct sk_buf } =20 /* - * While the firmware restarts, only the restart work talks to it. - * Tested on every try, so that a sender which already waits for a - * credit or a CE descriptor when the firmware crashes is held back too. + * While the firmware restarts, only the restart work talks to it, and + * nobody talks to a firmware that is going down. Tested on every try, so + * that a sender which already waits for a credit or a CE descriptor when + * the firmware crashes is held back too. */ static bool ath11k_wmi_cmd_held_back(struct ath11k_base *ab) { - return test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) && - current_work() !=3D &ab->restart_work; + return test_bit(ATH11K_FLAG_FW_DOWN, &ab->dev_flags) || + (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) && + current_work() !=3D &ab->restart_work); } =20 int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb, @@ -4426,10 +4428,12 @@ int ath11k_wmi_pdev_lro_cfg(struct ath11k *ar, =20 int ath11k_wmi_wait_for_service_ready(struct ath11k_base *ab) { - unsigned long time_left; + long time_left; =20 - time_left =3D wait_for_completion_timeout(&ab->wmi_ab.service_ready, - WMI_SERVICE_READY_TIMEOUT_HZ); + time_left =3D ath11k_core_wait_for_fw(ab, &ab->wmi_ab.service_ready, + WMI_SERVICE_READY_TIMEOUT_HZ); + if (time_left < 0) + return time_left; if (!time_left) return -ETIMEDOUT; =20 @@ -4438,10 +4442,12 @@ int ath11k_wmi_wait_for_service_ready(struct ath11k= _base *ab) =20 int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab) { - unsigned long time_left; + long time_left; =20 - time_left =3D wait_for_completion_timeout(&ab->wmi_ab.unified_ready, - WMI_SERVICE_READY_TIMEOUT_HZ); + time_left =3D ath11k_core_wait_for_fw(ab, &ab->wmi_ab.unified_ready, + WMI_SERVICE_READY_TIMEOUT_HZ); + if (time_left < 0) + return time_left; if (!time_left) return -ETIMEDOUT; =20 @@ -9330,8 +9336,8 @@ int ath11k_wmi_attach(struct ath11k_base *ab) ab->wmi_ab.preferred_hw_mode =3D WMI_HOST_HW_MODE_SINGLE; =20 /* TODO: Init remaining wmi soc resources required */ - init_completion(&ab->wmi_ab.service_ready); - init_completion(&ab->wmi_ab.unified_ready); + reinit_completion(&ab->wmi_ab.service_ready); + reinit_completion(&ab->wmi_ab.unified_ready); =20 return 0; } --=20 2.53.0 From nobody Tue Nov 24 12:36:12 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302479; b=0WBzx9uwnGkZC/WtjTOqeilXLDLl5dcNzfEKmoa5SkD786XyIzwsFgmbcLvf1yIj3od5 hb6APoE5dIyRFP4uFo3J+AeV5ArDei1ENCvD50sfcmRLk2fi3YYDqbczBIgj0qHtAQgJU Iuz1t9MqU95kxxXNmieS1J2c9rmz5JiQ4PnqIJad3/g1NGfT5vJj6GB7sfgsvTzwXEc2L ol8HpSJ5jzHA+VKMkEglIEF7IGYjOeuRik+j4GB3SXUrd+VQQVBKaU+POihZbl/MrRRpj M79YliTFxCopaDghW8nWnl55Lcbj3n2NZuIKGzXguPslIQ2w6K54kQlVvNzygpncQ+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302479; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=Jfrh1uIU+/waSgkZCGYbAyxAmQdxTwCrEPYnNRV069U=; b=32SATi6m8DzGVgGUt0KMulK74MvXgo8fZemMCg3lKk+uMtVOKHl0VEvsK2FI9Z8CnyPI +DDnouf3CVCSkY5NSDR44PQDsndQTD43lihh0VVhAsssIVOH7T+D66xPIh+wc9j7aK565 keCZ/OjUWUTn+YR6f849G/xZiVH/+dFLbd8kUSVE74cSAOFFfQZGoFLPxFKd7Y1zyBUA2 f+xUjxR+vWyOeKEyiAkeXTb27rrHxdGj8e9L0p98JaPKqGgArzjC3n2SkJDSAl/e1Ty3y Ki2GHe8l26UdwStwtZ/cnWzOXKqn/Hu13CZeT/BNITkJ4iwDl8fWZRngR64TRyNGofA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=Y4DSGDzW; arc=none smtp.remote-ip=209.85.218.46 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1977C60A5BC7 for ; Sat, 21 Nov 2026 23:07:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1977C60A5BC7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=Y4DSGDzW Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c4d5b2db4bbso477295966b.0 for ; Sat, 21 Nov 2026 15:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795302476; x=1795907276; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Jfrh1uIU+/waSgkZCGYbAyxAmQdxTwCrEPYnNRV069U=; b=Y4DSGDzWNrPyJqrxTJ0lhKrSAz5dkggFsvVp8ZiyzuBH4JqzRQmwoc6DgZHpcvehiL iUbMNef6MIxzHOfL11EFzsKVrP/M0aBGWJxaeUgmj4dz4xDbAbzDU1C5z5ZJFEyLDEJQ s6zvSZBRqCks5EQt29Vj9H2Z/7m7LmteMeEGqMc2xdWPde0/DhJHeoGGIkQQbENhRf8Q 9vUKu9rps8MXskdv36TFGMaGe1/xABojop4Nx8y9mSw0VQ+KSYu3u9MjkRg78OR8GDhi 3WTWfVCqRFUswal7fmVf6OYDCBrUSg5h+ZadrvugMkkYfeHptfu8t17sWuf0nWah84Zy mXHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795302476; x=1795907276; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Jfrh1uIU+/waSgkZCGYbAyxAmQdxTwCrEPYnNRV069U=; b=QgIPHjADmGglgO+juX/f4npS5bmBNx/+OequgwBB4HeRpmfAjv62hEaAUCdXg9ZVVv 6wiB7VJA9bvZWQ2SrxZSEe+vV1ZKJA4VTgUa/h7Zt5CoDGBveJnAk4rIZ0LeaAxZtp8K 01VTs/NsE5i3Pzyg2MYPg0CQRteuDw/6dNHPF+CFdo2MgA5uuJmO9zLL0WKAzpbE1BYS kCS7Njxkml4kprUTHt6NY3QsGAHI0VBghTi/yVF2g0jfQG8ullzyXXM2KYze8DPca603 nEkwnu2nU5+tVi1SoynBgoDnVfQNRF0UJkdUjQK436qSqKEB9zLUK3VWNrFKfSoyIUNm YejA== X-Forwarded-Encrypted: i=1; AL+hErEHi4mzNS4PTUiEZ6x+P/cG/6jOC19CSKZciwAylHBEiA79qNt5CeVS9mo5WoGQ1TSoBhdpQiYY+F42x5g=@vger.kernel.org X-Gm-Message-State: APuU4Z8VSfXKyLOx8gC8UGXom0KfzuqJ/CO+xIRdyDrJhGeIpvo2bl5d 1Y7UChsfMV1SvMT6lGMkFHFllUuO4ooRdXMB2pQDIG+5/GtxwwUWTTO7sJgqNHgBhw== X-Gm-Gg: AZFdTZcbeRtpmafMmiebd0yUrNyD9Yfbest3ckxVG3V68bIT8hfQ3iyAAZJISDoxwPj nlfSpkSvMm9lcNHGyLKUSgxoyHr8pkNnBFuiH2rnYkiEx4Vn2Vj4mH92yy2OdvxgvvKUuMkxFZL fh9g/K3pTIAMq21tO2A+L+ocORsQ4dxlxpBsW2/efeli7hWo+japQeJiz7yleziC+sJ1l3uZQ7g QWVuLTqvtVLLQucBoMROL1Gy8mtjUSeOeVrgRrEmW1CNVi9gU+tiTr9Om14zgxOQf6ELvRf6dje /mexmTHf5xTmuOze7e2yXdDPWzVGwOd7t6gp7SPJx5oyALM4lUr1DtyTZzRJnkia7REixRYDHHc gEvhVOC7zmsJt9ldcfO6Fn2FijZgG9ZPyo1zlhaNlBBNE02xYJ3rHUumzJCt17wc6bPDdBiYMVQ 47gduoip1uQiBLa1FJVeIx9CVTPHMW78rPnFMi4w0r7F0ZFQmgsghxosSYBm0We+sOF5Ufd9l8V iNWQuHYzXp8Wy35LJ17t4Os82yEiyZq/5iAx4mB/SGtt5ow9/a+f8ShBWkxyy4s/UtJR63jHRYt K8/O14RK2l1whXMlhvZdwJJYyRhqWzV8VhbpQLkI4OJE7L/yGVFePsoKQTLnxhILx+tQmzzg7lm VJ81P+L5pV8/yv7bspXJPDUFhmtWi9gBvcKntmAtro/TVvOe9pavesdksnfI/fquWTnyOtTRWnG GvHykh2Gx+mV4vhlqlhrqOr6izkieYUgGIY8dRSVlMj+TbeoKpkcGpyEK4xjZap47wzG8W0vM+q UeVcdptojHW8uFBxoeaVdDtpWuwqzB2/7A3rMvkCoQN4oxC/eRDpSCeRjByFSY70o4Z3fEooCF+ FQPmUZNEGvF9/u0dvVxs9Fk276+sfDedxkzCAF/UJDVzmFSWBRcPpOVzmTwbroL25kskrnnlluk = X-Received: by 2002:a17:907:3f0f:b0:c41:9a35:17a2 with SMTP id a640c23a62f3a-c5131a6ef04mr809669266b.31.1795302476575; Sat, 21 Nov 2026 15:07:56 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p200300f2470edf0034412c7e8f5a5e7a.dip0.t-ipconnect.de. [2003:f2:470e:df00:3441:2c7e:8f5a:5e7a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc1b40sm242721466b.54.2026.11.21.15.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2026 15:07:56 -0800 (PST) From: Julius Bairaktaris To: Jeff Johnson Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Maurer , Baochen Qiang , Vasanthakumar Thiagarajan , Rameshkumar Sundaram , P Praneesh , Kalle Valo , Muhammad Usama Anjum , John Crispin , Sriram R , Miaoqing Pan , Karthikeyan Periyasamy , Rosen Penev , Jiale Yao , Julia Lawall , Anilkumar Kolli , Manikanta Pubbisetty , Pradeep Kumar Chitrapu , Sathishkumar Muruganandam , Muna Sinada Subject: [PATCH ath-next v3 13/13] wifi: ath11k: keep the cooling device across a firmware recovery Date: Sun, 22 Nov 2026 00:07:31 +0100 Message-ID: <20261121230731.1206043-14-julius@bairaktaris.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261121230731.1206043-1-julius@bairaktaris.de> References: <20261121230731.1206043-1-julius@bairaktaris.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath11k_core_reconfigure_on_crash() unregisters the thermal cooling devices of all radios, but ath11k_thermal_register() returns early once ATH11K_FLAG_REGISTERED is set, so the recovery never registers them again. After the first recovery the cooling devices and the phy's cooling_device link are gone, and ar->thermal.cdev still points to the freed cooling device. The next ath11k_thermal_unregister(), from the second recovery or from driver removal, passes that pointer to thermal_cooling_device_unregister(). With CONFIG_THERMAL_DEBUGFS, thermal_debug_cdev_remove() takes cdev->lock in the freed object. Without it, thermal_cooling_device_exit() only compares the pointer with the registered cooling devices, so it unregisters a cooling device that was registered since and allocated at the same address. Since ath11k_thermal_register() is a no-op during recovery, the cooling devices stay registered like the radios: do not unregister them in ath11k_core_reconfigure_on_crash(), and unwind them in ath11k_core_pdev_create() only when this call registered them. Their callbacks do not reach the firmware while it restarts: ath11k_thermal_set_throttling() and ath11k_thermal_show_temp() return early unless the radio is in ATH11K_STATE_ON. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: 50556081e09b ("wifi: ath11k: thermal: don't try to register multiple= times") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/= ath/ath11k/core.c index 0795ba7e038c..4aaac5200ed2 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2072,7 +2072,8 @@ static int ath11k_core_pdev_create(struct ath11k_base= *ab) err_spectral_unregister: ath11k_spectral_deinit(ab); err_thermal_unregister: - ath11k_thermal_unregister(ab); + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) + ath11k_thermal_unregister(ab); err_mac_unregister: if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) ath11k_mac_unregister(ab); @@ -2342,7 +2343,6 @@ static int ath11k_core_reconfigure_on_crash(struct at= h11k_base *ab) mutex_lock(&ab->core_lock); ath11k_hif_irq_disable(ab); ath11k_hif_ce_irq_disable(ab); - ath11k_thermal_unregister(ab); ath11k_dp_pdev_free(ab); ath11k_cfr_deinit(ab); ath11k_spectral_deinit(ab); --=20 2.53.0