From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 671F135E95A for ; Tue, 14 Apr 2026 07:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150400; cv=none; b=L+b6EiEQoTRNWmy2Zod35hCUBMsdInB+BoU1gYhLPtTCRVgTiuMzGQtJz/fRShhNfcPTw738xjSCuFUwSd0qa9ltGM8mpBZRkJxkm7YxLg+7qiTER74Ye6cYcXKQ8wAjydnGj+18cVm0yEppiCWtTD9vzZ1AEzv4BOSjbUdaG64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150400; c=relaxed/simple; bh=G1W9A9uCb8lK7c30w1M2HPrNk3TrsUOno1j3S8BH1PE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PnCSpBp4S9mrFwnCMhjTnVhiAMN4D7x0/34xgbnKeQhaGvs/Mmg3v1VEUGqaXx/84g6+5+A2hnyapu4ofjvwLpoa63bdZhg/J534UMA/yCOBJqSH262LMTioWDhF36iX/WeWHZNMDC8kAb4ANnWOCSVE6zlp1xxJxDl8XPBwG9M= 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=R6lCWZri; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Js7y4XEJ; arc=none smtp.client-ip=205.220.180.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="R6lCWZri"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Js7y4XEJ" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63E6XibA3681483 for ; Tue, 14 Apr 2026 07:06:38 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= dBIASGVnE0aFQr/a2JqCXpFWZWEJCZAiv8D1/xC8KcU=; b=R6lCWZriAbPOeJH8 Wy12cvaj6HVWnB+TL8YNy3fq02sW2ZsYZo/XLTKGGwBztPnTnVuc+CWP5+iwfUbc 5szWkXz66iDZCQqbdL11c6JTS0ZE6pEh5pgvt1oN3q0ks2eA1MmoV6g9fWyt/NGr 4ge5EldxGu1Vc4Djgnx+AT9f+10Xliz/2uT+viZEsaRgBOqTXJ7ouN8REpsxjoJw HErWzRsjx3Z/wWZFV6UUakJQL/Iwp4TJnayQk+iLgeQvHXOkvg8wq1rdUlaXOAZW P/qEQU2a6aqJbEwxIWfmA5fF52O9uNc+IbNTpbnVa3epSuXorLuPm0QkvPl4/ErO Vl9hCg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dh87d1fpy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 14 Apr 2026 07:06:38 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2b458add85aso22026485ad.2 for ; Tue, 14 Apr 2026 00:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776150397; x=1776755197; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=dBIASGVnE0aFQr/a2JqCXpFWZWEJCZAiv8D1/xC8KcU=; b=Js7y4XEJ5XS2m8eEXfpWMsYhWyZfmjnozyYueRDeZu91SksAUtO65V8UO4jIt1eFqa I4zKDaoGjPVLZnsykqTsXCm+z3ap+ldS7mKJlEhYiihqk65nLMDN3oLMkMMTQH+aFOva lkLxwpSusgwqwipaDPY1xrpmaaQB0WA9SAjroMJtRgVMF3v5OvMzzxLClwvtnnOx/MiQ oZ2A+MhTG2G72JYNqpzg3CScPbkkh9NfPCs+oWFsqWTlhdpMYoDAr7yiIZC+VohkU5Pk 61AV7pWgypdcH23fqjvbXYdjAzn7amwQ+fFB52r/TjvQJEvvIphgubYpcd2DDYncEBrU HdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776150397; x=1776755197; h=content-transfer-encoding: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; bh=dBIASGVnE0aFQr/a2JqCXpFWZWEJCZAiv8D1/xC8KcU=; b=U553M1bQx3TwTCd5qrUM2Jk2Mcv37qJoRES3X+c6h1OmQ41SfFXYU3qv7AlIGa1ror jBdNcaNH5Q9kclDci5YZX+KWqyF1yCI0UxIM28BkpopKZT+RPYctb7W6BbAzpW0wCb8K fzfOTPmElJc7pgWuaHVkHu+mYERaObTy/UneZELWeRkxSzfhUlbe32khvm4bQuZ6iQyv 5Sgrw+2fA3Xe5YbXtvfzH2F1ObAZa1SyaXxKgNVYf331bWr6BtnsX+vlOPNBtIFlIgZx OC+2/D+YkmKvVzlEzoB6qXjNDFxBbzDJ9SAdi5oPXa3IBYPkajQhCCT9nmO4Nz4dp47u BW9A== X-Forwarded-Encrypted: i=1; AFNElJ9WqAFzAP/dRc/UMPh1aMnLhWP7MXzlCHty9U4GAQQr3wR2j6KDbIkyb19CkI2GyuJSCABNqhxf9fGsel8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxp9RVFc1PqwTVtsAXBHwtBpXXeVo5uVoUNbaRSEfpnR4gHfxzi wJVB6w6iK3JOeL5m5qVgfWdeI9R1JkN+LC+gcT+tsXxQEQgF+sNzUduzQE61c/HtYvMgY5oHVvJ O8wmLEdc4Xl0FxtctiKn3369eVVi1Dy6RCEwzJx/ceuPhxLwq69UV20Kk2y+PrWpSC9s= X-Gm-Gg: AeBDies+XizEVuvG2dhN/U/UqjiPAks3wMr2JJweJX6NWGIEtgALCbu4jJePUDGg1Nd V7j0q6249lMRAefyWdO6CE7d4sDL7cr5vdnMuic5yjdd4NM3xpXDfc0ifsaRlAQisUvZRanfZPT Sh37pG/ztJy2+p4rylG+FGOyneGpgSbQ1CdMTGum2WwnFp1+1eFAa1UtVCAH4im49bk4dTqTHrs OfAIafTBQv2XQpchH2bPhSZvspO0fwIwJ9OOImdADuMuarhxJNZEvldQcZL1dDvyexvgB/ZccPg pkD5KsyBDGdB6BkaPj7pRQ2paqCnHyQG8drSscHYHi6d+5McWZH2zR2pS3rz+qnU/TWJdCh/baB wBg/7mCh1iacXw0egK1AoF32f3zxtW90Q+Z6aQJwP9MzBS6xKk4OirKmONlb2Rg9NqoWlPegCvT rBiICPqf1B1RP4KrSlal2rgR0cyBB3+w== X-Received: by 2002:a17:903:2f08:b0:2b2:4d90:98bd with SMTP id d9443c01a7336-2b2d5a64ef6mr163953885ad.44.1776150397193; Tue, 14 Apr 2026 00:06:37 -0700 (PDT) X-Received: by 2002:a17:903:2f08:b0:2b2:4d90:98bd with SMTP id d9443c01a7336-2b2d5a64ef6mr163953605ad.44.1776150396698; Tue, 14 Apr 2026 00:06:36 -0700 (PDT) Received: from [10.133.33.118] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4f431c3sm131161045ad.79.2026.04.14.00.06.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2026 00:06:36 -0700 (PDT) Message-ID: <7dbc3836-c42c-4cbb-a50a-011d82a0ee81@oss.qualcomm.com> Date: Tue, 14 Apr 2026 15:06:33 +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] ath11k: workaround firmware bug where peer_id=0 To: Matthew Leach , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20260326-ath11k-null-peerid-workaround-v1-1-0c2fd53202f8@collabora.com> <87h5pxlpg4.fsf@collabora.com> From: Baochen Qiang Content-Language: en-US In-Reply-To: <87h5pxlpg4.fsf@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE0MDA2NSBTYWx0ZWRfX2rK4ekMOmL6t SOrLxzJf7TQxGf2kxQtJqpT5lrvMwrPolzz0D4CUJbMB1PIb56cCA8e9GF72HMLGxPX72J9jebB 4X2Ei/Ix7xUZK/3w30R7JJRQV4Y4aywm1WwQM2/rNvGYO0yKGidv2UaKEM7vcpOGFDNdnDpszUj idBo5xUXWipyOeYI8nDDTiGP94LaSuasuFlvxAGIDId/uQyV0GwNR/0uqRCRGnSCKrsDUtlSUnA BU2NgzNgkWjJePhTp3JyyDW1aqqLhHzWhAszcJhiDY+LSGVnb1mnOyoc1fYqVd5JQt1SpufPqAF SYo+pHIDv2o39ETD1T08W5c2bL+bjBCcTdugR3/7roqjqSbBTqo+5vpMa6S0ssncPY+P0JPpCgo 93Wq1xwsSJ5B4AC1Jy7Ij0okw0qJPOTzbfujgqKLPGnNGXg7Vgb6jsbIqUSMLr49NONcxVAbDT9 1mMo5rbwaRwvsKLAgFA== X-Authority-Analysis: v=2.4 cv=N+8Z0W9B c=1 sm=1 tr=0 ts=69dde77e cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=QX4gbG5DAAAA:8 a=SC-YAkXmNWsgAJuF7_sA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-GUID: Pc1MWMyd8C1_AbW7ns5S3A9q3S0ZxfKr X-Proofpoint-ORIG-GUID: Pc1MWMyd8C1_AbW7ns5S3A9q3S0ZxfKr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-14_01,2026-04-13_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604140065 On 3/30/2026 3:57 PM, Matthew Leach wrote: > Hello, > > Matthew Leach writes: > >> This patch caches the peer enctype during the MSDU processing loop, >> caching it on the first AMSDU sub-frame (is_first_msdu=1 >> is_last_msdu=0) and setting the correct enctype for any subsequent >> sub-MSDUs. > > I've been looking at creating a patch that addresses the root cause, > rather than patching incoming frame's flags: > > --8<---------------cut here---------------start------------->8--- > diff --git a/drivers/net/wireless/ath/ath11k/peer.c b/drivers/net/wireless/ath/ath11k/peer.c > index 6d0126c39301..98348ccfdfbe 100644 > --- a/drivers/net/wireless/ath/ath11k/peer.c > +++ b/drivers/net/wireless/ath/ath11k/peer.c > @@ -347,7 +347,7 @@ static int __ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) > return 0; > } > > -int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr) > +int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr) > { > int ret; > > @@ -372,7 +372,7 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, > { > struct ath11k_peer *peer; > struct ath11k_sta *arsta; > - int ret, fbret; > + int ret, fbret, retries = 3; > > lockdep_assert_held(&ar->conf_mutex); > > @@ -400,6 +400,8 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, > spin_unlock_bh(&ar->ab->base_lock); > mutex_unlock(&ar->ab->tbl_mtx_lock); > > +retry: > + > ret = ath11k_wmi_send_peer_create_cmd(ar, param); > if (ret) { > ath11k_warn(ar->ab, > @@ -427,6 +429,18 @@ int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, > goto cleanup; > } > > + if (!peer->peer_id) { > + if (retries--) { > + spin_unlock_bh(&ar->ab->base_lock); > + mutex_unlock(&ar->ab->tbl_mtx_lock); > + ath11k_peer_delete(ar, param->vdev_id, param->peer_addr); > + goto retry; > + } else { > + ath11k_warn(ar->ab, "Null peer workaround failed for peer %pM, adding anyway", > + param->peer_addr); > + } > + } > + > ret = ath11k_peer_rhash_add(ar->ab, peer); > if (ret) { > spin_unlock_bh(&ar->ab->base_lock); > diff --git a/drivers/net/wireless/ath/ath11k/peer.h b/drivers/net/wireless/ath/ath11k/peer.h > index 3ad2f3355b14..6325c4d157c7 100644 > --- a/drivers/net/wireless/ath/ath11k/peer.h > +++ b/drivers/net/wireless/ath/ath11k/peer.h > @@ -47,7 +47,7 @@ struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, > const u8 *addr); > struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id); > void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id); > -int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr); > +int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, const u8 *addr); > int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif, > struct ieee80211_sta *sta, struct peer_create_params *param); > int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id, > --8<---------------cut here---------------end--------------->8--- > > This patch detects the error condition at the point where a peer map > request reply is received from the firmware. If the firmware maps with > peer_id=0, we request that the firmware unmap that peer and map again, > hoping it selects a peer_id!=0. We attempt this up to three times, at > which point we give up and let the peer be mapped with an ID of 0. > > This patch addresses the root cause, but I think it's more invasive. I'd > appreciate some comments as to which approach upstream would prefer. If > the preference is for the above, I'll send out a v2. for chips like QCA2066 and WCN6855 etc 0 is a valid value, however this is not for chips like QCN9074 etc. so a possible fix would be to add hardware ops based on chips: for QCN9074 we keep the existing validation on 0 in the ops, while for QCA2066 the ops is a null func. Or even simper we can remove the validation for all chips. > > Regards,