From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 0837835F5E1 for ; Fri, 31 Jul 2026 08:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785484980; cv=none; b=fcLIHBQaBdLPksGK/k5dY78gAjBHxbhWSgI1kRaHfxvGLK7ltfQS7hnTVHtk951VfcC7Sjr742SWr0RJFhTyzdZ35ov7KLsAZHdTI+3CK+/Yj+141cRQe1wMIvHZ5eUV8fyUbCHyTbc8YfXYcJo1JwsF7n/rbMbj83/Sen0t9sM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785484980; c=relaxed/simple; bh=+kKDSm/IS6w/8O30n7a4YMhBSvMMzvPigmvj0yDJrXE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y3fONI8LE/q+nKeCcOutLi0kaLWF5v6tdxg1s25bPJB3Rs1yql41yS4jQmqd7QS6lxQ2e7HbJr8nXcTIPytGuUvMgK4r3OpODQmZvvmvfao8qLRTnwMSh/xBgeYIR/oCzr+Y9ERHCpq+RlFPsKEuXhb3U5H5tJ7kj5AhS5QbPnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GohOw9VZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VMBm5XqV; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GohOw9VZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VMBm5XqV" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66V7w4jo3884698 for ; Fri, 31 Jul 2026 08:02:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= j71HTHFsicwBuXZTYdByExT5ln5C9xVWv9Y1JZNj1l8=; b=GohOw9VZOtV2RV75 JXiptDZ8Vgo1ykZ9OGSdjdAymeEvnmNyTXLvBQHuJekzA5VOVpuXZA934DqtveJR Gj+ni2LqbEdEnjyODEuFB61qnB/sTAG/eOlYMLwDcY+KRd78rRGkTxBwlhdN6VsP +Apv3InqZcUjxoJQHhYuoaLEL6XxCFxD4Hp/3gLG6VjTxByd2Nns+jpQIHBd0FYF TcmlNGt3gJ+jhHYwlM+fB6rGmgcvB7r13E7+3nsgzg3mAhpvh4oWwqUZPrNQlMij Xirp/+BjQV0uxAzzP+q4Ssqxyrb8y7eUSgb6EuAS6tGahGoEFEOyzoXOHxE4yP32 22YsoA== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4frqabg3um-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 31 Jul 2026 08:02:58 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cb6cf425e86so848714a12.1 for ; Fri, 31 Jul 2026 01:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785484977; x=1786089777; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=j71HTHFsicwBuXZTYdByExT5ln5C9xVWv9Y1JZNj1l8=; b=VMBm5XqVhCadVOqsORX+4YSVkE/oNeOSfRtLy10F684JMUQSC6nxA8PaCvQEIVRRwH 8Q2heDSSOroDtP0fm2UPGNjP2vq3xHzAwqsShAAJbKmrYyKMiTs/mH84PSIfU2nm07SD MUtfuB9YtnIXkxSKO1uBqH1GVdNePFgE14Uyq3qmFodJjAcfhJV5dHGHY9f04hMARCYz pC91NW/A9PNLMWSUxpQAMCVJl0l57aKuX1mmxNZqGZJu7Z80GJLfEY9gwnIKlWTPjEyv pgYLaCL1upeV9QwRDmIab0YsKgtUx2dqfU6/0Cz6++NF/ZikMR6bXRI8c5X5l2PVOkrD O+jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785484977; x=1786089777; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=j71HTHFsicwBuXZTYdByExT5ln5C9xVWv9Y1JZNj1l8=; b=eKgrV5JWRfdWfRt6K9j7u0/3pr+10JiJ418BBRO43OGFlk/0fe5iW7L0nmt0THFYwc bqcrgNAmjTl+lZU6vy4gGGHZSjtqPuuNXrEIw6EdsgCxju23XOCsmXtAfX34Gy1DoxAo Sevi7MrLtywV5CQ7EFf44eU4+SVylj7dREjCM0PXrT/H13zneywcaWzZarjOtgK+5G1d 7tS+FVPvFAIkShoZOub600POZeZYN5QDS6DzxLdi2t4VHzyIG5WmJGac3VFVcTedIrpE 8vlpgkhcXL0lhw3/pnwcCSuoVNEpoP/w3xMan9NEVlbo476ka9/Kj5Tt2o5QuQs1aABG DV9A== X-Forwarded-Encrypted: i=1; AHgh+Rqkts/jXKsWG2h0UhH5HFGjDyNh5Ene91Kl/M3EgtO+AyLYPrTp0TnzBEvGPxz5y+sbqoS5CQ7Bq2owl4w=@vger.kernel.org X-Gm-Message-State: AOJu0Yyiy4zFHjX7QebJYjCm5pH+YQTokTzN42RGNbz2io9/DF/OYx7W qz1D/D9u8nfAUl3QhHFGcQxA/WF1IS036E9f/wJPqoXPJlAUY20YY5LVbFI/wGncXOh1l1YiYK3 K6ZEtboGZCgn+UnhTJF62SIl/WIyj+27nda1+9MQb28aeq3tsh9JhZY5YEqh9bC/lp6v3hhYsNW E= X-Gm-Gg: AR+sD11NjgVluVPKqkvw1Eat7YdgeARlL8Fg+ERSUyCn+4E5UO8Z6ardt8a4fjRFqx8 VP09mHxmfRIhuoPKG/anIj8hRxmCNFp368maYxtltCA7RQBwLY+njZbvCMesypGWy9atE1A7buo S8IIbMJlyjufbWKivJ87qdOp/uVOnzxvQrObiaQ1InJk8rH4i4hI/6Fbw2WEEX04kuPESPLO+mK 6ud9yRBPeXDtoDJyicM53u+3c3wZGwXW/xddxkGp67QgEcJCO3D7MNwkrnidvnuLgZKCvd048St N5zntILJ7vs+7NGHRJly8SIxH0OgKptWMCBFvYZdwetlexV3mpXY9dX38C1MyaUlfoBCY30wZ3D 5Qd4PrYSPTPTbC3rlAVRtx+vbKm/GzYsoF2ET4L6JWChP/gIMEAP2DHcbNwhBR8u/KnMB31ZzmQ == X-Received: by 2002:a05:6a20:4324:b0:3c6:3c5b:fe55 with SMTP id adf61e73a8af0-3c91b362e6dmr931126637.52.1785484977215; Fri, 31 Jul 2026 01:02:57 -0700 (PDT) X-Received: by 2002:a05:6a20:4324:b0:3c6:3c5b:fe55 with SMTP id adf61e73a8af0-3c91b362e6dmr931087637.52.1785484976644; Fri, 31 Jul 2026 01:02:56 -0700 (PDT) Received: from [10.133.33.123] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe3963daa7sm257353a12.5.2026.07.31.01.02.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jul 2026 01:02:56 -0700 (PDT) Message-ID: Date: Fri, 31 Jul 2026 16:02:52 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/5] wifi: ath12k: fix MLO dp_peer ID desync with firmware To: Jose Ignacio Tornos Martinez , jjohnson@kernel.org Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260727162748.963275-1-jtornosm@redhat.com> <20260727162748.963275-4-jtornosm@redhat.com> From: Baochen Qiang Content-Language: en-US In-Reply-To: <20260727162748.963275-4-jtornosm@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=BN+DalQG c=1 sm=1 tr=0 ts=6a6c56b2 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ZiB7qzRtAR3mgBQmdTAA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDA1NyBTYWx0ZWRfX4Mjl2FYHKKFj B8g+GyFUmY7+ugeiBtHBkEswdrSp947dTFXtwT+M8HHKvuvoCM7USCsN7LZ59lQjYcfCgipErx1 mFhviFpWQ4xpzdJomM0cai9l/RPMaa4= X-Proofpoint-ORIG-GUID: EvaNrlhyi3ou3AreTZ8wW9E7tFQRkyWL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDA1NyBTYWx0ZWRfX09XFfuKtIPq3 QjwuT5B/ileoTqA0v8yvI6AButGc6Wa3351+FZjBbk1slubDsOpwG11HOyptf3GdzjEInJjfm+e I7shektlgdOABMSobX1KVxkyfS5enPJwBL5vNhXQrklLsa8XAdxYUYO4l1ClDrw/w8QQXibIkWA WN1w3vK912I9s3iQ+Mq2xQqtEEpxOSEnrzmnlw7+g4EslhgqIYXfCP3YSokHa3dtBlTUawM/G4U /7ydwERGYekbzDMo9NyluZ1jtNAa9DVqrvEJVXo0sGvepboU5A0/atDjuoGgRV2DaDb32BUWPbI 6BOR+4Sher1aKJ3pwsQEwdoNqIza7RdqHoEERAYkvodAHazFCmWKxD3H/oaPhAUXUVi4GfA7RYY pIkuT10q9ujOiTTjiVRLjBsqykP5FxG7BR3T0xyePD6RqMjIk8zyfQkYnH1IlQI5149zHo1Heha bYDDI3FBk7/c2YGVacQ== X-Proofpoint-GUID: EvaNrlhyi3ou3AreTZ8wW9E7tFQRkyWL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-31_03,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607310057 On 7/28/2026 12:27 AM, Jose Ignacio Tornos Martinez wrote: > TX completions fail with: > "dp_tx: failed to find the peer with peer_id " > > where is an ML peer_id (host-assigned ml_peer_id OR'd with > ATH12K_PEER_ML_ID_VALID, BIT(13) = 0x2000). This happens because > the firmware uses an internal monotonic counter for ML peer IDs that > does not necessarily match the host-assigned ml_peer_id. The desync > has been observed in normal MLO operation and is particularly > reproducible after firmware crash recovery, where the > create-delete-create cycle guarantees the firmware increments its > internal counter. > > Currently, ath12k_dp_peer_create() stores the host-assigned > ml_peer_id (with ATH12K_PEER_ML_ID_VALID OR'd in) as dp_peer->peer_id > and immediately populates the dp_peers[] RCU lookup table at that > index. When the firmware later uses a different peer_id in its data > path descriptors, ath12k_dp_peer_find_by_peerid() looks up the wrong > index and returns NULL, causing the "failed to find peer" error on > every TX completion. > > Fix this by initializing dp_peer->peer_id to ATH12K_DP_PEER_ID_INVALID > for MLO peers at creation time, deferring the dp_peers[] RCU table > population. When ath12k_dp_peer_find_by_peerid() encounters a lookup > miss for an ML peer_id (one with ATH12K_PEER_ML_ID_VALID set), it > walks dp_peers_list for an MLO peer whose peer_id is still INVALID, > syncs peer_id from the firmware's actual value, and populates the > dp_peers[] table. This lazy sync approach ensures the host always uses > the firmware's real ML peer_id regardless of any internal firmware > counter behavior. > > Guard the dp_peers[] RCU table clear in ath12k_dp_peer_delete() and > ath12k_mac_dp_peer_cleanup() against ATH12K_DP_PEER_ID_INVALID to > avoid clearing uninitialized slots. Replace per-peer clear_bit() with > bitmap_zero() in ath12k_mac_dp_peer_cleanup() to avoid out-of-bounds > access when peer_id has not been synced yet. > this is a known issue and has been fixed by [1], and that fix has landed in ath.git [2], please try. [1] https://lore.kernel.org/ath12k/20260720-ath12k-fw-allocated-ml-peer-id-v2-0-630632758a80@oss.qualcomm.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/