Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C4C4364037 for ; Mon, 2 Feb 2026 11:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770032776; cv=none; b=aJEr1aEw5mXb7Sl1fjfYpRIfTKOX7d8xAvgggRV5CyhpB+H4wYWKZ5n3ZC2Ap1TBpJ/NmwN1zwNstBu9Muoe0XoJY8oT/p8k9gv3A1tlDgXNOrlN+uwKD6xAVwhB48VmmNqtu68t6ZpXn8nEC3lg+gJD8ambDgPKVYig4gRNKBQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770032776; c=relaxed/simple; bh=jPm6BjDd61B05/hcvtCJNk1OntONvb4+WoR4F+Z/gj8=; h=Message-ID:Subject:From:To:CC:Date:In-Reply-To:References: Content-Type:MIME-Version; b=JUF6Z/Vam1MjIT9+Fw2s5JODZe7tK1ADYW5STABcsWSjcVLDB4BzCfalJcpuQtHPw9pU8F7P44NMrSnVB5LE7D4DJTeE3fn9Z2xLWC3E/cZx4h28BdDYw7A+xG2RX/g78SMhlct8vfiy1PwTvSXU09pPBZQ6HxO6C5PgY7NE9cY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=uUqpZLrO; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="uUqpZLrO" X-UUID: c30f68f0002c11f185319dbc3099e8fb-20260202 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=jPm6BjDd61B05/hcvtCJNk1OntONvb4+WoR4F+Z/gj8=; b=uUqpZLrO/g5AD1vpXB1qxKTIBGEYnZhrf4IRYHqDOCNP8sFdXNL/l66eJ026LHAEIhvi+OMZHMY8nymuMhIMZvLTAy5mzKRYskUAadWKNFV3CGU7NoXncYM/73U8MYo0ynTtg0cboPcX97QRd2J9+j7viMIheGPKtzN5evk4zLk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.11,REQID:05145afd-e8e4-43c9-a0fc-194a94b97dba,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:89c9d04,CLOUDID:faa27e7a-8c8a-4fc4-88c0-3556e7711556,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:80|81|82|83|102|836|888|898,TC:-5,Co ntent:0|15|50,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL :0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: c30f68f0002c11f185319dbc3099e8fb-20260202 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 750171615; Mon, 02 Feb 2026 19:46:07 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS09N2.mediatek.inc (172.21.101.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 2 Feb 2026 19:46:06 +0800 Received: from [10.233.130.16] (10.233.130.16) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Mon, 2 Feb 2026 19:46:06 +0800 Message-ID: <1d327fad53675a7193c81e9c0ae2e91c2aa4e74d.camel@mediatek.com> Subject: Re: [PATCH 1/5] wifi: mt76: fix potential deadlock caused by rx_lock From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Money Wang , linux-mediatek Date: Mon, 2 Feb 2026 19:46:06 +0800 In-Reply-To: References: <20260202075311.365673-1-shayne.chen@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MTK: N On Mon, 2026-02-02 at 09:52 +0100, Felix Fietkau wrote: > On 02.02.26 08:53, Shayne Chen wrote: > > A deadlock will occur if both of the following conditions are met, > > because they each attempt to acquire the rx_lock: > > - mac80211 receives an unexpected BAR control frame, which triggers > > =C2=A0=C2=A0 a BA deletion > > - A transmission failure happens due to an abnormality in DMA > >=20 > > Since ieee80211_tx_status_ext() is primarily used to address AQL > > issues, > > avoid potential deadlocks by restricting calls to > > ieee80211_tx_status_ext > > only for data frames. >=20 > First of all, ieee80211_tx_status_ext is not primarily used to > address=20 > AQL, ieee80211_free_txskb handles it as well. The reason for it is tx > status handling, e.g. for management frames sent by hostapd that > require=20 > an ACK status report, so limiting the status calls for data frames > seems=20 > wrong to me. >=20 > I don't really understand how the scenario you're describing leads to > a=20 > deadlock. From my understanding, if something in the mac80211 rx path > triggers a tx, it should end up calling mt76_tx(), which queues the > skb=20 > to wcid->tx_list and triggers the tx worker. So the actual dma tx > callls=20 > are expected to come from the worker kthread. > How does this lead to a deadlock on rx_lock? Hi Felix, Thanks for the explanation. I've re-checked the codebase used by the customer when the issue was reported, and I found that the wcid->tx_list structure was not present in that version. So yes, this problem should not occur in the current codebase. Will drop this patch in v2. Thanks, Shayne >=20 > - Felix