From patchwork Tue Feb 4 04:23:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958585 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 0BC5E183CD9 for ; Tue, 4 Feb 2025 04:24:01 +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=1738643044; cv=none; b=lkBKLrsNKxxaVUF7il6hdd7YqJc7K18JVuCMZ7MFBSqM2mAVQH9vxU1Qlp7rpw/cLoSpgam265KgE++fUyJL5q/G1/ioj5zuezVFpqySvoDR5FH5xa/KgPlcafKoKktXBGxqH9aeFz1dqo0PxuqGBnPt7EWHbsqKMfbdCOVQhkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643044; c=relaxed/simple; bh=nxkKWfEGElnDHDYpMY9QNZVpKp9xiqkF73rcZPqYbkw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IwRrdoD1voxlaeo6ubWUiERSEIbmbpIS0Muu7tD9Q0mTlaG3SPFBDQcHkttkHL1RlG0mmX7LtvUdiYaVOlQw8w1+25drEOfgojdPwdBFIsq8aFTNySof5HCTk5Z68qWkJiErtWE8Cxz+RKxlkng2uq+9t9h4DlQSUm/7YlVoJbI= 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=cJJeoPzB; 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="cJJeoPzB" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513LckuX029122 for ; Tue, 4 Feb 2025 04:24:01 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= OpQ1wqnVdVlF+fVFCGFn5AWkm1b36ebsa+hYlEcKIWc=; b=cJJeoPzBNjKrftGH e77cEcWJlKbXseJM0rsexHWHmuVrGijHC69cI5zgeldWhok9wneSqYmFr8aBCTg9 WNekBcAs3kIzFks+yNQiK7NZPZ7H5IFPdOY2YCVF7T+x5q6s1KTbDyaERN6JI7og jr8ZK4FrSE1PIQnuSxaVQQLOC+gXCk88qNQMk7Q9Qnhw46RVq4kMfPH/E0nRl+pH gjlTjJVBGvORNpy4Vcj144hsKdQhAPxyKzJ+68vQqJYmDL8nfQw9RzGBVZK3WilI 1IfJAMsZVHVlCK+m8wDpTvvBhAAZVjygfYjxzwO3gl4YBKNiX0Ov3qvvH+9vrvBd 0z5R1w== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k5w5rnb6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:01 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2ee5616e986so14583489a91.2 for ; Mon, 03 Feb 2025 20:24:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643040; x=1739247840; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OpQ1wqnVdVlF+fVFCGFn5AWkm1b36ebsa+hYlEcKIWc=; b=WwMENKBntEgNFC56cXrkaWKY9ViiaxFOl77YY6u9Zn3a/Foh4qUWYufRKSDzEAkQcb hFik96iVR6AbL/a3N5SSK028UcxBUh9x3qxetGBufvHwzN2DU0Kpk9XJXdW2YpgRWrmE mQoh0BTzf2sFfR3fzJW/Nzyq4/Cq9ibv4xHM4HiD6yUqzJLgr/oiF6xKfaq9+ddpHoEi pIlrNmYYiIKO44YzdMztBQiO829M5RBLNzO8PDB0r3m81Rn4b7AA+G+5JEgHwE9s8mS2 AiPL1oon0ays3rACLI8BcbEq9wgM0C2tFBzOOhXK5m9vIlZCPVKunyi6huQa/LfGLTwT 3QPw== X-Gm-Message-State: AOJu0YymhmTOeNXvVRqXBdTPqbmoHlkDB0gruGNb+QOIi4Uytsu3vBZK wboAhzQdbwb4tKpfZe3o/aFm3Ivo9MvGtelJibSsxO3/f9qX2QptzkCcURkxvJgXojXizEpyGJ7 2qMAbSwd9FxosjDl7BFw5J5AlXxp5FnOdaYP8gRDZAG9YBb0zPO2OkQTUlnCCOuXZMA== X-Gm-Gg: ASbGncsIO1gUXMFghyVDYs3g8DKwl9cVlzvwyu728PJLU2vX8tdXFk5euLzw6hRWQ7a Dxjlb+e/H3r5/XPAboTdJW7MIeixw/1OhQ1zZEAhwob6pHplzhxJA6veb6X0BQUMazdjcvB9QYC XI5fchEVEn5awJ8VkoD39o+JiWFJeTn27fXStWBto5ddNncXkLy5mZvtKw4X7yHoTm7JzK1DShw 46dEw8Ovyy90H7nBGS7lVcrGLrLfKOC2uOWHJNr4BypVK8XXlpqrPUocTBGgB6FCaM1gzk7xChB EiqPKxYYVWLoPcCj43yeDr0VzJ/pcyI74Kqvwx7JB81xBT+lVZMqhuX0O3EWmW3NFwtN7CHVC2V B/5zjEmZqMQfU+g8N6B3QIRu+3qX/vw== X-Received: by 2002:a05:6a21:498:b0:1e1:a647:8a54 with SMTP id adf61e73a8af0-1ed7a640d32mr38481745637.20.1738643040158; Mon, 03 Feb 2025 20:24:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOQ7Av7ChIT5Sfd9Y3FCRFBK0BvMkRxWFgYagW1fOXHmqJfop4BkVtnVNZpzYrIs3wnrErtA== X-Received: by 2002:a05:6a21:498:b0:1e1:a647:8a54 with SMTP id adf61e73a8af0-1ed7a640d32mr38481712637.20.1738643039750; Mon, 03 Feb 2025 20:23:59 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:23:59 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:41 +0530 Subject: [PATCH 1/8] wifi: ath12k: eliminate redundant debug mask check in ath12k_dbg() Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-1-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: xdegzXJWtTkSTRrFvtmKiV58hPVyHz54 X-Proofpoint-ORIG-GUID: xdegzXJWtTkSTRrFvtmKiV58hPVyHz54 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=971 spamscore=0 clxscore=1015 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 The current implementation includes a debug mask check both in the macro expansion and in the function __ath12k_dbg(), which is unnecessary. Simplify the code by removing the redundant check from the helper function __ath12k_dbg(). While at this, rename the first argument in macro from ar to ab since the first argument name in the function __ath12k_dbg() is ab. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/debug.c | 5 ++--- drivers/net/wireless/ath/ath12k/debug.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/debug.c b/drivers/net/wireless/ath/ath12k/debug.c index ff6eaeafa092cd12e572430ed0f1c7aa21b78377..fd9796b5ad3b9feea5c7e78e8a88d361049e08df 100644 --- a/drivers/net/wireless/ath/ath12k/debug.c +++ b/drivers/net/wireless/ath/ath12k/debug.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -63,8 +63,7 @@ void __ath12k_dbg(struct ath12k_base *ab, enum ath12k_debug_mask mask, vaf.fmt = fmt; vaf.va = &args; - if (ath12k_debug_mask & mask) - dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); + dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); /* TODO: trace log */ diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless/ath/ath12k/debug.h index 0aa7c8ccb14ccb9de28a78ca3d2b2a7bf6e481c1..ba0e4da3bb761a49fb81e3efcb61557df8ad1942 100644 --- a/drivers/net/wireless/ath/ath12k/debug.h +++ b/drivers/net/wireless/ath/ath12k/debug.h @@ -62,11 +62,11 @@ static inline void ath12k_dbg_dump(struct ath12k_base *ab, } #endif /* CONFIG_ATH12K_DEBUG */ -#define ath12k_dbg(ar, dbg_mask, fmt, ...) \ +#define ath12k_dbg(ab, dbg_mask, fmt, ...) \ do { \ typeof(dbg_mask) mask = (dbg_mask); \ if (ath12k_debug_mask & mask) \ - __ath12k_dbg(ar, mask, fmt, ##__VA_ARGS__); \ + __ath12k_dbg(ab, mask, fmt, ##__VA_ARGS__); \ } while (0) #endif /* _ATH12K_DEBUG_H_ */ From patchwork Tue Feb 4 04:23:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958586 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 4F1CA19E83E for ; Tue, 4 Feb 2025 04:24:04 +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=1738643045; cv=none; b=QVvB/mC+REf+V5qh0dSMegzP5nTc5MzD+HbYPMYcLsEFOytRdFC1CCGT6DgA4U2vmTa/pxSh/iVuDv0q5zJewOz1pGoZ6dew/MzL3vhwZO8ciuwr+C89zIpNc3kXOpPo8tuDePXzIaUXmcyY+c3IKqknF2n3x/p0F2A3aMSqDdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643045; c=relaxed/simple; bh=0cHLir5zfTlkMC+MP5DQJQztPNl5cmEGqQ2sJzIMWiA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hv7YsZcYxX6TtNrmch6iAvXxDV1g0QNxY8B6yZ5IcjBiosVAf+8VEbA14QGKsqwEeFHNomvz/MmciHLWScbeM2bBUyyjjH7idHLxp4P2dO7LXwYuBD1BjR8zU2lGbFGPnglBFRxN/sxkiBmVLALCd0ctufA3DXN8m/xU42e4So4= 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=DgqKHV0h; 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="DgqKHV0h" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513LdOwE030234 for ; Tue, 4 Feb 2025 04:24:03 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= tuQlDAC1uyRPPd0Q4t6t3ezvkbclNHfIbx+5IkTBwug=; b=DgqKHV0h1jrfEX/d rh8PTezs0abJW+KW4BAl/Sg6Rd70DaUtuAQJJ94j/stW8Mfl/FZ0IgPxFcrKaHzQ VRK5aJVgD3QDot8LFoxaOKGxRZguloKI3GwkP/HQVG2dkhKU5axEyvO15FBsqNIW BMSyXlmeclJtjLltsSZWD9tBI19Wb7YRhxH38A+tYuh/j1ZO6i0oUvt2ebEVHCGw jmEZNHWEm0pjTefi9as/3ve4BcneeFrEjJbucdoK2zDoPBiDnUOf11wygoUuL14c HsYAEniao7nSSa+HnkMuo23Nb1emRYXtGwvPvDA8/C3UupCSC8g/wUmsaaVOyxld jp0jAA== 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 44k5w5rnbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:03 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-21f075a828bso1970565ad.2 for ; Mon, 03 Feb 2025 20:24:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643042; x=1739247842; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tuQlDAC1uyRPPd0Q4t6t3ezvkbclNHfIbx+5IkTBwug=; b=DW80C0J3i7fpy4wryVJm4TJGEfJEkjp1p71mZS1sypiuUpHADDAigtX1L8Hik2QpAY xdsfg8UosT7xYyzAmB6wTyqFnoUJvUEp5JCnWMrRaSUIYwKEqhOLg2GEr+Z2XfIPUXZJ XTj3+nGIMXjYq3C8xvPVvwq2S+EBVeFdQJYJ4avEwXziAiDSpBElfEWS+DIoCLZY2rAj CjSeDk4dwIky6IzAYCwvB/oDl32JuD1h1ZBgZYbFEKSg0EeAn6RgkggvV/quUrtAyEVE Txf0Mjp10k1fOqXK8WlevKf93lFPPpHTX4uSbfMw6CmYKJp0TqQZXgpOnxKUH9R+n2/5 9/mg== X-Gm-Message-State: AOJu0YwAn35INadrlUiew0mzYooEaJ5xe5FJG54T5J2Q5ZZ1EGD+Q5jk j5WcKELgCwRtoj48phWjflBnx9j3Nuz5gN6sOEB18l0wTgqRbq2MbwH9qx/1prdJtAPnnpEtBHL zBAYbC2YZedWC4Y+VEM7dPNajvfajJVbb86sRSzb5bkZljoiYjKuRzXjYovw3tWEB5Q== X-Gm-Gg: ASbGncvN5CZsh1TCaKM2iDQEgQ4TWC5RBSQgKabYBTRJMD8cFlukS7TP2Fj6oTKBBfs dZT62b/0wNVHaSUwr3Oz32te0QuFbhhhZ8ObkARrPkHTaXg8PueCBM3Ii0nhD983NL7s65rvTGB 9uijt+99+sG5wMH4D+4UB53piRHSYS/xB9KV1FfG5O1Neuxwv/O+xRCGf+gI+8DXoKpkXOR9mhB 3P4qVYJfLCB2n1rwyPHu0cWV6a2xy5vMI+tQ0jRfPZbiXDwzNBi8Ys/5e8yHc5us8cP4dqCTEAx s/EkF/mQP2HwtA4juDtNrDHFu4nSQw1C6w44yxJ6yISWDUPwGt39/TwoVzlDdj5pJbUSVr7RApt kzL9xqvGT0SJUcezviScwV3sZCsr6lg== X-Received: by 2002:a05:6a21:789b:b0:1eb:7da4:305d with SMTP id adf61e73a8af0-1ed7a5fb009mr40651214637.18.1738643042512; Mon, 03 Feb 2025 20:24:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IENPasXrHF+Zec4r5yajnE82atYqWgoMYGed6rRtM6Ksm5rh+X8ASOmkezqS1ZZD4BU6HbCbg== X-Received: by 2002:a05:6a21:789b:b0:1eb:7da4:305d with SMTP id adf61e73a8af0-1ed7a5fb009mr40651164637.18.1738643041997; Mon, 03 Feb 2025 20:24:01 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:01 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:42 +0530 Subject: [PATCH 2/8] wifi: ath12k: introduce ath12k_generic_dbg() Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-2-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: uQlJM7i6LEF9DPIogBNTi-bku5CzjItz X-Proofpoint-ORIG-GUID: uQlJM7i6LEF9DPIogBNTi-bku5CzjItz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=987 spamscore=0 clxscore=1015 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 There might be instances where ath12k_dbg() is needed, but access to struct ath12k_base (ab) is not readily available. To address this, add support to print the debug message using printk() when ab is not present. To avoid the need to explicitly pass NULL each time, introduce a new macro ath12k_generic_dbg() which resolves to ath12k_dbg() with ab set to NULL. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/debug.c | 5 ++++- drivers/net/wireless/ath/ath12k/debug.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/debug.c b/drivers/net/wireless/ath/ath12k/debug.c index fd9796b5ad3b9feea5c7e78e8a88d361049e08df..5ce100cd9a9d16f7fcc2dc0a5522b341ebbff8a3 100644 --- a/drivers/net/wireless/ath/ath12k/debug.c +++ b/drivers/net/wireless/ath/ath12k/debug.c @@ -63,7 +63,10 @@ void __ath12k_dbg(struct ath12k_base *ab, enum ath12k_debug_mask mask, vaf.fmt = fmt; vaf.va = &args; - dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); + if (likely(ab)) + dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); + else + printk(KERN_DEBUG "ath12k: %pV", &vaf); /* TODO: trace log */ diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless/ath/ath12k/debug.h index ba0e4da3bb761a49fb81e3efcb61557df8ad1942..48916e4e1f6014055bbd56d5c71ef9182c78f3b6 100644 --- a/drivers/net/wireless/ath/ath12k/debug.h +++ b/drivers/net/wireless/ath/ath12k/debug.h @@ -69,4 +69,7 @@ do { \ __ath12k_dbg(ab, mask, fmt, ##__VA_ARGS__); \ } while (0) +#define ath12k_generic_dbg(dbg_mask, fmt, ...) \ + ath12k_dbg(NULL, dbg_mask, fmt, ##__VA_ARGS__) + #endif /* _ATH12K_DEBUG_H_ */ From patchwork Tue Feb 4 04:23:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958587 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 AAB891FFC6E for ; Tue, 4 Feb 2025 04:24:06 +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=1738643048; cv=none; b=SovWlMDtfhI0eWiLD6MhdqaITwD9iIqrV6YcbyuTnb2wSO7BTipwdKocx2rnqqRrhSos9+PM7MEZj7i/NEb7lk8s82dFTVoOG6/RvqKFtW//iiUQ6nQP4gSxb1BZOekc7j2JaccKZFV1TaVJcFOqst3DIl8/d/F//nLbR7QkNi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643048; c=relaxed/simple; bh=2EiBqGmjjFeGbES49N7jBmM1eqO4+flMSSconJRqC+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CoeiwcKzQXio7cB23RGuSV4PgmgVQNMVGAG9rBy3QNfSOqBKOfXEN6m0qHrV4mLSBz7HWOLlQB6PyOJhjxWx6UYDb0/oBDZixscSBTVi86ikPs1BUWRlOjv93KO7nTkkyhbPAdioh2aXfEiVUh0bOC930YFTC6clvfG8gZOZvtk= 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=UZwRpsvg; 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="UZwRpsvg" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5141agpM003953 for ; Tue, 4 Feb 2025 04:24:06 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= LqFb+cP0lljHDkbZ2f9V4FJId+CUmhUIBF5/NENtV5o=; b=UZwRpsvgE66B5fsQ aI5KY/1NRCbroSvbKop353xhUyqvyz3kA8R9jQ7BpdLKAfbEpiCZDJ/2Rb4B5fwM jnImr+5dXYuAmrMCRtLUySv4DFzNxvp+8DhF4ukugLnHaQJw9xDjqOQAuKvQHfxn dE4Med1rZcNiqmspA/WtX8ibOdPSXNhxL9qTD4ruj7ZcrN2lPUsqJMckov/8qjBD ++hV9T1rBijs8A8anovBuJLt0aVRhRqBMtfZfd+hRPHX178Ssv7U7DwSuEWvnq/N 1jmPWeruvr7pOq86V38iXXEPlqhUc3dnroFf8WufdBDqAl71OIMiKKC4W7uD6Szw eec33A== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k9cn08rf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:06 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2f129f7717fso10027758a91.0 for ; Mon, 03 Feb 2025 20:24:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643045; x=1739247845; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LqFb+cP0lljHDkbZ2f9V4FJId+CUmhUIBF5/NENtV5o=; b=RyRJ/6jRDGhdr39GjGh3knoTYXXEWfOeHTfM9/+yc2pN4D0izWawkmI+fjdxyNbakm 1sLeZFU8P3bVuIy7wkodcj6qMvPmlbWaEC3lxx335Ep7RSAzosoz4YQN1mWq4qDnlio9 N31CG1Wpm4ZQpciuUaN2+JT4ZfzrKl8uUQqri6mD55vepU/h6lM4zryIrFz5WAeVi6Gp 4irMc999E9D9Jl+8Qpk8ajXEwzRxNaxp8pdjlt/fqLmYvXlbJ17RfV6mWo6jbq2+pEln cO79JrwtoraCMNu16aP9B50bFesiVpaarEeL/1MT9PiNOW2MsbjDjv4uhivVxj6A7ris 3Yzw== X-Gm-Message-State: AOJu0YyzWIE5YErkrTYsMLnzFjqflqtoJdozBw/kSTTiIvG2viOGvlke JlSfc5TBdK13Nre7d0r4tr3PRk2m2DPcMe+Izcr8vgGL0+KWvu3pFME/ELmPeysWis19kvY8Yc5 U0Jvh+LXiYwkxlv6Th2KGYV4MQ5PBQJyaiSS2+UNu75SkwhHZc8t2T5HRSGrDGTsZ0Q== X-Gm-Gg: ASbGnctW3Htti1jTrNS18nLX2I1xtX1CUQo49dykctaHx/X055AbQZGrAUCSoEuXPS+ /OYSciCHrwCBOlFwXDlYCAc2s8wWRyQau7OJzhaPaooGNpgh+kQeXC737/OOoXSMrVx8YgbXd4H t+1Nh8qb0+bChkT2UTmQvbIQwAwsku3zhLYIGwjO4MYEDOyzuS7ZSzc1N0LJ38K3ot77xeC/1IJ aHE9bvSEHmoscvhDn3v9CJA7rX3hCWxqBs3BBESe10+JSWBrmUE4yduEibg8A3jW/XDd0jRyU6x d65QiOc+EQtHD4ozAEtsYBpQiN/jdi4HPewVX58FpdFdCHx5+7QdY8y+O6PFVN8RKcTfuCacWJn 16j7dAYU5ZQSStZ8WNZ5Vc15RGzJmqg== X-Received: by 2002:a05:6a20:1596:b0:1e1:ab51:f531 with SMTP id adf61e73a8af0-1ed7a63cc71mr42599423637.22.1738643045175; Mon, 03 Feb 2025 20:24:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF09iljl5xk+oLZXpbhxTgvu0aBdVTIyAYQE/2Jkms4zcEywMp0Em1Jpv+9zSV+CcejUShJ9g== X-Received: by 2002:a05:6a20:1596:b0:1e1:ab51:f531 with SMTP id adf61e73a8af0-1ed7a63cc71mr42599365637.22.1738643044359; Mon, 03 Feb 2025 20:24:04 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:04 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:43 +0530 Subject: [PATCH 3/8] wifi: ath12k: remove redundant vif settings during link interface creation Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-3-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: ZDS3q5qrsvpwKkFZz60rbMTGtAafMa1i X-Proofpoint-ORIG-GUID: ZDS3q5qrsvpwKkFZz60rbMTGtAafMa1i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 suspectscore=0 priorityscore=1501 adultscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 Currently, vif level settings are done in ath12k_mac_assign_link_vif() as well as in ath12k_mac_op_add_interface(). Since it is vif level settings, doing this on per link does not make sense and it contributes to redundant code. Get rid of this redundant code from ath12k_mac_assign_link_vif(). Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 16e6f2fae943d3fa6a46ab1ba6780c9070418279..7defc2b20fb61dcaec06d0e332c48a1b6cd2f5d6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4022,13 +4022,6 @@ static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, sizeof(arvif->bitrate_mask.control[i].vht_mcs)); } - /* Allocate Default Queue now and reassign during actual vdev create */ - vif->cab_queue = ATH12K_HW_DEFAULT_QUEUE; - for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) - vif->hw_queue[i] = ATH12K_HW_DEFAULT_QUEUE; - - vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); ahvif->links_map |= BIT(link_id); synchronize_rcu(); From patchwork Tue Feb 4 04:23:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958588 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 022A1203709 for ; Tue, 4 Feb 2025 04:24:08 +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=1738643050; cv=none; b=EXPwNld1uOPjvKSYixV2F1aFeU3DpB3AdRrQFdQ7PncmS2g2+GbYlfpY8Rg3OSPfFf1k/9VOkNMf1r/DsFx+8mI6OHvSBzo3TQmgQTlM9JjNm7U/AFWY5ynsxUGlV3CPXtD45OJVg4qCQFdf3ZC7F0muv5kYagJbUGAQyTErlcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643050; c=relaxed/simple; bh=czAUF9ihlUTrE5t62GrutrMGkeEVeCGhMcd8UTHifBI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rJ9r5TZ9U0JtMk32vTmFl8ewVVyTdi4PRHmF8Ukb/pFNKZMPLkv0AtKyn0ru9sNi3672o2sBmZu64whXoXoDYP1fl+ttC9GRoVd6mDfteaTXsAvhFB00+PUaJZrw7OuhCBws5hJdRb5N5QAn5BWVmMETbYwhfjRTNfQ2OEDgw00= 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=JvxtmIXj; 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="JvxtmIXj" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513KQfLJ026948 for ; Tue, 4 Feb 2025 04:24:08 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= GSD2xSqgc+UtRZaCrfIPDdeC6n1yLrDoUby1rjCIZRE=; b=JvxtmIXjoIYFfxte +GG7fsBK6w8KIL09Ut4vyjq3Lykgqm8F2fGSWV1kF4rQvi5YB3pZJBIfwqmvbsRa 30jS1khygjm3xhRV/oH+SJSRCAaSTDGyLn+J14w6gpm7M2Yi7Wg4OGkLs2PJRmCA pC8MVRidmPGrLtXH7DYpVcXqXVSNMdDXJsh2PuqeryBRbiackc8CZGyHTaS1p1S2 ZuWNLakPNY6CJHX8N5VlG5pcRl1zIKhRBz8FGv2YbwKbys1i8DdatEpFu69LQUoK MhTPaG3jjpIybd3DU8zlSJbEtE0ObJjKUMeQDitnBbfBjQqUloydert1CAlqbj9e m1XDjA== 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 44k4ufrtda-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:08 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-21655569152so113990185ad.2 for ; Mon, 03 Feb 2025 20:24:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643047; x=1739247847; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GSD2xSqgc+UtRZaCrfIPDdeC6n1yLrDoUby1rjCIZRE=; b=QayVihTPwxfjI94wpPWY76s0U1lJpd5tJ7z7k/DQTMbME/8QXiZSBRV+hckvUUUvk2 mc4kQsSk070bsZkY7ojhH9EhjruhbPdUSt8X66DjwPW4BhUul6S9hVt5Ex1eRwiHXohT 4UzDRX3WZVgzcVkxwb8pZUP1b510roIn/j4SHqz8hUBANHbkbBA3ypAIJWff36bFiiAl Q+s+rCosxWox/P+nM0pLgK85xGfJ8vwhPpDGUPBidizHC2VyAW7KLDuxiTbFEq9eHRMY 2PUZ8QdpcxbX0LgU4+FH4sEVUuy4RcFHzctVNTilsFD9eQcZLzSo6mIR5hLGb0B2+uNS Mp9w== X-Gm-Message-State: AOJu0Yz2odFoEgycxmuFHRa8E5OG8gwhF3CcrGnk3OTHrRKeg3kIjEzo 7tci1SRZm+wyhoZnitgLKFd2AKGMS7SpPORdIwrhbrpmTX7JAjMk3jpKKFgp1aHyu4T3uz5lnO0 8WL2VcF+H7SVASxabKNNXZTk+QJx+pjmVaXAr6Xq8utNEQqvODId1Kao7ERZjjC8hTQ== X-Gm-Gg: ASbGncsKYL7EBHYXv9PBbB2SjQQKnfw269TXerjU5jPmdUSZpb/sN4Olxfp80UOL8Z1 UoMo0ZWM924e9A5qM+PmlpFxSE/WeIuO1mktcttAqL+dTHsTwx/P6wQYvE6plDS2n2pUzwf0duG NysSx3hLzP6gdrXOoMUyhtKBk2fUhdWkQB5TBrwSg9Ovl6mTEdy+7ATH3HiRBECx3knADJPiIej hynuMZVJ3Wc3bdaLtKeiZK1EoRMuHUWWbI5fUk5OXJ8Aj0RmeHI7oiYhNJySd0Ed0v9+F6b9Dmz idhkneiA4dTn0tABHzynzNDq7lXpI1AZU4r6ogqAV2Ul+47ia2HKm44jL5l7iGnOaHZkw4PUw35 fPrcjXH+e4XzlUn++6Fc0x3rohw6TTg== X-Received: by 2002:a05:6a21:8dc8:b0:1e0:d934:6189 with SMTP id adf61e73a8af0-1ed7a6e12e6mr41633272637.31.1738643047455; Mon, 03 Feb 2025 20:24:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnli/E874b/FlDlx0jep/rC6suUy2lsy1H+BJH6Rq1iVfIuI+6c0/qJ8tC48WQ/GeAsfZA2Q== X-Received: by 2002:a05:6a21:8dc8:b0:1e0:d934:6189 with SMTP id adf61e73a8af0-1ed7a6e12e6mr41633241637.31.1738643047073; Mon, 03 Feb 2025 20:24:07 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:06 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:44 +0530 Subject: [PATCH 4/8] wifi: ath12k: remove redundant logic for initializing arvif Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-4-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: 108k6AXwJXl1EP9Wh7pHjZswiXF5xpiV X-Proofpoint-ORIG-GUID: 108k6AXwJXl1EP9Wh7pHjZswiXF5xpiV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 The current logic for initializing arvif is present in both the add interface operation callback and ath12k_mac_assign_link_vif(). The former handles deflink initialization, while the latter is responsible for other links. This redundancy could be avoided by using a common helper function. Hence, add a new helper ath12k_mac_init_arvif() which initializes a given arvif. Since synchronizing rcu is not required after adding a rcu pointer, remove that now. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 80 +++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 7defc2b20fb61dcaec06d0e332c48a1b6cd2f5d6..5f0388002e16c38a834d6c7c6c020b7afa7044f0 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3973,13 +3973,59 @@ static void ath12k_mac_op_link_info_changed(struct ieee80211_hw *hw, ath12k_mac_bss_info_changed(ar, arvif, info, changed); } +static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, + struct ath12k_link_vif *arvif, int link_id) +{ + struct ath12k_hw *ah = ahvif->ah; + u8 _link_id; + int i; + + lockdep_assert_wiphy(ah->hw->wiphy); + + if (WARN_ON(!arvif)) + return; + + if (WARN_ON(link_id >= ATH12K_NUM_MAX_LINKS)) + return; + + if (link_id < 0) + _link_id = 0; + else + _link_id = link_id; + + arvif->ahvif = ahvif; + arvif->link_id = _link_id; + + INIT_LIST_HEAD(&arvif->list); + INIT_DELAYED_WORK(&arvif->connection_loss_work, + ath12k_mac_vif_sta_connection_loss_work); + + for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy = 0xffffffff; + memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].ht_mcs)); + memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].vht_mcs)); + } + + /* Handle MLO related assignments */ + if (link_id >= 0) { + rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); + ahvif->links_map |= BIT(_link_id); + } + + ath12k_generic_dbg(ATH12K_DBG_MAC, + "mac init link arvif (link_id %d%s) for vif %pM. links_map 0x%x", + _link_id, (link_id < 0) ? " deflink" : "", ahvif->vif->addr, + ahvif->links_map); +} + static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, struct ieee80211_vif *vif, u8 link_id) { struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); struct ath12k_link_vif *arvif; - int i; lockdep_assert_wiphy(ah->hw->wiphy); @@ -4006,25 +4052,8 @@ static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, } } - arvif->ahvif = ahvif; - arvif->link_id = link_id; - ahvif->links_map |= BIT(link_id); - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); - - for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy = 0xffffffff; - memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].ht_mcs)); - memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].vht_mcs)); - } + ath12k_mac_init_arvif(ahvif, arvif, link_id); - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); - ahvif->links_map |= BIT(link_id); - synchronize_rcu(); return arvif; } @@ -8312,19 +8341,8 @@ static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw, ahvif->ah = ah; ahvif->vif = vif; arvif = &ahvif->deflink; - arvif->ahvif = ahvif; - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); - for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy = 0xffffffff; - memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].ht_mcs)); - memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].vht_mcs)); - } + ath12k_mac_init_arvif(ahvif, arvif, -1); /* Allocate Default Queue now and reassign during actual vdev create */ vif->cab_queue = ATH12K_HW_DEFAULT_QUEUE; From patchwork Tue Feb 4 04:23:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958589 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 3B261204C17 for ; Tue, 4 Feb 2025 04:24:12 +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=1738643053; cv=none; b=bij4+khz/GZdbsHTUPRrxj0GeVw+XT+50ByggIKz1CP1g4dxLCVaFZyc+1BwEEEb6hFfqYviOGKDvgqMApM6/MDYFTEi+b5SilKNlydyjxYToojVQg3aN3hNMNS2Scb+srn3GzXa0SnVSyLlCJNulwP5529efWmqiHumfvaa0C4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643053; c=relaxed/simple; bh=gwPZy+ldd2gBfU4saE4MLv7VxN67dn4s+tHZP4cQRRk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QsgXK6NljjCggAm+ECX7OYwhCJKNaXSGz77F39s5Xm3MbwN24A6vhsprQrHz6Cr/0z0huuKrur6fV/myW+AEByhzYcOtTp+kgmK5O+tCNMH14FrpgLUwrwzVvEhw7Lu4NqLLfwaH7kRdLe/FDxQT4Tp/aeSCbNOH++sQEKZw9sY= 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=LVfYyZu5; 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="LVfYyZu5" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513IajG9008805 for ; Tue, 4 Feb 2025 04:24:11 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= x00RgwEIM9B0L+foEiTohE00SGuLhH++Md440wM3z3g=; b=LVfYyZu5HFLiu5Md r8TOLI+yqZhXRM658SPG76IELfKSm43/ULtNs4vyKsf+qxtBpJFbRNT1DJoj4fwN LwryJiZMUPpTo2FZFyNgdqt1Ax0pM2HX7y6qQIgj5LEBQ+rCozXPASQBxVhlCYRV Ldojp+Ofb4r9Z863FB+s/HZbCf2lqXIu2kXh4e6vUhed2tllpsvZgegshnOxg8y3 Oxm2bsdcDI4ovVrrgW0FlZp+SG+6h2efiGAWUMqtdL20TlLkwlvVRODKHyDvHMFc nNsJGHwAWifLU7/uV3vJWnqj2wHlkVHa7G8/pQtvlkwIac8LyQC3X46bbM25jhoa VjX3jA== 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 44k37u1205-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:11 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-21effaf89d9so12975925ad.2 for ; Mon, 03 Feb 2025 20:24:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643050; x=1739247850; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x00RgwEIM9B0L+foEiTohE00SGuLhH++Md440wM3z3g=; b=fn5AuP6bLNoO+q58cR30XEkqlpbKvW1Cy2WgJ9ooGEFDBJPYQ0vG5YxjF93p/jPkKB ntoXQ8P7dOKxYxe8hDBkPmi5l8KjX/30Sk+6EDx6xAV4gDUYwPjFgWRpTOlBl8SwTLrh 2nLgmpzrLTHuO8rSuKFvw7QLMLaBr8XLQw0rpb9xzoVF6TtptmWfoS0IJsDq6XRLfQSi gHOVkIPGu28kt0hkqqrTNzuEt6jhBIXpSSlGScnhKUzLc51qgRZdDxzenH/Sb0leFwqQ cebmEqzGdq92bG329CQy290FS2h9pyJASF409i69/iFOACj16v8C+1jNHX4SvEh+TsIm GntA== X-Gm-Message-State: AOJu0Yx20ZaIIM/mq08lZLnyZ2UhXgojgMtb3jhzVwQjNGHttAEhhId8 hQeEDjbqPpxBT70ZZXM9qMS4KwNKJP+Y12tnjow4kOCyYJVCVQT7sMdnEOL7qOyUVcc53TiTQaT 0dkNgWhHB90DRxqVYptXqduNNoNKIK7YgVR5x8zC+Bu1rxfq8OC79LkKMJnIYD6EDVA== X-Gm-Gg: ASbGnctbawO1k+298Tqo6Q1wxfLsdnHpF3cjmEnKpwc1yY9+8eiprm40DD/rcu3ut7B AhY4fIK7j0vsWiNXNy4h6v/R5XS2sHrCV2LIEs7EcAuDCJjlFypkskDN/i0sdLJc2jesZxtKOVj sbw3liiNd2YiwTm5V3XXMnCSD6brQqZzaZHw2MAST4VT+BllhQB0sHXNFbfBFV3QeyY4DSZLrX+ jOFUL487y7SdzPzSXxA7sdVyiAphqd8pxk6KCtcvHXQSkGMxv9DOFJTY9tPQ1MDJdP+bcQnvROK muVRvJO/F48Ymq38gl8YpIZqlfoT298kqlyzoGEXMWFT2JCfLUO9JO8/a4ezz5jJKRuPst8AJyu R6aXs6cq6dkZr2sRGLGobdgQO46t7FQ== X-Received: by 2002:a05:6a21:6da5:b0:1e1:dbfd:1fde with SMTP id adf61e73a8af0-1ed7a5e7e38mr38458890637.27.1738643049760; Mon, 03 Feb 2025 20:24:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBA73qDRykSxKVpm1Py5x1Wfon1kxEZVcDUKBFbVikl2vgIOYfg85rf8JTG2O8i3ygGa8zJQ== X-Received: by 2002:a05:6a21:6da5:b0:1e1:dbfd:1fde with SMTP id adf61e73a8af0-1ed7a5e7e38mr38458862637.27.1738643049381; Mon, 03 Feb 2025 20:24:09 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:09 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:45 +0530 Subject: [PATCH 5/8] wifi: ath12k: use arvif instead of link_conf in ath12k_mac_set_key() Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-5-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: lGP12yagAEiNhA_yJsD2gt_qtHvaVAuX X-Proofpoint-GUID: lGP12yagAEiNhA_yJsD2gt_qtHvaVAuX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 Currently, in ath12k_mac_set_key(), if sta is not present, the address is retrieved from link_conf's bssid or addr member, depending on the interface type. When operating as an ML station and during shutdown, link_conf will not be available. This can result in the following error: ath12k_pci 0004:01:00.0: unable to access bss link conf in set key for vif AA:BB:CC:DD:EE:FF link 1 The primary purpose of accessing link_conf is to obtain the address for finding the peer. However, since arvif is always valid in this call, it can be used instead. Add change to use arvif instead of link_conf. A subsequent change will expose this issue but since tear down will give error, this is included first. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 5f0388002e16c38a834d6c7c6c020b7afa7044f0..db866c1419a613103f119037b19e24b7edaa6c24 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4667,9 +4667,6 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd, struct ath12k_link_sta *arsta, struct ieee80211_key_conf *key) { - struct ath12k_vif *ahvif = arvif->ahvif; - struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); - struct ieee80211_bss_conf *link_conf; struct ieee80211_sta *sta = NULL; struct ath12k_base *ab = ar->ab; struct ath12k_peer *peer; @@ -4686,19 +4683,10 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd, if (test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags)) return 1; - link_conf = ath12k_mac_get_link_bss_conf(arvif); - if (!link_conf) { - ath12k_warn(ab, "unable to access bss link conf in set key for vif %pM link %u\n", - vif->addr, arvif->link_id); - return -ENOLINK; - } - if (sta) peer_addr = arsta->addr; - else if (ahvif->vdev_type == WMI_VDEV_TYPE_STA) - peer_addr = link_conf->bssid; else - peer_addr = link_conf->addr; + peer_addr = arvif->bssid; key->hw_key_idx = key->keyidx; From patchwork Tue Feb 4 04:23:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958591 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 BA81B2054F4 for ; Tue, 4 Feb 2025 04:24:14 +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=1738643058; cv=none; b=VPFESP2EolbviJ2KJoEIhph/WY4pwCYRCUPTj/drs3T/WsURqYa3ROAB5c1r1HKi0BxKeRXGLB9VKLy3A1kOIoQmb0hRVSBkXxGtzfhyrt85yffC99mUZrAIR02wLez2XTCfAd57URI0EtgbCD/3Gw4heoJevs/csgoEEhU9MlA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643058; c=relaxed/simple; bh=6+4xk2qwahdHWPYlJdCB8T7RNkmPa/xjG/CLQ+Pp5bg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DyJRntG2LofnwfF+WJyDoZcR6/MHcboTPziuRPfgtovEZ4qqyWfWbwvGV5IvKRIuNZrm9BDNAdTd5j0A6xSoE8mp27ANZz2QEO0uWSio6JpJFd5tyJGLtPUm2sfdH6muqUwk0HiLd+ObleGufK7ZwxoYjCPA7lOs1E+R7bMGugM= 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=eX1zT/y8; 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="eX1zT/y8" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5141C1mp022107 for ; Tue, 4 Feb 2025 04:24:13 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= HrVb+INNM+z4pj0PiN/+xSGN0XHpDBNtY7UI5NNgmI8=; b=eX1zT/y8Q28g6+lI NelVFC6kdNacEmslF/iin8/O1Naf/xHUKjwqX4j4fnl4bedPYzE0KESrGmMS1icn 0IUmvxUvCUS4X7c2I1lenjqIj6dYvzVDGM80JORLccDn6S/85mU610sNlLKdLScM ZA/hzo7H5MRPSlhhQvrPPEM/n8RKkF7yZ1a41yvmnMeZJpba+ikyaMO3tx9fjL/W Oo1E4gCvr50DTUhRVo7y18tlBU6Y6SYu4yiayugVE0OCsLsfcInCsUSE9xezO82y 7S9QB0qyvjfLpisHjGKOClwDliXEhUr3EfSOIXJZge5c/l6wB0by7eQAYgQFaDD/ FVou0g== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k911gahd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:13 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-216430a88b0so111505135ad.0 for ; Mon, 03 Feb 2025 20:24:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643052; x=1739247852; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HrVb+INNM+z4pj0PiN/+xSGN0XHpDBNtY7UI5NNgmI8=; b=ZSaNB9RHYpLt+UntIGJiN86zfyfTuGXWhBysWpcKBG49FYvhhxFyx4USjCS09xjEtv 2mFhcPqPhsAcKv/V2DwMqFwRSPEC/aMxh9Gn1cSkzTx5g9NsdBjNPzX8lD58eanfVQSU 7wTyxlnr6GOODhZgSvBzoodhInXpJbbngrKAdWr20PZZV5EXMbLELqG93xscOPdlWtuO 9Y9hj5gq9umvpuVcTnocl7p2qixnsdpNJ0c3dQmsGkTlxQUBozu6e40rp7oPxi7Nd7h7 Ywc4D1Y2n/FBj0nJJgRINn/76Eb8nmQjvloUS/ZcXGxV4j1/QKJXV+E1ue+zhhbtCNcS Z0Zg== X-Gm-Message-State: AOJu0Yx/Af+d1E5PRZa9ng9OPYUCDnMgceVWLogyJbEgEX4GlYjGSJJ0 0O67v2x1v8A4kp04WA56I9Or4Ij135GQlkvvxsUyf5Mw+hPsyjs8ctnB6X/2ixLm9PSydDjT8Bj wHo0+I9lj2dXDrrTpy+u2A35eurVl/RhV0vo3IeXlgHNhw2FkJMHHN/vDD94Ol1xHQQ== X-Gm-Gg: ASbGncvhJ06sCp+aI2QR71YzyqgABVjK+RSnw63JmJ5WFnfjSer3Kb61saa72WSrLKQ 6BFDdogQ1n+Vmm1OAzd0a9GHRrKv2scbjntInLgHPykMFcCvjvgUsWfx8pdp5pUH0//CkDErAN1 NLiW4GXqMIfKVogPSqkVR4mh75v2KnLHVYffC6+IJhz2osEmJPiY0cLk/3n3WIP0GJNMUfklh76 YkUrZDHGlxmhC9P+TcwYyZkLP00Lx2ZffgG2ePdDx2I7IGwYDE++IaJUqxAOt0IRAWArKfR+ksa n/ovZeiusSjqfJCewmLnfpWzIgjvUkCjJfWIFeKMJx+Ks5LlQR4T1boOYOaHNpxLXx/Q4/6q/GL 9i7SgbAfnJ+fIxQlBug4SwfNwK57INQ== X-Received: by 2002:a17:902:d48e:b0:21a:5501:938 with SMTP id d9443c01a7336-21dd7e38e38mr386772195ad.52.1738643052112; Mon, 03 Feb 2025 20:24:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IE49ECwcCEgYzSew4ZO7UPQc13n0Kq+P/s7ciZAzDlfP1uq9+He2FL6XzGDxNA6kiAXbLbiUQ== X-Received: by 2002:a17:902:d48e:b0:21a:5501:938 with SMTP id d9443c01a7336-21dd7e38e38mr386771925ad.52.1738643051669; Mon, 03 Feb 2025 20:24:11 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:11 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:46 +0530 Subject: [PATCH 6/8] wifi: ath12k: relocate a few functions in mac.c Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-6-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: jfNCYOK0gw5fZE2L5CvEK_o5SyqGINiP X-Proofpoint-ORIG-GUID: jfNCYOK0gw5fZE2L5CvEK_o5SyqGINiP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=945 adultscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 An upcoming change will invoke ath12k_mac_init_arvif(), ath12k_mac_assign_link_vif(), and ath12k_mac_unassign_link_vif() from a line located above their current definition. Hence, relocate these functions to above so that these can be invoked later on. No functionality changes. Compile tested only. Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 202 +++++++++++++++++----------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index db866c1419a613103f119037b19e24b7edaa6c24..5d80bbb664ea6a710eedd7b57db3523df9c893e6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3469,6 +3469,107 @@ static void ath12k_recalculate_mgmt_rate(struct ath12k *ar, ath12k_warn(ar->ab, "failed to set beacon tx rate %d\n", ret); } +static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, + struct ath12k_link_vif *arvif, int link_id) +{ + struct ath12k_hw *ah = ahvif->ah; + u8 _link_id; + int i; + + lockdep_assert_wiphy(ah->hw->wiphy); + + if (WARN_ON(!arvif)) + return; + + if (WARN_ON(link_id >= ATH12K_NUM_MAX_LINKS)) + return; + + if (link_id < 0) + _link_id = 0; + else + _link_id = link_id; + + arvif->ahvif = ahvif; + arvif->link_id = _link_id; + + INIT_LIST_HEAD(&arvif->list); + INIT_DELAYED_WORK(&arvif->connection_loss_work, + ath12k_mac_vif_sta_connection_loss_work); + + for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy = 0xffffffff; + memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].ht_mcs)); + memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].vht_mcs)); + } + + /* Handle MLO related assignments */ + if (link_id >= 0) { + rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); + ahvif->links_map |= BIT(_link_id); + } + + ath12k_generic_dbg(ATH12K_DBG_MAC, + "mac init link arvif (link_id %d%s) for vif %pM. links_map 0x%x", + _link_id, (link_id < 0) ? " deflink" : "", ahvif->vif->addr, + ahvif->links_map); +} + +static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, + struct ieee80211_vif *vif, + u8 link_id) +{ + struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); + struct ath12k_link_vif *arvif; + + lockdep_assert_wiphy(ah->hw->wiphy); + + arvif = wiphy_dereference(ah->hw->wiphy, ahvif->link[link_id]); + if (arvif) + return arvif; + + if (!vif->valid_links) { + /* Use deflink for Non-ML VIFs and mark the link id as 0 + */ + link_id = 0; + arvif = &ahvif->deflink; + } else { + /* If this is the first link arvif being created for an ML VIF + * use the preallocated deflink memory except for scan arvifs + */ + if (!ahvif->links_map && link_id != ATH12K_DEFAULT_SCAN_LINK) { + arvif = &ahvif->deflink; + } else { + arvif = (struct ath12k_link_vif *) + kzalloc(sizeof(struct ath12k_link_vif), GFP_KERNEL); + if (!arvif) + return NULL; + } + } + + ath12k_mac_init_arvif(ahvif, arvif, link_id); + + return arvif; +} + +static void ath12k_mac_unassign_link_vif(struct ath12k_link_vif *arvif) +{ + struct ath12k_vif *ahvif = arvif->ahvif; + struct ath12k_hw *ah = ahvif->ah; + + lockdep_assert_wiphy(ah->hw->wiphy); + + rcu_assign_pointer(ahvif->link[arvif->link_id], NULL); + synchronize_rcu(); + ahvif->links_map &= ~BIT(arvif->link_id); + + if (arvif != &ahvif->deflink) + kfree(arvif); + else + memset(arvif, 0, sizeof(*arvif)); +} + static int ath12k_mac_op_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -3973,107 +4074,6 @@ static void ath12k_mac_op_link_info_changed(struct ieee80211_hw *hw, ath12k_mac_bss_info_changed(ar, arvif, info, changed); } -static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, - struct ath12k_link_vif *arvif, int link_id) -{ - struct ath12k_hw *ah = ahvif->ah; - u8 _link_id; - int i; - - lockdep_assert_wiphy(ah->hw->wiphy); - - if (WARN_ON(!arvif)) - return; - - if (WARN_ON(link_id >= ATH12K_NUM_MAX_LINKS)) - return; - - if (link_id < 0) - _link_id = 0; - else - _link_id = link_id; - - arvif->ahvif = ahvif; - arvif->link_id = _link_id; - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); - - for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy = 0xffffffff; - memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].ht_mcs)); - memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].vht_mcs)); - } - - /* Handle MLO related assignments */ - if (link_id >= 0) { - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); - ahvif->links_map |= BIT(_link_id); - } - - ath12k_generic_dbg(ATH12K_DBG_MAC, - "mac init link arvif (link_id %d%s) for vif %pM. links_map 0x%x", - _link_id, (link_id < 0) ? " deflink" : "", ahvif->vif->addr, - ahvif->links_map); -} - -static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah, - struct ieee80211_vif *vif, - u8 link_id) -{ - struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); - struct ath12k_link_vif *arvif; - - lockdep_assert_wiphy(ah->hw->wiphy); - - arvif = wiphy_dereference(ah->hw->wiphy, ahvif->link[link_id]); - if (arvif) - return arvif; - - if (!vif->valid_links) { - /* Use deflink for Non-ML VIFs and mark the link id as 0 - */ - link_id = 0; - arvif = &ahvif->deflink; - } else { - /* If this is the first link arvif being created for an ML VIF - * use the preallocated deflink memory except for scan arvifs - */ - if (!ahvif->links_map && link_id != ATH12K_DEFAULT_SCAN_LINK) { - arvif = &ahvif->deflink; - } else { - arvif = (struct ath12k_link_vif *) - kzalloc(sizeof(struct ath12k_link_vif), GFP_KERNEL); - if (!arvif) - return NULL; - } - } - - ath12k_mac_init_arvif(ahvif, arvif, link_id); - - return arvif; -} - -static void ath12k_mac_unassign_link_vif(struct ath12k_link_vif *arvif) -{ - struct ath12k_vif *ahvif = arvif->ahvif; - struct ath12k_hw *ah = ahvif->ah; - - lockdep_assert_wiphy(ah->hw->wiphy); - - rcu_assign_pointer(ahvif->link[arvif->link_id], NULL); - synchronize_rcu(); - ahvif->links_map &= ~BIT(arvif->link_id); - - if (arvif != &ahvif->deflink) - kfree(arvif); - else - memset(arvif, 0, sizeof(*arvif)); -} - static void ath12k_mac_remove_link_interface(struct ieee80211_hw *hw, struct ath12k_link_vif *arvif) { From patchwork Tue Feb 4 04:23:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958590 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 BA88B2054F8 for ; Tue, 4 Feb 2025 04:24:16 +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=1738643058; cv=none; b=cYBc+ECLmo47jI5b6A8F3Eac1D8FImBCRlN2Znt4YKEYyGs65Z5c4r3533A9e5im0Z5hasUX9PcfXYSKRL2BUAX6oKS8OmOxGu+hl2UylXE/248g87Ep5AhYFqraF+DNz+EMML3oNyHTKiuJ5cZYRB++LI/USjyk1zZNvxFEaYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643058; c=relaxed/simple; bh=B39Xe8rgwAmkmFxB95m6R7rKmvQyb+S+ESe2rrI+qpg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KssgVvf/Gy5oJK22yB0iIQayYi9X7Q1J12EQpSDvERNvwIX1tJU173ULtAzW0Y/UarE1nn/flwnP2Fzo4U2iPJPuE/x/qMSa7dCGdH5YOshMwILq1wyTAWtGzbBqiWsLvuAHwm2KBaHxHkJx8Y71fMxsjwaeDU6w2cewt7oahZg= 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=Qz+6YlsN; 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="Qz+6YlsN" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513IppQ0006193 for ; Tue, 4 Feb 2025 04:24:15 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= axAsNklMxgFf0ah3MCcqQDPWHHSWt1rtg0cgBrQZVoI=; b=Qz+6YlsNhcWkiWgR axWgDCaPeLChnXiicuoP6TNcRFX5TrnOLBYcdL11FShpWX8P4HeqQNr0dic6LwNF +CzCrOaKfqYNHrw2S+G8JWyRacrwa1vLixXnTWMcULAEvrueiuLIAmQxEBezpfAW 5+Mj+MyIAB40Zoz9Ny1dsZ3K7C/zanN/qU29DiHkzAl+s2aXUi5dHT3Et9oYhSGo gx/2o3CMquum7blpjMbJPpJZexoFB0Sw8bK/THtKNiPkt9okdqo2880/7cGVVPIA nlCjER2hFGreR5VMsKspVRRSlL4WSE+SL5DZ7P/kFfnmd5hwpETyrFMhoETFesop 4JUhQw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k3ex10t6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:15 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-21effc75088so9689985ad.2 for ; Mon, 03 Feb 2025 20:24:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643054; x=1739247854; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=axAsNklMxgFf0ah3MCcqQDPWHHSWt1rtg0cgBrQZVoI=; b=gT3ZHhpkbPAeTXOZo3717QctADnPGOnBlZ+1lTasTuhD6+szx0zAPhjqfLrMVnVIPU UROCC+Ul71V2DWZkoRdQ4hoQp16yU8Gy36IOElgF91zpgdl94oYOFE4/wOi1wgOuvGgN wFK6QgMDmXj1hBebAWvwsv00L1mNMH7Xf4L0lh0NNudWRbwnP1DPMvuh6MVeUH3IZw87 Qys1q4Coxu/JAt0huIlbQfksTX71RRD9oJFrKo1mc/l3jcXo5EHKlk8/LuZFi6xJWbmI SAV0r/9VjAIdMXBtQ4lqTlJsmiuFfIvVV1EYqg0eWNZcIvHY8h+xE9bOtXlUK5lZaazp tNIQ== X-Gm-Message-State: AOJu0YzdPsiQaA8835eoU85KSsxAm+Weob9F4IZXqIhsLhhm+/9LBwK/ LetH+psWKvq2ylqQTdpxjanpAbVe12bOZl7xe7YlOY0Xye7gDXH9v/divFXJ72oAVaq3yV7qWpp fRo3zqZ5/RcHB2SdSdKFZ6dJPrAL3A4DKfNIbded2cwNMX7IWfbgC4pHwiyJ7SYDzxw== X-Gm-Gg: ASbGncsiTwRoNgdaolovGFTGoj/HkvII7/Wv87exi//tGRhxDcBP3ja9l8dr6IAhtz7 l7gb/iEvvW5oCV9c7uPOkOZ/kfkqFGhuhtZKMZZrQggJtVIptvgDWcW7swjgoFFNwBT+WcbTxcs vv73JN/h5OGXzJsOVPZR49XkN/D9fOH4eWHDf3Loyu3gDO8tuYH/RXSWGvtQc5hSdaqD5SgS84E ilFzJg107k2sVT0kKZY0Mum/eHZLUoyyix1v5EnSNkbRThI6ER6Thostwu00ZHjucZ4egm/JuFK aiPpHCuQl4l0bcUB2+os6pwoESGFi6EiNSFGs/gwOd3onUJyqu8eELmRnjoHY3kA82d68dlt5+H 8r6LkdSLBm+ol66ywF8gZ1ER/t5O4eg== X-Received: by 2002:a05:6a21:3284:b0:1e8:bd15:6845 with SMTP id adf61e73a8af0-1ed7a5a50eamr38531509637.1.1738643054302; Mon, 03 Feb 2025 20:24:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IG37uEnTRl9KVMSU4spm40ZsO3haIDtnzXWYxqrau1noeC/5WzeqS9hfmEiHCb/xGDbajfSvg== X-Received: by 2002:a05:6a21:3284:b0:1e8:bd15:6845 with SMTP id adf61e73a8af0-1ed7a5a50eamr38531478637.1.1738643053911; Mon, 03 Feb 2025 20:24:13 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:13 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:47 +0530 Subject: [PATCH 7/8] wifi: ath12k: allocate new links in change_vif_links() Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-7-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: KOiU7Z-WN91028PWuXL8ApB9lWfLb_7x X-Proofpoint-GUID: KOiU7Z-WN91028PWuXL8ApB9lWfLb_7x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 Currently, links in an interface are allocated during channel assignment via assign_vif_chanctx(). Conversely, links are deleted during channel unassignment via unassign_vif_chanctx(). However, deleting links during channel unassignment does not comply with mac80211 link handling. Therefore, this process should be managed within change_vif_links(). To maintain symmetry, link addition should also be handled in change_vif_links(). Hence, add changes to allocate link arvif in change_vif_links(). Creating the link interface on firmware will still be done during channel assignment. And since link will be created but channel might not be assigned, there is a need now to test is_created flag in ath12k_mac_mlo_get_vdev_args() before accessing link_conf or else link bring up will fail. A subsequent change will handle link removal part. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 5d80bbb664ea6a710eedd7b57db3523df9c893e6..b9017002f3efb27d917f0aa35a0ecc66af18ec99 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3576,6 +3576,31 @@ ath12k_mac_op_change_vif_links(struct ieee80211_hw *hw, u16 old_links, u16 new_links, struct ieee80211_bss_conf *ol[IEEE80211_MLD_MAX_NUM_LINKS]) { + struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); + unsigned long to_add = ~old_links & new_links; + struct ath12k_hw *ah = ath12k_hw_to_ah(hw); + struct ath12k_link_vif *arvif; + u8 link_id; + + lockdep_assert_wiphy(hw->wiphy); + + ath12k_generic_dbg(ATH12K_DBG_MAC, + "mac vif link changed for MLD %pM old_links 0x%x new_links 0x%x\n", + vif->addr, old_links, new_links); + + for_each_set_bit(link_id, &to_add, IEEE80211_MLD_MAX_NUM_LINKS) { + arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); + /* mac80211 wants to add link but driver already has the + * link. This should not happen ideally. + */ + if (WARN_ON(arvif)) + return -EINVAL; + + arvif = ath12k_mac_assign_link_vif(ah, vif, link_id); + if (WARN_ON(!arvif)) + return -EINVAL; + } + return 0; } @@ -8765,6 +8790,9 @@ ath12k_mac_mlo_get_vdev_args(struct ath12k_link_vif *arvif, if (arvif == arvif_p) continue; + if (!arvif_p->is_created) + continue; + link_conf = wiphy_dereference(ahvif->ah->hw->wiphy, ahvif->vif->link_conf[arvif_p->link_id]); From patchwork Tue Feb 4 04:23:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13958592 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 77F302054E4 for ; Tue, 4 Feb 2025 04:24:18 +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=1738643060; cv=none; b=ng1+/HQ3f9C6Sxn3Wnnouwz1h2TzxBq/5OBF0t8hJa9inXhzPWgobB6vjG2p5fhQtXi8fnqEd+mJxGs6tfky8x82KApuuCn4qYpY5ucroKMDFadHGUsjttL38lGn+4mqmOdpLV2rOmzxN4rEertTTr4n7wqbU2cihuLDgP5iicc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643060; c=relaxed/simple; bh=3zeSV7XScPXnxBgxyXBl4PSjkPapzFvlWTrtbgOi9xU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CBrZzuIQPqTA8XwrM9xq1W+8AG2yeDbEqqdcIqTXNAfHNn1p5cUjFr2jxlS7xZck+lCTtBmepLVOltGm2OHoes5IUwydx59FHqLegtv9xxDIdsgmnisnQWeUIBvCY9b5tTMV1LPEcYWZGlvD9YY+kQVDngSyNZxbwQibK1RSmrg= 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=AkJz/G+9; 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="AkJz/G+9" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513KQjsP027024 for ; Tue, 4 Feb 2025 04:24:17 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= n5abZU6dyDkIdkVihxBVrDuFbwGtylY+gTuk/12qRbw=; b=AkJz/G+928HsBnpC q/6sCZUhnsfxrls2KVuZd71WpKgcdzGgniGzqUPexWfGQmY+ZGY/pWGoxtzymfyo DItzXN4D6fGgZfa997TCWEsd1Z6OvGeAM1H2EweQoXBkMNuAh4fvTGedawgvQ30y Sx73RqHaUYay5OvqMerZGNJsYUoUHCck5qzD2WyIEf9mhJytn8qCnpSJ5HwaTorp nwi8HceQcppdwrWsRjEso0lGWQv2DWksngY0/YnUpqaBhb5dghg4xLBSjkTwbTr7 +EeMuRo3uBpfz717PhmBPNa3dcbvaVp0DKMQ9S8Op6CZnC/v2GC8b/WVBKJF3+rS NgnTuA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k4ufrtdt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 04:24:17 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2166a1a5cc4so109662805ad.3 for ; Mon, 03 Feb 2025 20:24:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738643056; x=1739247856; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n5abZU6dyDkIdkVihxBVrDuFbwGtylY+gTuk/12qRbw=; b=baOV93Z6wHst71DR60LEyiidwNhSSsyHN1+f8Vn5Tv+rCBzDK7InfeAolUxnaWd0R2 g/qNCH22uO7idDkK+j18H72yIIMKzgAwGz8pBFx3ukUG56N9INkbicjQX5Yn5n/h5TsF rSWnHv+owFQ7Os8YZrvk6h3d6Eo4yVfMZ34KPq+8ZVJQjgtaZMf23rDn2GLkIfDqZbno UxActTZ8e/pYvvvcjqryghGaORLA/14SJ4ssrlD2cTriXBJEb6UkNGoGPNwxhxwnymXm 1gNR1eNSWjrJo6/DP3NfgukDObBtg3DrZ0W+MTYmVJJSlGNP7Cwd8A1Txr3/h2LGSIAZ uQUw== X-Gm-Message-State: AOJu0YzfXFGm8V1npFh6IzDSvxcCYYWegvg8n3NNmYgZYXZlzovBPN+Y rXSOWJ/CMFGXrYdwTxLbGH6gstMloQCAg5dJv6/M6keIDC/v3bukA2iRNzJI1+S1AcglySEorSf N+khokNM/gNC52U190Q+sZ5DulNZvY/h/rjW6GIMm83Q/CZfGAGdYidSqCJQ0Laj9yFjTzqO2fQ == X-Gm-Gg: ASbGncsoQJpAOweRZgEG88OTj2NBqVPRCqGhzCEsIwnF1wi+z+hHNTTZSNj0roe55ND x6Tjv8exIpkCWPBaYXXzVOqckLg/3KN9UeMUkTRkXdY5PXJlpNQLoM8DqyDUGmjRkIzpG9UGQPN R2nr/LVcQoE6Apjp5y9WaUcHHXC5TSj+0zq/Ha8r0IADiE0GPb+0HtkrpCf+nT4AIMcz6ZpRSSM SE4NB87wIG3GDelZihq5e8GS2II0sasOBw5xNK3QFQrhYPXfaiC7O1qIP1dT4uPviNBXQh6ncZ+ pEjkweV3PgA5RJtyRLK/aVWNUKSVXDSWCVMYERTwXFtgKnDP2thB0/fwWK2ZYeOSRYvU11pQq38 s2kvaRlE4sz367hMsZL36+Oa1Uepxsw== X-Received: by 2002:a17:902:f606:b0:215:89a0:416f with SMTP id d9443c01a7336-21dd7d82c71mr370635115ad.30.1738643056478; Mon, 03 Feb 2025 20:24:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhoG9w5PlyPWrqyvJgyt6LTeaXrrnMjdnwMh0e7+nmLXcFU8Xb2spNcgNI5qyh0iy5T8MZgw== X-Received: by 2002:a17:902:f606:b0:215:89a0:416f with SMTP id d9443c01a7336-21dd7d82c71mr370634855ad.30.1738643056138; Mon, 03 Feb 2025 20:24:16 -0800 (PST) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-acec04796e1sm8897144a12.58.2025.02.03.20.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 20:24:15 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 09:53:48 +0530 Subject: [PATCH 8/8] wifi: ath12k: handle link removal in change_vif_links() Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250204-unlink_link_arvif_from_chanctx-v1-8-675bd4cea339@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v1-0-675bd4cea339@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: _CGyTF1T2V__spVRZ9BTbyEZL20qwmiM X-Proofpoint-ORIG-GUID: _CGyTF1T2V__spVRZ9BTbyEZL20qwmiM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-04_02,2025-01-31_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040032 Currently, the link interface is deleted during channel unassignment, which does not align with mac80211 link handling. Therefore, add changes to only perform vdev down during channel unassignment. The actual vdev deletion will occur in change_vif_links(). Additionally, since the link arvif is currently allocated in change_vif_links(), to maintain symmetry, add changes to deallocate the link arvif in change_vif_links() as well. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 53 +++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index b9017002f3efb27d917f0aa35a0ecc66af18ec99..d965ae2e755821ea5bfa366a5d74263020e5dee5 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3577,10 +3577,12 @@ ath12k_mac_op_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_bss_conf *ol[IEEE80211_MLD_MAX_NUM_LINKS]) { struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); + unsigned long to_remove = old_links & ~new_links; unsigned long to_add = ~old_links & new_links; struct ath12k_hw *ah = ath12k_hw_to_ah(hw); struct ath12k_link_vif *arvif; u8 link_id; + int ret; lockdep_assert_wiphy(hw->wiphy); @@ -3601,6 +3603,31 @@ ath12k_mac_op_change_vif_links(struct ieee80211_hw *hw, return -EINVAL; } + for_each_set_bit(link_id, &to_remove, IEEE80211_MLD_MAX_NUM_LINKS) { + arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); + if (WARN_ON(!arvif)) + return -EINVAL; + + if (!arvif->is_created) + continue; + + if (WARN_ON(!arvif->ar)) + return -EINVAL; + + ath12k_dbg(arvif->ar->ab, ATH12K_DBG_MAC, + "mac remove link interface (vdev %d link id %d)", + arvif->vdev_id, arvif->link_id); + + ret = ath12k_mac_vdev_delete(arvif->ar, arvif); + if (ret) + /* No need of error prints here since already inside the above + * call, in error path, prints are there. + */ + return ret; + + ath12k_mac_unassign_link_vif(arvif); + } + return 0; } @@ -4100,7 +4127,8 @@ static void ath12k_mac_op_link_info_changed(struct ieee80211_hw *hw, } static void ath12k_mac_remove_link_interface(struct ieee80211_hw *hw, - struct ath12k_link_vif *arvif) + struct ath12k_link_vif *arvif, + bool delete_vdev) { struct ath12k_vif *ahvif = arvif->ahvif; struct ath12k_hw *ah = hw->priv; @@ -4111,7 +4139,9 @@ static void ath12k_mac_remove_link_interface(struct ieee80211_hw *hw, cancel_delayed_work_sync(&arvif->connection_loss_work); - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac remove link interface (vdev %d link id %d)", + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "mac remove link interface %s(vdev %d link id %d)", + delete_vdev ? "" : "partially ", arvif->vdev_id, arvif->link_id); if (ahvif->vdev_type == WMI_VDEV_TYPE_AP) { @@ -4120,7 +4150,9 @@ static void ath12k_mac_remove_link_interface(struct ieee80211_hw *hw, ath12k_warn(ar->ab, "failed to submit AP self-peer removal on vdev %d link id %d: %d", arvif->vdev_id, arvif->link_id, ret); } - ath12k_mac_vdev_delete(ar, arvif); + + if (delete_vdev) + ath12k_mac_vdev_delete(ar, arvif); } static struct ath12k* @@ -4300,7 +4332,7 @@ static void ath12k_scan_vdev_clean_work(struct wiphy *wiphy, struct wiphy_work * ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac clean scan vdev (link id %u)", arvif->link_id); - ath12k_mac_remove_link_interface(ah->hw, arvif); + ath12k_mac_remove_link_interface(ah->hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); work_complete: @@ -4436,7 +4468,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, return -EINVAL; if (ar != arvif->ar) { - ath12k_mac_remove_link_interface(hw, arvif); + ath12k_mac_remove_link_interface(hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); } else { create = false; @@ -8274,7 +8306,7 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(struct ieee80211_hw *hw, ahvif->link[ATH12K_DEFAULT_SCAN_LINK]); if (scan_arvif && scan_arvif->ar == ar) { ar->scan.arvif = NULL; - ath12k_mac_remove_link_interface(hw, scan_arvif); + ath12k_mac_remove_link_interface(hw, scan_arvif, true); ath12k_mac_unassign_link_vif(scan_arvif); } } @@ -8297,7 +8329,7 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(struct ieee80211_hw *hw, if (WARN_ON(arvif->is_started)) return NULL; - ath12k_mac_remove_link_interface(hw, arvif); + ath12k_mac_remove_link_interface(hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); } } @@ -8502,7 +8534,7 @@ static void ath12k_mac_op_remove_interface(struct ieee80211_hw *hw, spin_unlock_bh(&ar->data_lock); } - ath12k_mac_remove_link_interface(hw, arvif); + ath12k_mac_remove_link_interface(hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); } } @@ -9439,8 +9471,7 @@ ath12k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw, ar->num_started_vdevs == 1 && ar->monitor_vdev_created) ath12k_mac_monitor_stop(ar); - ath12k_mac_remove_link_interface(hw, arvif); - ath12k_mac_unassign_link_vif(arvif); + ath12k_mac_remove_link_interface(hw, arvif, false); } static int @@ -10293,7 +10324,7 @@ static int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw, return -EBUSY; if (ar != arvif->ar) { - ath12k_mac_remove_link_interface(hw, arvif); + ath12k_mac_remove_link_interface(hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); } else { create = false;