From patchwork Tue Feb 4 17:05:07 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: 13959444 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 809BC215F67 for ; Tue, 4 Feb 2025 17:05:24 +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=1738688726; cv=none; b=FOB+fGU0Q/YVze1gzahe5LUV/mJT1eW1LO0VAK9HxfaaIGpJtBj4tpwWvodwsSVeQspVOXb5JwCCpbFIPg5fa2e1Zklf1fCF7LWBntHPrgTKFMtzX2ZsMh0YW7QLfhQriRKUkoNima72ubXd+IMVT9FeDvvOIHW/jT5XpoSNCqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688726; c=relaxed/simple; bh=2zaqtMLmaEiFWQIT21mk66I0QwlyJgIFFDVjO5lJIGE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FRg59MuLSUs537O3MngSPqzuZ+5EunNDN/qYx3GCM5llerHSYF8JG4CnkppMGS0yvXDdWj9EdCi35k7cTlo2IHaIrMwxOaaxmrWbGQXczxHavB1n9cbI/rHsvs80ozjjcc1/HZnaONBo5pomKncQL122LOugiK2IMh/6RYLBjms= 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=molv57UD; 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="molv57UD" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 514GulGS024727 for ; Tue, 4 Feb 2025 17:05:23 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= hBnMagGnfmOlAsemSbgdCgpnsrubY8Yw3Y2FnZmojeU=; b=molv57UDlDd9WkLo 8+qC7qFNNgf0wJw6FWgrscoHiGd7NMQM0zYffu+zBU91gM+o+FKpl1/rgRTQkG7J 7dN5ghgdKcp90NFnsx/LjT/xigoGt2nY8isNfzEcLdg4nnx++RpNLzMnCINKOI6O rOPxij9vONyloAgdaT8CtwKmyt1rt2U0RLdEDsYhZaWMcV5kifbpTPYB4wiprEEn CiMPfSHJTTgvbcbz7q2iUH9LDkHbsTUVnuTkvv8TadS5s+XT+AN7HfRoYbkajz1q vUbr+9Hy1+4/I9hHLvzvSK3/AS9WZDgslcDtFjSFepQy8TAQ1G2YrRugJpYslZsU tlf/LQ== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44kpuy80uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:23 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2ef6ef9ba3fso11260267a91.2 for ; Tue, 04 Feb 2025 09:05:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688722; x=1739293522; 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=hBnMagGnfmOlAsemSbgdCgpnsrubY8Yw3Y2FnZmojeU=; b=hnuwP85B7toZjuitnpL/aY0S0iuzRH9/Ra0lMwT/x3iDu3lI29zvfhL/rbtN6R0NfR v9fvztW+1FSO74SIVikxwHh7ozG5cszoFnTh6LRkcQsrRq4vN6AoA+C5X4eMlmPxlBIX MCb4prWGDoObeYxJcGTB+yWpQj/QVCerfId+98aLn41rba34rZCXNc8CRb4xftagN0zx wRGXLThl5bqJOREq3CGzwIYwBfsdQXHvQLlMzgPmb2LjXflFsX1wDDzF+EzGEsj0ybka Cyx1Y0pqDMCxFvraseLcYNpCQEI6R7XZPww4k1JEbPcFsG4MaEOUKN//VfG45fnmsp+2 UaxQ== X-Gm-Message-State: AOJu0YzxB89F2PiqUF5lQlk6YgzXgdGQBcrHTgUWWI65jt/Z3SmnHsAa HJYi14ybOl/7n2SmtIAKCPgd8yuS08gssOQcnTf0V2dAcsn1ZvCMYPkOIQhQggWfK6q6WPAnXeO PIb0gTzRBf66XvADITQuxEcVgpvf0N/2mIMCPB2NVvkJbJ+6I7Y6OjT+AOBlHpQ/DCA== X-Gm-Gg: ASbGncsr7l3HtkFKWJOLjqKxSXmCfpUoPHP/0bCfdZw72IzNJrZITu0dFLk5rgAJgSH FKjh+GdQyJxEuvqUKYFk/Sf4R8EF8RCPbqmCr98g+3I01sSj1fBTmnL4woKaZyZkQElxg5BdiPy C8b6ax/z4etdbF/M52EiRoBOvE7PwM7CN1mkv53o76dfxOEcU6Ni785oeKG1jyjAtQbPaMJjzq1 LUYkeQ7JZv4QHjDvSXViiQ35Gjwe3LxXg6Nf5ssllDK50PcvDdhivdcsNqWa5voCrt1Sfb/kTFr BMszzlLgHvfTneB7+6qivWOMQr53jhXIng22cRo4WqXa+WfUz+obJP8OW8N0NLupq88tQkZCGWv dM01bl0061CxCyh9r6hf4wT6/ga6G3Q== X-Received: by 2002:a05:6a00:b4b:b0:729:1b8f:9645 with SMTP id d2e1a72fcca58-72fd0c7f7camr40884091b3a.24.1738688722383; Tue, 04 Feb 2025 09:05:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/o0PDFYKduJ/WFg5MTpCskunjYwzsD7hxpDVDXG2wzp3GnoR6788Fy5nXVsJL9b4i/RBxvg== X-Received: by 2002:a05:6a00:b4b:b0:729:1b8f:9645 with SMTP id d2e1a72fcca58-72fd0c7f7camr40883896b3a.24.1738688720498; Tue, 04 Feb 2025 09:05:20 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:20 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:07 +0530 Subject: [PATCH v2 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-v2-1-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: jHQ_duyh0S_c2xkd7Ivp0D4k3EXPrGXe X-Proofpoint-ORIG-GUID: jHQ_duyh0S_c2xkd7Ivp0D4k3EXPrGXe 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxlogscore=987 spamscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 17:05:08 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: 13959445 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 47600215F77 for ; Tue, 4 Feb 2025 17:05:24 +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=1738688726; cv=none; b=PY1vcbfXS69vMmvGJ6EPLYauC04xXz/NsbFmN31mVXybfo0tTTgVNsUjLSKcLeSu9X+nxMP9WWUtmShh/IdfmVM5mtkQm8GHfu70ekUJEWpP581KcHk1srsVGRmQbqYflMjcLQvJXK8OxZfFeaYuNnDYip8+b0dTKsaW06MU4ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688726; c=relaxed/simple; bh=p2bnHhOqSQIqgPShAaS9ItDs7yJenHwaRLnyeqoEQt8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dkm/QWBsMSFrC6lo1DGEUwocC4cijx9i/FoBGvjHgwqlPMHTcr5/UrSjTfESVRu4zceLa52TTsM712BFjNj6vN6mNauwfsfEHB+ONcH3/lVKUmvyGUpWfqwczi1I0IM2Wh0UD4h2pAgsgic4OBwoCKPsHO05N3x86gsSz2g3Z7I= 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=my25fFqz; 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="my25fFqz" 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 514BYiao010456 for ; Tue, 4 Feb 2025 17:05:24 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= WrKlYNONBm1r5bugr0RbvCDOyfxt2kBDOYEM2pahFGQ=; b=my25fFqzDZynRTF8 ZtTiLNJPyBxvtgiqAsyOKWNfPCjzCIv/IX07UbjuhJ/snfG/5buEQwT1CBhE3Jcf 9R74YKkfk0JeX3e91tdHUGLcJ15zsAvyxDKm+3DcVESp/3Lk1QgQ/BYjM/bgnDkC WuI0DX9yTygNeAH18B6GyOtKYabAW07LL0/Y5WlfRh7ScLBuAglCtOkg7SQEh1oW 9NbhfDMByfutDseivc9BXZzT6+fQLv5hZV8239EL3Ca1OgosqIrb2cKrtPi5k2cu pq2kU83PZ7krmU3pwNunafkSMAaO+CH2EQBq0+1TFC68ojyu2L1NgTRGwil5ijVf QPByUw== 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 44kj4ygsr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:24 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2167141e00eso136282745ad.2 for ; Tue, 04 Feb 2025 09:05:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688723; x=1739293523; 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=WrKlYNONBm1r5bugr0RbvCDOyfxt2kBDOYEM2pahFGQ=; b=wOfd97j+QLEDZHiTLTFbSN9KrxYAmwIDQJb9ZVBnd6dqWCTbsvTyRgt+T/WH1jdsJn q3lQE/g0EPyhAP4364xTCh5+yCg8uKilKcPMZg5N53xvHAyqBumxFlQuh4V2aBcCoYvi wxfIdmqUyvo8yS8x1Xwap3NEqNpeM33T2bMxQeoNUwyEkF6eviWATQHf3wN4FmGMH1yU p5B62CiQZkFm2eyeAbwRzSBoi3SYu/PJ8vs1d//f5ABEfYrdXBDFDcNt2z9dNIQXbrAT EDdskNbsWJaQQb1UIepaHUUT9LqQVHT193Xgj6CsYhGNanAG/c8vn5Jqmw1neh9SOLIX 8aFg== X-Gm-Message-State: AOJu0YzK9H/cEZ/RJ9rqyRy9nDLvW0Uh+w3quApEMpg18sndkMv50J4r m4EATgjQ0U2/rOtgkxPWtMXO/vsKX0U3xG09yvHppX2hRCYzdovNNFkfY8BNA+f8eft9lUc3kdG VrmpGijru09no3KPlT9l9eMGYIGsv3IuYJNCZXWdHoUBKvBFIFetSRhgUZT3t33BSdw== X-Gm-Gg: ASbGnctnEWOLHd2g38wygiZCXCrgq0IcVHzSrxZ+bTiq3Q7Gd9v0PwEmHdplISRxUeS YXf9nzqwgYKQ7y3hAxKZ4G2phWNPnvcZLLhqx5Kp0mhv/AVkQbK1J7Z90qWH7Ji9s4VfSiSRYDF YapFD2fM1BkwZavM1OSEQhtrFJaLBlgPFRE74IJjRMX6zaym1l2rcdL1Q9JpHccJcwVYKf9Vjk2 qDuuQeRP2fFV/Auu2xpCRqZWlhawJ8ORSOP3iw65Y9XOgkGEHQ1LuEUgtCpUPDLOnLnsmUDm3vn eNMSQzSjbNSQQSn394GbSQCctLjZcJ2CzsTAIyzjEpfnwipKnxSoBNJDBi2ZE+9N83A1qvKa3vV Rxpb4k5Z8RmGlRnHraBPT2qaS70tIfg== X-Received: by 2002:a05:6a20:9152:b0:1e1:9662:a6f2 with SMTP id adf61e73a8af0-1ed7a6e0b73mr38361975637.35.1738688723444; Tue, 04 Feb 2025 09:05:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTnmMsoLQ66Rol4cur40Q4wmBOZ7g7tduU57E52w28CdMb1zHUBV1eaCLvbB3xc7hYjBqb7g== X-Received: by 2002:a05:6a20:9152:b0:1e1:9662:a6f2 with SMTP id adf61e73a8af0-1ed7a6e0b73mr38361931637.35.1738688723004; Tue, 04 Feb 2025 09:05:23 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:22 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:08 +0530 Subject: [PATCH v2 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-v2-2-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: -voqNR7AI3SdPk88_ArwMvov0d9sLpau X-Proofpoint-GUID: -voqNR7AI3SdPk88_ArwMvov0d9sLpau 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 17:05:09 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: 13959446 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 B71F72163A4 for ; Tue, 4 Feb 2025 17:05:27 +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=1738688729; cv=none; b=IvVPkkvfH0PWzBQKGjjuXLgf08p5XFiBXqWkLNixhOlDmTa2gPd7HtzPGDIQaY6DuWWS6NZ/yLIwauO0TceZpTWIuJfDdjGnbBPAnw0kIos+k99VRt+8y3b3lJIc2+hhLcBsIqXHdAoUOqTS8alZCRzUqOI9l/FaXE2sXn8M/Ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688729; c=relaxed/simple; bh=dM4Q91rzLBnr4OE5cBXEjGA2EQ/BqqgE9G/59+YtMoY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ibgbo56o3Qh8KLLEjV8mrU4tlkWjAoTJym7mmI+iC1HCqxUu+PfIj/mEXmQ91H5GVha/tIwY4ScFAjl6D97Fh+qjeWYefqKBUr8FqkbQpoJ5pUQ9Gv37OXLxkGbmfay4eEmu1ER/XLgt2ZEuZYYubgWC+7tJmwonZBT2j8KQW6I= 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=RUKL34PU; 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="RUKL34PU" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 514GuY3Z024441 for ; Tue, 4 Feb 2025 17:05:27 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= yQTyuAWmUFPgAQKIR4TL14IlRB58wBIAJ8OSjdQfdm4=; b=RUKL34PUZSk4/Avq Ki8be12eYAOTP6ZCwht519p5q4Dm/Kg/GV7q9izxwXxg6SKfmRcdDETcO7zRrw1Q uEOCsfrO+HKexurJYBDfNZENiyF0gDd48XhqvMSg9lVROdRDHHs6ynvOeTBnsCUq 1rtrbNUxzELOPItn7vhzJ7jJxscPtS06PQt5LrULMuKjPymQEX/zzECQQ4bgnfD5 h2k8MimYLk9biKi6gf4K9EQuLCbs5SAB/o4qYaFHXXIB5+RVI0QrEOMjHzF9G4NM xY5pAlVgQKHP0cLa4mj059MyNWHJkEIuNb2bBA146CMoO+8xTHZRcctPRIWsTLKs WAhWMA== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44kpuy80v6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:26 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2efc3292021so16516231a91.1 for ; Tue, 04 Feb 2025 09:05:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688726; x=1739293526; 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=yQTyuAWmUFPgAQKIR4TL14IlRB58wBIAJ8OSjdQfdm4=; b=UJvZCnbnO4VK+LNQ01DwDe8DqTU9DswWUAFRwKYAwVngqQaH2kd9ouhp1NT/MFUnBO 4JlJudrlctdqWeFxExeg4QvT1XaLcDWdS78fIKOc7HZ2OVP5wsRCt7A5irUh5u4QqMmx Ps9l6cbFV828nfYsL/CjEIhsemcjSVTp4xn+IlabYNBXk7o/Axya8HjXhEfDmyCLRTa1 PZrzRH3Ph2xgJlpgi7731F+fPFnuqiEfZQQPljBZln0nA5rVIIR1s5Zq6MYEGjCUgmH4 0G7hOEml1EJ+WW81MYDQxnVXovFDzjJkHLRh0x/If8YSSmfstDq9Va/p1BzPjfjLkUcv siog== X-Gm-Message-State: AOJu0YyqalJN6mJv1EC4ULy0IqEvm2F4I/TVB8x9w+uPvoP5CyRCBAYs NiQtuHnTGdOsCLKCDlsah2A1vHGk7tWiobzUS6vPjEy3am2EzH9BJg/tF68o8hEUj9yfNjDe8kC Zh1GpQclVZUlqEhNFloHPSS66+dwZ2GkKuGPAlkQdZriyDUwbytrlU6l1t2QFR4m+qg== X-Gm-Gg: ASbGncs88uvKAEc2+hzU3PFARFxiCLXUjZIlzaV0XgdneAN196lPVplQgcKYuum0sn9 9F+Xo010pC6NH7iONDROa0ic5pCOUPShGV4AlvQVyvma/OjalBEuAvK79QXHyYzGyu+B8klIAP4 0ASL/E40tvTe3ZJ2M6TZDtaqUL/pDVy/SskPVhYhSpwu7UeBECIAC9vvWIDRjcQ+M6VYHfwvLHL PHClm2qrbfOZ02J3sbl91l8SXVbAPs+qaLY35IvGIKzh1JPDRh+1/buL71gAY3ctY18wwLbo9Ol ux0CFhYSW7LP18Brj7SR8pCIAYAqx3VcwW/d4UT8cYWhkgZ9qq+CIJZM3j4uIIlIzYEFrnSwzfQ U3QGFdXrvb/VLWaLLJZwLDAfxKLLUjg== X-Received: by 2002:a05:6a00:928d:b0:727:3b77:4174 with SMTP id d2e1a72fcca58-72fd0c7f7bfmr40485142b3a.23.1738688725898; Tue, 04 Feb 2025 09:05:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWwMmLGyTw18js8RIrutWNTN4NIewNUcg9CwPYOFLN7vXFURF6WhyJs710xW0ZmzHIAw3JFQ== X-Received: by 2002:a05:6a00:928d:b0:727:3b77:4174 with SMTP id d2e1a72fcca58-72fd0c7f7bfmr40485107b3a.23.1738688725498; Tue, 04 Feb 2025 09:05:25 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:25 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:09 +0530 Subject: [PATCH v2 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-v2-3-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-GUID: xAl2QI_lSdqX4Mry0sf_Y6YOKRp5TiCu X-Proofpoint-ORIG-GUID: xAl2QI_lSdqX4Mry0sf_Y6YOKRp5TiCu 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 17:05:10 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: 13959448 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 5E02421661C for ; Tue, 4 Feb 2025 17:05:34 +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=1738688736; cv=none; b=HTih6PypP6OA7sfLjJIbiXg8O/xaj4KHCf4tWUbflks2u2SGkcahb0WFUsh4kOgk37EOWUAYR3l0xkvz0FYJP1RLj4yJXwh3k2hfQ9PuGJ036TBzXkd2YbBJMA0WUjX/mwlbe3nVjRhbYLNg2h3/F1BVkxKQ54UjNTFTQYD6OOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688736; c=relaxed/simple; bh=5m9D3okHYC52yuqw3igqQ23OrYpATKiC13aUYPGPyE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DpuE7NY7QCPChZEPwQjLAEZpjn/6eINH8TfqwkjNE8NCeJ00ZnaY6gOE9fPc5ybV6M0LG+8IbnABi/VOmshxEFngvrY/NbEg3QlYaO60URoua8Ugwm338SuZ6kvcr0bAYKkbfLjEMFd0FZnH76gkhADL25LLCrr++pTrzEW6Hog= 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=QPuIK44Y; 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="QPuIK44Y" 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 514BZ7aG011508 for ; Tue, 4 Feb 2025 17:05:33 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= OL/QcLRIJh0ky121SiQIUudqZdpTL1YzhtN9uKN3Eyw=; b=QPuIK44YH2E+/SjH CNBlWWhcTrMxRA6kdQoh8urr66IGa9/MiJCxswKEaxk44ecejCbSARlTDmyXfre2 hzwcoOQskv2P1+fmNzmsyPo9KB+t6v6G1Tjv4bfTSF+8n4XztTfzni8SVd5/hsH7 4R1TKIdS2ZPXYCnRfvJbGDBsmtdCCs30ipUaWsL/276wpej5sDBu4ZOHgfYvU674 bZ0rX4bFWcxotevmFmZaDqQcWfFM+756r/a7YFFckN0W0H1Up546TwI0+dVoEuDd YFEPKZShcnig2d3J+yoh1o4Adh4eLuCz1jNedyFDh2sbJFKLI0wk9I6EJwK3++iy yMGeRg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44kj4ygss2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:33 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2ef80d30df1so10808520a91.1 for ; Tue, 04 Feb 2025 09:05:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688732; x=1739293532; 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=OL/QcLRIJh0ky121SiQIUudqZdpTL1YzhtN9uKN3Eyw=; b=awwFmKMI7dD4b1GH2QtKhFLHZXvo+7Doc9NH2tx9FWvhTS+8hu7HqjP7J0e+5h/5dw 75SHDymEaxxFvRjD9iZ3YNNvDEwBqxNrXjSU+A6E6kfWP4slEEXABRwYLPPlC77HN/V6 AmYXsGmgSFwHF9yk5CwkMkERrV/RdUYZbJlPBtKA2ThyWX19B4GydxImwEmPmJS4ay3e Jvhps11Uo/rEOHcNSDW3t0VoHCYWzrZgFqAXWyz09vSeZedbuIFs8+oifnU7SB52dC1y JQHTD1OVwgNza9UbeDzxOTGAmjd+2nB2h/nFdmj6P6gRB29RXYULTzOvydCWR9dj9Eru EpVQ== X-Gm-Message-State: AOJu0YwJpaoXWWdu7ONlG9tYRPTsLC9k1WC9X1UboI6MBCbSugLlZIFN blETDm1JIDzSS1FrggbFz0/AIp95S7C/OL+RezecsxRY76R4XeLubeCHdGqCmjIUGCa73ua2Y3C GA8OokfPsupZ1KO8WAY/xCMFdrTeIMMYBbyXR0kBopoZdsWTAh10y0Bkxb1anOXiQ7baPDwBw1w == X-Gm-Gg: ASbGnctN9o5Qn25GfduDw8hdPl67hkwZfvduEPyCglqCM3J66gxWGqfgwzBuOgVaAe3 rrCrmwc9ocZzJq0U5trVC4nyb3UYRceYiuX9uKK//7nzyaurc4OIaFn/GbjJUXyZ0Kgrt9OF0ON 4C9xXUlL8X7drh906+10pJbNn6brYoSHZy6QEa6z307Nksce3nYj7JlQWJ4JyBKMqBfv47hLDMU KCL4cPFyBDqnAoKssm59RcaSjaDt74ziEBNc2fpKUl8jPz8tl5wp26CFHeybB3O4+pjT232rMkU MAf2cjc9ioHA1TAOa6HgGZQEngOwsouJJdM311JqN2rMvM7sbvwBFfSLG9iZ58JGb8Ib/WV4iLE /DyVOAxkS+XdPLJI+Q7JUySnhCZEJoA== X-Received: by 2002:a05:6a00:18a5:b0:72a:bcc2:eefb with SMTP id d2e1a72fcca58-72fd0bcdb58mr38129920b3a.2.1738688730735; Tue, 04 Feb 2025 09:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMARmptt0ygx1XHCqHB2J4I02VOK37cI/VtiWUK0SRjm18Qm7birg0sl11fNhJ9zPqFGNEgA== X-Received: by 2002:a05:6a00:18a5:b0:72a:bcc2:eefb with SMTP id d2e1a72fcca58-72fd0bcdb58mr38129749b3a.2.1738688727960; Tue, 04 Feb 2025 09:05:27 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:27 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:10 +0530 Subject: [PATCH v2 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-v2-4-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: ZzVzS5m17qXH8q5CvW16iH_D9wCyht-Z X-Proofpoint-GUID: ZzVzS5m17qXH8q5CvW16iH_D9wCyht-Z 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 17:05:11 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: 13959447 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 9FCD121661B for ; Tue, 4 Feb 2025 17:05:32 +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=1738688734; cv=none; b=YmrZdYN4I2Kq/iF84HcaSNYgMKDjUHvYt6/QvdB8QMDu6zwxP/wH6mxqhtlrh46EMqO0cRwM0lOwEcyECjkA9CKwlprzICrCMpqNzcY4mnYOaavWr+RI/zSDHxT9z/8v/lzodja8h981GkrCx11WgLTFtevu5k54so3KhI49JAM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688734; c=relaxed/simple; bh=OEvxUUHd1bknAjWDidS+dI9Tyqbgg6sCieUjL97IA3s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VSMl++skcZg6MiB2YotJvPQ8OQxPwtMVzwyo/Yr/bmNmTyBnP6uzpuBUFzygIWggOrB7muxaX6x0V8Iu+gHIHIzDoPb6uG4HnQ4lAtOptNxYZono4rsnjCt8IYSMLOyzaBj5LlNKtHRqsQOBofnKsB5V2wf6RVD2eoAYty3Uh/A= 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=U1Rkyp/q; 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="U1Rkyp/q" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 514E1UxQ031716 for ; Tue, 4 Feb 2025 17:05:32 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= dy1qfD5UTtYECRWWfOe+C5t/d7dowdD7s3GDIHnLHoQ=; b=U1Rkyp/qYcYNhlZp 61yYNEsgKgyZNJlBZKkc7bLr15tOwtsLk8mrsb9AfaK8u6IzJvGZYYygcJFW+Gtg GD3Ffj386mswCWWyqD71fw0rvXmIb+6YdNNhoREaDgNN1RcwneZlcQ52IW4szNxI SfcZLGKY5Fv3AaNg6N+0jOr9mkkmAp973+rjqsb+xALTLF5K9/CoV745KckUxXJN EE1BxpPy8qN3153u5+3V3DTkqyJBbMC362V8fZdf84RCb0zkRRlmpFygRJNc2re/ AJcrh2Bx1izphcGBtKOd9m9UBHgyidR96/qayblSsuu5avEsNxxQsBRVyYCO6guU MekNKA== 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 44km9wgf8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:31 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-21f09fa389fso11697565ad.1 for ; Tue, 04 Feb 2025 09:05:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688731; x=1739293531; 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=dy1qfD5UTtYECRWWfOe+C5t/d7dowdD7s3GDIHnLHoQ=; b=J7P8NOgl7YqFA0e8jX9B2Xaha+1nWoae30Q0TROSAT6DiVahqHpOdkhmss96FsuNAA 3ZpLFc1RuX/mQ4CeCJUEiLs4bpfqdOjtkD+LwXHL/MzkTCxVINlkT7xMHLUCTdzbUBzK q1uuiU9P/g/kMEIMC7dk8gMamaNNgV/5eUdQOuNIVf4KTMHZiifYSsllu8CbzkwASY8k 8sXNOHgUUCT43Oh201iXfBS3LBbqzHAMFVMmDgVAIjFmEH0lqan0zd5F+RpVJCXwRjJz kFvMk3Wvr1LMRQGCVVbCDfnl+c3O8C6ZbuvC0AmKNR/QhYroV6kTisOt9no6lLfaMPLP +eKQ== X-Gm-Message-State: AOJu0Yy4vNzqposJ82sVx1g7auzRr3YFjcUBnpqNXCEPM1nZaAoqDaOx xBif4SDnrFdu3FzaBWhIW47450VHmL8JDxK5BOxoVna1rdl6OCxLFCiSJmW93wAHpI8BV8HBm0M mg87oij1h9doZDGCcdYHh4EiUqAXlriVaGcNDmdSy2ydCpylrUDNNcq5PLdRatkhlgA== X-Gm-Gg: ASbGncuAj68+PjwbGhNQxnuULhKhQ/9hJfvWhElqxvLrX9q0jsuFpfqnh6KjTqp3XyT JbZRyQe9sUveQWpOY4BHUQ63/mhtjKGPGtSN/Sygy83FYTBB7VTM+0f+LXssuQ3YlIf3QWN/kLw MQPtodvQnOKTWEgePBoK9/gKMleR6WiJVINiO6V1gwGFv0iryXTgAzt99lEbiw6g/kG/g6oNCJi Y9+tXpd4gCRbxXjO/itpZQCpEDCUnJHOUNZvczf15tvxw0TwN2DwhmZmZ4YKk5ioGGXBxgqyCAJ OgxONsliZ7E5mb//a2ZKxdSDoIxVWW07os6IPK4WF/ljE+tn993K+seS5QReKDp8RCOuIJvzdph zo84PdQn9NZ0QczttSr0chN0aNPi35A== X-Received: by 2002:a05:6a20:c70e:b0:1e1:ad7:3282 with SMTP id adf61e73a8af0-1edd76c2660mr6105395637.7.1738688730954; Tue, 04 Feb 2025 09:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVBF367qbEcWZt63Cm8v6f2EmzewOOW3h6qyAO9Qg7zw6MWUQtPT7SGCjw9ouetmj4kRDb1g== X-Received: by 2002:a05:6a20:c70e:b0:1e1:ad7:3282 with SMTP id adf61e73a8af0-1edd76c2660mr6105350637.7.1738688730541; Tue, 04 Feb 2025 09:05:30 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:30 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:11 +0530 Subject: [PATCH v2 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-v2-5-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: hD7kdQyoruU0oFCwRLEYmL7yvOzQFdPz X-Proofpoint-GUID: hD7kdQyoruU0oFCwRLEYmL7yvOzQFdPz 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 17:05:12 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: 13959449 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 65C21216E0B for ; Tue, 4 Feb 2025 17:05:35 +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=1738688737; cv=none; b=MVqSJsGfVi+7Kpa8yLwTvz0kE5M+9pkX1egnXKpUOiEwJLdcu1wEppXnzMpGH319rnKkJ9pMfN7hfkWOjj6z68mwPFsVx4vZ1BXPbeK7WB+QwavIjdPJxrbxhLwSXURsFhHHRFjpb/ingcR0Ul0V34SL0VvAe1y6hTvqUld89xM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688737; c=relaxed/simple; bh=nj1MR/o86niB/+6cv7aECXNXfmddam89K/k6jiut1E0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WDh7lSyEz6X/1jDT4H3J1STTZVpzoKY+5APJ3mhYZMbHZJCALkLi+ICu5yR76UG/yvE+JxsazRSvr0EVZC6LlO2oq81Qyas7zm6/TvLmmxqLY9xN/zwDsEaILTTH3fxcjuxYzvYUMiszmQBQzgw9R6kB8GLHMP5XWLhZcaBtfkg= 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=f/INd/E8; 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="f/INd/E8" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 514E1VI3032200 for ; Tue, 4 Feb 2025 17:05:34 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= WN5HH/8aK4QaE6vMfcOuIYz8YHDTi8XwCxrBcxjH2dE=; b=f/INd/E8o/rPhrP1 jf9oKAxw2vaJS6NwdnTVlHhMy8gnCEGjXlWVRRtsV8ODpdJ6PTdQUIJyo6Etdkpc PpWi69ujlDmOF3boUtT+JfvN9u9DixUfBsryJbJh5z+XqWlqRB5dMI2wxpc164vG 3Ds1oKebKUS2RVYylra23jB2DPNzanBbToqfen2pATw/oquUI3dC/d5AY4OhlW66 ThdoX6THf+h49SdddNaIcUv4uHqLUdIylHfFyEXF+4dsxKgE5etWpYAGsyx+c8Cd SRwy2IksrSHT2fQnaNwQizHSr5QqpiJonNSJgiLipZvPRdDG/CY1e9/mm0o1cc2Z ku4JNA== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44km9wgf8j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:34 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2f46b7851fcso16543222a91.1 for ; Tue, 04 Feb 2025 09:05:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688734; x=1739293534; 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=WN5HH/8aK4QaE6vMfcOuIYz8YHDTi8XwCxrBcxjH2dE=; b=UJQQBR8l3P0sDIejo9d+1H3IGZ/ZAc8QyVL2UIbknF6bEMQXkbJcDODCYmyzxqhRWP VWvPnGNYorbzeLaZo1E9tlD3AfAu9V0Dk29x9vOedne4J6hfsl4K0P6xLJ9yTPeXaYwM 7Ht0c4iJ5bi3Jhc8joS9jVWEFMmQwj/Dmo5FVRv7PALmOh3L3G2cyptUo5oocH04reqL cvgh35HthFe/hQ33GWe0HbuSTCiwffG9QVdSwbLA5iubfRmdWbojhDcouiVRO6gEzHuc GNS0anzHymMLixDK24Ho/BN6kccCkSTiuGIQbAtWp31zA3kQJgVrhYaPXFXAjymKW36G hTzQ== X-Gm-Message-State: AOJu0YwuG+cvnhLb69Z4++UNlSmtLDop/tTi5h8Yo5rDT0mn83FXrZak Ja+ecoO92a/3c2fKH4A+WZS+borDEMGBEjeExXvVmV41Jm/tSrlaaDlv2LRQwQ17MbPV+XAfOeq EnVf6kDLQjN1HjQFPgmb1JNbmAqyVz7H7Pbh8T1QIZbfM8y6ka/fH80MS23Fp7QMb9g== X-Gm-Gg: ASbGncsnseEv/AMGB4CEIHRYuTYnWtPSXlpy9Sgr1WZfQRLul4f5kNfJH+1a4qFnKP8 WuIrKY8PArLvENZycICdMS0bjVOn7oQJO0mKib/+syNEF1uBK0QX+gkaE/OooXDaCJ/cCT0T2TW GJeZfNkod1aDzuYIEZ8b7wmJSV4V/TBFLOTVvQFOloKl+jIx2vNO3mYprui3wL4Zuu0I0n3ciny VafzwvfAli0wvTsibxkhng+aZSmDJGiCyk0rAZ1GqeItYtPvapgJiS0aBFnrpgGYhUEdbAwEn7r QQFpvvpOB02DpAktj8bFagasdUc/97kP71RkQH0S4EtT66P6Wgyxi9gLnspXiHL9/oct9GU2TSq O2JwF8jZPGzKdQuC6Dsmm2vE7M7cVwQ== X-Received: by 2002:a05:6a00:2443:b0:71d:f4ef:6b3a with SMTP id d2e1a72fcca58-72fd0c97f99mr38907448b3a.21.1738688733350; Tue, 04 Feb 2025 09:05:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGV4Scox1v8cF8o5B+dd4wbuk+Xtys9zwQP72i2ppE3zrl3iSfXErz5Ui3BkGP9bHQnBFm7Qg== X-Received: by 2002:a05:6a00:2443:b0:71d:f4ef:6b3a with SMTP id d2e1a72fcca58-72fd0c97f99mr38907379b3a.21.1738688732823; Tue, 04 Feb 2025 09:05:32 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:32 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:12 +0530 Subject: [PATCH v2 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-v2-6-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@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: DSRG4I7_uOyH-9VeDUxFgx5h_7V3I7Lk X-Proofpoint-GUID: DSRG4I7_uOyH-9VeDUxFgx5h_7V3I7Lk 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 An upcoming change will invoke ath12k_mac_init_arvif(), ath12k_mac_assign_link_vif(), ath12k_mac_unassign_link_vif(), and ath12k_mac_remove_link_interface() 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 | 250 +++++++++++++++++----------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index db866c1419a613103f119037b19e24b7edaa6c24..4f5bda45387ee16e1ab7a3c15a72252933f29129 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3469,6 +3469,131 @@ 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 void ath12k_mac_remove_link_interface(struct ieee80211_hw *hw, + struct ath12k_link_vif *arvif) +{ + struct ath12k_vif *ahvif = arvif->ahvif; + struct ath12k_hw *ah = hw->priv; + struct ath12k *ar = arvif->ar; + int ret; + + lockdep_assert_wiphy(ah->hw->wiphy); + + cancel_delayed_work_sync(&arvif->connection_loss_work); + + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac remove link interface (vdev %d link id %d)", + arvif->vdev_id, arvif->link_id); + + if (ahvif->vdev_type == WMI_VDEV_TYPE_AP) { + ret = ath12k_peer_delete(ar, arvif->vdev_id, arvif->bssid); + if (ret) + 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); +} + +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,131 +4098,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) -{ - struct ath12k_vif *ahvif = arvif->ahvif; - struct ath12k_hw *ah = hw->priv; - struct ath12k *ar = arvif->ar; - int ret; - - lockdep_assert_wiphy(ah->hw->wiphy); - - cancel_delayed_work_sync(&arvif->connection_loss_work); - - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac remove link interface (vdev %d link id %d)", - arvif->vdev_id, arvif->link_id); - - if (ahvif->vdev_type == WMI_VDEV_TYPE_AP) { - ret = ath12k_peer_delete(ar, arvif->vdev_id, arvif->bssid); - if (ret) - 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); -} - static struct ath12k* ath12k_mac_select_scan_device(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Tue Feb 4 17:05:13 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: 13959450 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 4C1B4217650 for ; Tue, 4 Feb 2025 17:05:37 +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=1738688739; cv=none; b=YQiZTsBqPsd7M3xJz5cEy5R9a/ALhywAiNOPy0YBGlb7gtp+4G3f8cjYHqSnrJUb9kZQvUBAnei3tjaTWHG8WUTQuKAxqMZ/FEPihCfg7OQKGv6L7tYz5cIec/dzVQQJ925QaJHjZy0zUULb5GG9R/W2v5Ks7Tqsp1C5GbeOGnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688739; c=relaxed/simple; bh=gNc7Lt2ImNbmQPIIPEj2dlmoTdt3Zsh0jVL81MByKcs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kStzl9HhVi9C0rhnoG6MItOXudEXRHAWF48q5cF1V/p3nPTLw/WxyjR7ISEHzL8eYuAs8caV1tY7FwLmFJoecquQG6KqjGHnFBmrlyl3TCOTfHkPlhaRatcsCUct33SoPFGARC1d9jK9o6ONKTS/6Bi6lmdJaxivJTJ/rQK1jFU= 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=WOAtA+HV; 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="WOAtA+HV" 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 514BYh7h010449 for ; Tue, 4 Feb 2025 17:05:37 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= 51f2EOU8rD4IqmdPJzdUmHNaP2sswXDBQc7pnwOJIpA=; b=WOAtA+HVSHrlyoEh MjhpxA95iJw8CriT7YkCj9ECfD3Fn+jujKPN+OarSp+sJl1g219IJM8Lrs+O0Taj gsw6SZ+Hh1kcCGEUaEOPNtzVwVKopoKbHn2sbS2MuCpf7lP1Q+yPGzpShL3XcKEz LtG9OYizTWj5M/T+wZsoQf9h+TK/cHStS7ZeE0wcWA1VjTC2xYTuhncF7Zs8JHJN fm2dwNGA1sa4U0p9/Fei7Q9DzYj8fY1mFsE4ix0z+ISZAidbYWcloVdgOl1/Gga/ R23T4+rM0yZmu4yK5rnj4csixKVhz3KRS9uQ+b450PHMk6cRlz8FzkyNFJbpzDM7 E0329Q== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44kj4ygsse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:37 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2f550d28f7dso10711529a91.3 for ; Tue, 04 Feb 2025 09:05:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688736; x=1739293536; 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=51f2EOU8rD4IqmdPJzdUmHNaP2sswXDBQc7pnwOJIpA=; b=ZHazjYtrZXYCBSKe31HfogAmEpJPHa9nqA0JyS19jxgihpHR9gxvSCUYmcjiWccJWC AscurSMSGoZKEooTN9Ho5y0V5TMYYLFVC2ytBgaeBGw9hluJgD/RC5JFjBNYMcp1vFez xcfAoDLJsWUtk17CzPqgliy7zlW1m34GeYcApPniDhWxJFNgo6tP3Idiy4jHykQ6GmRm 5pmCNWZbKlKmMR5P61BlhW4w9xGeQ8Dhn0JtNsmwhDMbdxlGEV1X1vKCP2F+4PUjxjKg uekIDUJWeubBQce2qWyCgctyNX3qWYa+JFCD8l0LF3jIR4kd71FenfvSvkAQzJUMGOsc z0ug== X-Gm-Message-State: AOJu0YwZ5b9Q9f0q2vlhgQLaqLjX6YXdTReCxX4Ppi0wCRKXpNX2kP3S yFaNqb5hKYNt4UMRXzPUB/A6SoyKF1gU1IxgYCBD6ikto4BbRz4BOZ1Qt5HY5SmhDW1c2a8By+S n7xSeYn96Uuu9XRXiNulJjGIPqn98azlubiEvx2KTCUs2J1k1Ers/knB2AHoDrs2wbA== X-Gm-Gg: ASbGncvwpALDxJwq69crEh9kESo4XfRQ+srkEKG9JW32d4gXmXzh/edIsP/lHI0hPKy xtvd7/pGlx4/P+ktkAR4coFwix35TrD0A23A4IKX1OxwJERr0BshzUYZ7Ab1ElvO1Gnz1IUUdcB M0vZvBguua1352TwKigz80CWH90Ktch71ytcWJt9E6byjJKDGwI6rGjecEUh4oe1Lakc2KrlR2S U6TQUMYBJA1e8f8LFXKo4fBcxnbtgNnvHH27o3y82TiWD4qf5ORPBjltzmQou4MS3SS6go768uw XFqFtIrUzUXcBDK2lesWvRiZ6ujC7PbYzZINpXEaI69EwNAVpnoHbeB5ZoS3t/UA33MpFwNS5tA HISBfou7Ig1tkaLU9B/99VSaKTjjHXQ== X-Received: by 2002:a05:6a00:114d:b0:728:ecab:51e3 with SMTP id d2e1a72fcca58-72fd0c02f1emr36077593b3a.11.1738688736345; Tue, 04 Feb 2025 09:05:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEG9Uiqc+7PlX1ZsIPR20CQZaNTTSfUWKtsKFXqKtj6fdi754GWLoojlhA+zlni6fNFJsLjxg== X-Received: by 2002:a05:6a00:114d:b0:728:ecab:51e3 with SMTP id d2e1a72fcca58-72fd0c02f1emr36077504b3a.11.1738688735422; Tue, 04 Feb 2025 09:05:35 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:35 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:13 +0530 Subject: [PATCH v2 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-v2-7-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> To: Kalle Valo , Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Vasanthakumar Thiagarajan , Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: 259JWFedWv2DBTSrWN8XyzAjVTsAL6D7 X-Proofpoint-GUID: 259JWFedWv2DBTSrWN8XyzAjVTsAL6D7 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 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 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh --- 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 4f5bda45387ee16e1ab7a3c15a72252933f29129..9ac2f883cd5cc3ee5950fabdf6b89e5330171468 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3600,6 +3600,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 17:05:14 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: 13959451 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 E8471217666 for ; Tue, 4 Feb 2025 17:05:39 +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=1738688741; cv=none; b=RibYZtHExA7XGUObw7NgqD/YeNxeZ7mmlZ5WSsJV3gAj8nmZTG19dsfJYfECidXa1PNCgRieZSdeltQZh74L3VaopdFwlCMGgxeLoAxWueBjDU/CANcr3BoTi0FTBDMogkrOLN+vhseCkwfBrLsTX3PakOBFa17Bls3Xyowly7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738688741; c=relaxed/simple; bh=H5SVcCEw7SFD7kxR7pbqt98rEJ5prStjaWsC3qTVMRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bx8GCJPchhGXBVso6eGr7gAXPGfURczoAlMO0PUSJ2eeMwAAoenxlDvpi63PZHmbWFEZk/5kiUbMTJLvfFTPdDU3PmDuc26P4ai0p6jhEGUBcU0mSBo6kozEK+/S2WvcpycKptGqfkcWIGuW8sJXEPe6yJENfctDjQaU+TC0zfU= 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=dkYdlNYE; 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="dkYdlNYE" 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 5148WtKG011051 for ; Tue, 4 Feb 2025 17:05:39 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= TXWRaM1cylEvYyBQLAOCl/odoq1V8DJ3wyrrRKU9QRw=; b=dkYdlNYEiN5KUGH8 nn3b2mWakSBWRkQGi8OsChdx5fTRnnpQOP5sXKul9A/haO5l6+GZY2LVzvvCyXHl Wq5TyitWmDIsEgmTRqZtmUCLcGXHnlRWwVa7SrwWcFHYSzT2jiuHLyjQYyLknSbi /19EJcHDmkgYULs2WbAfznNo1Csxp18Tf4B5jI8pv2SXL8U3F+EGnKops7p2qrLK NAfDsuQSgxXF82Y00U3pHNzQaT8oFl9NFL7j/tF2H/rwQ27Csyr/78kJ0/wk8AbM r4CBqUdp+p7XRJw8iXVHd3i2JKwZgwnTzmIE0WBPvKmovhmuzXXbg3WM1T3GROc3 0wDGog== 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 44kffnh8mc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 04 Feb 2025 17:05:39 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-216266cc0acso119331235ad.0 for ; Tue, 04 Feb 2025 09:05:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738688738; x=1739293538; 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=TXWRaM1cylEvYyBQLAOCl/odoq1V8DJ3wyrrRKU9QRw=; b=pbtG9+PgJI53pRHpZ1OCr5Px3TKmKdHWFKUQ/VQtg5wGzuFd98jk2TJieA4fVfHa3o O8qy0C/AU0mcf56l9fYvuqt/q/wjTuuARhCJR+tL7Xexv7HF3oTnk8Aa9SkKSqLAF5vO 2wFV5XASyNA3yhVmHDUe8dNcxo4DxlLn0K0XXejyI8c5Mo8kXVZV9pEx+8/DL6iw1s5P nkLvfDLlw47KiopuyUA2dsMrkwTBF+Atl8qJ5MT9+Ov1CH/l9phmRzkG1fQ6dPC+dn0W 3PX1QH7Azu3wWmPegOYh8I61rGV1flMOgp7S4ThcETvtCvlKiqqEIqq6A1Qcdr+FgZsA RaZA== X-Gm-Message-State: AOJu0YwfHBS01xt7bOfpzBofRCTvfuki2mUdoNjPiLyE3aIhixh6yBcT 0onLn/9G1IYaQTBRJfCHIQWS7pyrOGW74RsLH/9wqG3B5h+E/xrMsHVx7hYC6Mmsbr7Kzto4z4Z iJEY06GYDpYOsKeVmezHpng+aeHCIrbJKsyUr3cFf+2g0mVkdD6kSZsO0xSBHT5KnXg== X-Gm-Gg: ASbGnctDdLG9vrkpEtpyrpjIB97elrUlxgFhd2zZfNuxXab+aHl1VEn6B+U63wc+afp yD2eRUG7/h/u0gRwR0Vies+/K1u7c0em+TFUkynPUO+CPBTDSwe4hlrThFPPzz/Xndaq1dioX2y iWGsXkdJ9aN2jQZqCuz4WNaZxlnUjaYOPddWDS7BLnWLZqgS4kiUO/VvJZDe0XOlwHrZZfn9dad YFlfo3+6bTiOtYQ4MsNEeGPol2nUChvMhWJxHe3oRCC38pY04oHwCZc+zxjeFZpItnXDo37qcUa xUsFJadeUCsDJ1GzWIR3oWlw4XOTX6t0erAK73dowJCRyU5WzzLz5tyYRjzIyMB/foal7ZZEATQ JLUByFRXLVtTzq18M+va+zAKK9t7Odg== X-Received: by 2002:a05:6a21:918b:b0:1e0:d5be:bf75 with SMTP id adf61e73a8af0-1edd772d3a5mr6632213637.17.1738688738106; Tue, 04 Feb 2025 09:05:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFOZCGllE9vRCHjbzgU7t9YEmIsU4+LL2GFRur7KyGfweOuCHEm8rmV9rRR5FRsq2tNOAJrA== X-Received: by 2002:a05:6a21:918b:b0:1e0:d5be:bf75 with SMTP id adf61e73a8af0-1edd772d3a5mr6632167637.17.1738688737725; Tue, 04 Feb 2025 09:05:37 -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 d2e1a72fcca58-72fe69cddbbsm10772788b3a.125.2025.02.04.09.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 09:05:37 -0800 (PST) From: Aditya Kumar Singh Date: Tue, 04 Feb 2025 22:35:14 +0530 Subject: [PATCH v2 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-v2-8-764fb5973c1a@oss.qualcomm.com> References: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@oss.qualcomm.com> In-Reply-To: <20250204-unlink_link_arvif_from_chanctx-v2-0-764fb5973c1a@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: xDSf1_nz6H8HiztFbrat7o6Q6r_-tQts X-Proofpoint-ORIG-GUID: xDSf1_nz6H8HiztFbrat7o6Q6r_-tQts 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_08,2025-02-04_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 mlxlogscore=816 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2501170000 definitions=main-2502040132 Currently, the link interface is deleted during channel unassignment, which does not align with mac80211 link handling. Therefore, add changes to only perform vdev stop during channel unassignment. The actual vdev deletion will occur in change_vif_links(). 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 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 9ac2f883cd5cc3ee5950fabdf6b89e5330171468..682ea0fc9a857a97000f1e683eb145f36ef0dd17 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3601,6 +3601,7 @@ 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; @@ -3625,6 +3626,21 @@ 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_mac_remove_link_interface(hw, arvif); + ath12k_mac_unassign_link_vif(arvif); + } + return 0; } @@ -9438,9 +9454,6 @@ ath12k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw, if (ahvif->vdev_type != WMI_VDEV_TYPE_MONITOR && 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); } static int