From nobody Sun Dec 14 08:07:04 2025 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 2A236189913 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=1738643043; cv=none; b=bk1KaqjPjv+mHWqfGsFQl4jqFS51W0WVN0DenmoOM9Mkyjmm66qOn6d2DkW1gy0N9Aw3tZPIO1tr8rfnxATO45oW+0JRhmWC4H4a5nF0rHnZ22Xf4TWZOICm3W9QlAZq+MxLKFbCEXif0azwn/BR/wil0rwfTKU/j8LwPaluUwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643043; c=relaxed/simple; bh=nxkKWfEGElnDHDYpMY9QNZVpKp9xiqkF73rcZPqYbkw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=crBsvuoCSApLe5PlPee2Pc22CEP5CdunjvtyYXEO+xvuvNTC7qBZPSqTEdv4kXUppKlNlv5jiubAVgTLYPkMg2oWRWPYKvvKwlYEA4AgH6XLsTnKAfwSVcIvMIg8JaBmZTXxnQZDkXJ6h5E2ztPkXTSs+za2BqzE4kgwoYdMgNI= 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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513KQhfU026980 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-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k4ufrtcw-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-f72.google.com with SMTP id 98e67ed59e1d1-2ef9e4c5343so14627617a91.0 for ; Mon, 03 Feb 2025 20:24:00 -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=EP4GwahNYf8x2cKULXZyQQ3Gv888o0YzHTsmU1nGvtdL35b6Ugigv8lQgnDxZR16Dz zf6YihGHxIA0xODg6fi2f2Y8jUfyPp8X83LMvcEtgaou8j+KvhNnKxVLYHuuFs4vLXyP v3kVOwbE/W+H2KuL6sC9iGZde04Jj2lUDoLMOFCUjBOyCGrLihQWT13pC5+aO3QR0+7E sooQu0mrFOeuipyrMpAZSgKj5fUPQf/atBwQwxHWmINzovETukU0L71WP5dAhAKSBdz9 N1DGF5S2/+KbXppHrCdABZGBoNXOrf5+xalL663RJYIzMfjn816L2X9kmO53kqUD4v/c fOgg== X-Forwarded-Encrypted: i=1; AJvYcCUl7PXEdousQDJvYNz46VnaGYkOHTP8oL97sJ99vXwevTPGLpXz1wbvdaiN3nDiAomU7t/8+As3E1SizHM=@vger.kernel.org X-Gm-Message-State: AOJu0YzIVQu17YKRkVZWAJMQ4kM6wB2RVvnlPrSbNbTPawVxZLMOgZmm lRcf+eK2x0Wyf7FsrUAsMQE3XP3sAXc3FaI/hRGUbLTIJU3lxfT0rRpQRTn1VRTkEkgS5y5/vro 6p5oWogsrPe+WaEj8vGoSKRXgFiERB+IYZp+s4CvUrwewPYzLotZBCympCAepHqU= X-Gm-Gg: ASbGnctUf5nkZRNb4Oy1TgHcPwCNqBzCNpg8S9Ql+VCE86OXTu4/+4Utt0CbU7E2wZL 5iKe7Wp7S2nFDi+LEJ3T9NR6w4UGCUE7spbOfUnf+fzWe7xmCIlfwobBRTUfZ6PYwf9N1qqDXDp hgdC/Oz6yvO2AHFH2sIxgPNtnAlR1/rc00dFIOarHaJeJvemzEQ2SqdHVk7IzFzDxIBY9Ro7VGL qYLOCfohIjqMFS5+D123O6ak1JKrRe8LY39PDYBAt+/1tb/VQ3DVHTj/e5IzwvRqHiD6aSxCq1k +zWtZFyqpF6Q6Eqhdnu2gKz7qGya0Uf9/XT2uKHqLczKGPqIayhLtgTQkCYqMk2x9z1zS7jM5HJ Hpeapzu5U39GEIbNFpG42fszPyavPlg== X-Received: by 2002:a05:6a21:498:b0:1e1:a647:8a54 with SMTP id adf61e73a8af0-1ed7a640d32mr38481743637.20.1738643040155; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: iUM9pBgI_02n8QryihldKnzyWN8N4Vom X-Proofpoint-ORIG-GUID: iUM9pBgI_02n8QryihldKnzyWN8N4Vom 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 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..fd9796b5ad3b9feea5c7e78e8a8= 8d361049e08df 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 res= erved. + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights res= erved. */ =20 #include @@ -63,8 +63,7 @@ void __ath12k_dbg(struct ath12k_base *ab, enum ath12k_deb= ug_mask mask, vaf.fmt =3D fmt; vaf.va =3D &args; =20 - if (ath12k_debug_mask & mask) - dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); + dev_printk(KERN_DEBUG, ab->dev, "%pV", &vaf); =20 /* TODO: trace log */ =20 diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless= /ath/ath12k/debug.h index 0aa7c8ccb14ccb9de28a78ca3d2b2a7bf6e481c1..ba0e4da3bb761a49fb81e3efcb6= 1557df8ad1942 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 */ =20 -#define ath12k_dbg(ar, dbg_mask, fmt, ...) \ +#define ath12k_dbg(ab, dbg_mask, fmt, ...) \ do { \ typeof(dbg_mask) mask =3D (dbg_mask); \ if (ath12k_debug_mask & mask) \ - __ath12k_dbg(ar, mask, fmt, ##__VA_ARGS__); \ + __ath12k_dbg(ab, mask, fmt, ##__VA_ARGS__); \ } while (0) =20 #endif /* _ATH12K_DEBUG_H_ */ --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 703C51993B7 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=1738643046; cv=none; b=NezSaFMS3VQeo5b4L8xCxpka/UoeuUQx3y8zZCCSOrxZaZQSzQVNIUSBmMzgOgRERnssNohRXfpJKoGiYTFz8p+4KSydiMEmJtPA8Fqd+v1cF+jGZLWWdOQZ97LZe8VUogpJAiK75sPPiZPA29lHO3vLbcPFim7IpahFu7X/rsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643046; c=relaxed/simple; bh=0cHLir5zfTlkMC+MP5DQJQztPNl5cmEGqQ2sJzIMWiA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dJd4dPxGlbG/oWYwJuMCwM5T+3djanUfxOxnUTBpA1kerGVL1nlfU/kVmG2YD7wl3AjuBN1DU/lmwmLNWz6Q5QZtbQjhqRNquEYa8mFJYb/XtYrw8ImIplmB/6K7JJxcP1pnLKD6BJDB2Dv0DUeSrsmi6dUfOH4bEpgo25NPsVc= 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 513LdOwF030234 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-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k5w5rnbc-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-f200.google.com with SMTP id d9443c01a7336-216387ddda8so112965755ad.3 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=e1B+HKm7oHks/wyDnSwVIm9e8LkAWrKtCJtv/UYcNQwd+evtbJq/3xaD/7bz80Zn4z kHjcOHNH47cH47mc/6tHQhFzJokQlcAa3XPNlZAP7iIEiRiy05eTrsrSHQ+ZbvxXAOCv FSPy28WSN9YIfkHVEUYj8nHDhQ1nLe8P970oO50xp0CwMO2FQQreUkl/K+LMdS5ahtas edERy8oIxLTP8wikm29KgFBuL6/mSxLEC/sd3VYgMLTPqqQnajlBKE0cAcZJ84FqlTGd kViJ0iK2AOHy9dt2j+/dbe3dYi4tX33TyCqju2rDVZZ2B8md1MlhiozG+cn+dFbOJLgD GELw== X-Forwarded-Encrypted: i=1; AJvYcCVCEMFWHP8J1U1FfO0sOOJ97QKDYnkWw0x5H0oAjlD6cmBcTQTxRDZbWj9ylp3tHbeyylUVJVS3b+ub3jA=@vger.kernel.org X-Gm-Message-State: AOJu0YxiLR/L1hIW7GH02rPyEcYx+OxuqlU7De5b3RPYKfCqFmeluExB xnCFZqwe6vaIhPjiT9oQ63R5YuXaL99jZbQLKCBpO08cPZicxRzV8vU/tUkJRgNkGpVJNW/kpne 8EBwkZY75mcVoOO6l6hPDRTnoK+7MJGPs0pYhgoPKqse2c++QJ8rR/lVcry3u93Zj6YyyXS0= X-Gm-Gg: ASbGncsRPcvvXQZu8Dig47V9qFxHaBLcWQETAlgx0g3JZK5b4t7yitgw/AncYaQ+Wx2 URLb2GizjgFMBPo6McqseD3yfiMozbcfE9daIFkX+csGaGuUaLMx6SzXkQwn8ief8QTopJ5HxHB XNJcALsMvU7LT/5f7IPhi+Kp6RxIOi+taYxSwj2Gi6gCnEROIcqF1EOwbUBbCeC/YSwTFz6To3n tWp2al8HoWb7aOY4AgP8ZT+d2H7keelZVDwb7skvbHyBKLQgXMkRxl7/HSWomgForlFvVTbIHMN rjAqFhn781y/Ju5BJOgem5rmyNT0dJlCD7DQ+uFRqQUBJWqy6D0QiB14YX5CCeJpna5K05APWAk lMPvRuf0DUsFkN54DrxqnHGvStHKW8w== X-Received: by 2002:a05:6a21:789b:b0:1eb:7da4:305d with SMTP id adf61e73a8af0-1ed7a5fb009mr40651212637.18.1738643042492; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: nW0YazJvVWhBtbsl7Dgb4HuQusYtObzW X-Proofpoint-ORIG-GUID: nW0YazJvVWhBtbsl7Dgb4HuQusYtObzW 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=999 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..5ce100cd9a9d16f7fcc2dc0a552= 2b341ebbff8a3 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_de= bug_mask mask, vaf.fmt =3D fmt; vaf.va =3D &args; =20 - 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); =20 /* TODO: trace log */ =20 diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless= /ath/ath12k/debug.h index ba0e4da3bb761a49fb81e3efcb61557df8ad1942..48916e4e1f6014055bbd56d5c71= ef9182c78f3b6 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) =20 +#define ath12k_generic_dbg(dbg_mask, fmt, ...) \ + ath12k_dbg(NULL, dbg_mask, fmt, ##__VA_ARGS__) + #endif /* _ATH12K_DEBUG_H_ */ --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 73A65189913 for ; Tue, 4 Feb 2025 04:24:07 +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=1738643049; cv=none; b=WAyMliCMrQjpp+MEvCG+rSI/euLeJPnZKWHjyK/fl/hV9w4MXC9tQAa8cfoNRDoZbt1nQCNolrCWdRIduOppMKR0af58g2ig5GoTw+VMT6rxymougCkY+tstu90aEFf9W8FqjvHNNJEsZpxVaIGwsOR/C//aLMeM/Hu2lt2q+x0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643049; c=relaxed/simple; bh=2EiBqGmjjFeGbES49N7jBmM1eqO4+flMSSconJRqC+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H7kNgE0mnS7Gu+WBi9xE6F6kK3P1Kpj9kAFx/femhjxGxyjZQsDznciSjRKoGRmTmQN4ncAUayKZJDQSVGuizXgW2dtojn/1JqXahhk9QMeDrrz/SivCHpjXScJXBgceieMspqyVDjm11jvyfTCUacoQap70wTs7gRxyDjNBoTU= 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.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="UZwRpsvg" 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 513Ipdje005920 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-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k3ex10sk-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-f69.google.com with SMTP id 98e67ed59e1d1-2f2a9f056a8so9994930a91.2 for ; Mon, 03 Feb 2025 20:24:06 -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=lzhzGLNGW0g0IZKJwK74t4M76xyY1bVXX2kD+Zjrvd+0sXGysYRYldjJZSwW2kjg/G 6OS2aEE1qVxPBAzuut5coQDDlsYGeVbAohWsrnyTfR7douhw8FvTHK7bywGex/3f/bJ7 osNkXQMIoSmA2zVNQBkCLrigAasBJhjcBnjB/ccR6ukvQB0ld+RtLMCOWYdePFhpPYjU GyASYH63cV1yFu/u/686QlQVKs9KBzstgx43yShZ0Wvbp7LP+4fwZqRFCJjPxqjKxsuR l5Bp8WxbL3OLLB2lxWGwDizDfc2SEvD4CONeHQ2LiqvxrkKwWydrt1Ik6/Yfmj7GaLzF fTJQ== X-Forwarded-Encrypted: i=1; AJvYcCX/NSG2ficHvA1eRro/rV4yJdhKBr5g4i1MG2YIh08ayHNXZmNPOJMJh8Mxia7eYT0X9zvbGFIu8R+wMcc=@vger.kernel.org X-Gm-Message-State: AOJu0YzKDkRoHptHJnWFSckvPX6Uz4EE8kLTYR0ZL5QL2EtgbzoTI2Wa GgjvzNoxmRLB0UU8Nx7qA7YBuIbRFauN47NnsoGZTPr5HTwgR81+YMdgvX31mRoLHAs1BjYM1qW MhskMPbM+XVuApI+DNGEaNSBHtv4f+LnFVrAtme2YOf5cg4+i5Ww15/wgKzGUxdo= X-Gm-Gg: ASbGncskQ2HobixB77C2+UKO1qh/VsShMQO90AxrYheEaU4kd5GtWYkZ5uU2iEM9/AJ 8rvaaI9QKG2bhy7qhb6VE6GrIGvf5oOjQWDqpocnW4zDsAVeNUD1iDTPAkn31GY2H+a0XWGN3oi bVJflCyWiI9NfGMj9UbQcbCuwGzaBHHqKP4UVTNDgM1UXsXgVba40GBGsVEwKPmPnFGVoMvik7a BnYkQMv3jBFE0VbwDu9T1xazUWjeWkpcJUQPk/oxCy12sxux0qTTQv1mALzhLA2KkNtpmogRzLE 7FZUC+CrNYVUqlg6qHfbhAra59nrh6hb2+GAkDz4X81fGs4+sI4QJnwUPobHKtdbVAEzi4FjwEK 4ykN2TyE+xGgSvms6AFaQBDWTuJOz0g== X-Received: by 2002:a05:6a20:1596:b0:1e1:ab51:f531 with SMTP id adf61e73a8af0-1ed7a63cc71mr42599419637.22.1738643045162; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-ORIG-GUID: -CSk0kgU4NxshbAov9BjN-TkqexR1xcX X-Proofpoint-GUID: -CSk0kgU4NxshbAov9BjN-TkqexR1xcX 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, 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/a= th/ath12k/mac.c index 16e6f2fae943d3fa6a46ab1ba6780c9070418279..7defc2b20fb61dcaec06d0e332c= 48a1b6cd2f5d6 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_lin= k_vif(struct ath12k_hw *ah, sizeof(arvif->bitrate_mask.control[i].vht_mcs)); } =20 - /* Allocate Default Queue now and reassign during actual vdev create */ - vif->cab_queue =3D ATH12K_HW_DEFAULT_QUEUE; - for (i =3D 0; i < ARRAY_SIZE(vif->hw_queue); i++) - vif->hw_queue[i] =3D ATH12K_HW_DEFAULT_QUEUE; - - vif->driver_flags |=3D IEEE80211_VIF_SUPPORTS_UAPSD; - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); ahvif->links_map |=3D BIT(link_id); synchronize_rcu(); --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 EE4122036FD 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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513JlhTR028850 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-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k492gvua-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-f198.google.com with SMTP id d9443c01a7336-21655569152so113990175ad.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=Sbdc3Xq9Rq8lQa6vZt+XXmEVE+tfjjh3yB2q+X5qa02Y4plhZ5LqcIbur6V1Ra7tEn mX1Z4QT3aXMsLEZ60dYIhvfmKJPysLIrRyJU9vmitdYXycwsIkkkzDcpSNhoniTXrPFC BASQo8HsOeZFn4C4ixj1FxQfYW5ZswuBgj6lC7o5ZJgANasW9lMpe6OZevAZZu/F/qqQ FFLG+x9SL0agOs4lK2fiC/eC8/qlCc05FBUmwZdAzQmlGHFzIhEZC0K6lzIAoC9m6Ic3 DBfhGngwZv73wF4wYVhAOyQWbKcUuir6r7lpEp5pdp1THj8HNIrkKI8qghJv5ObvNKei WrVw== X-Forwarded-Encrypted: i=1; AJvYcCUOkpijkau6x+xJG2Dhu+mnse2KaQFLrxAJY9D8qg6XBPN1smcBAfvpu+kmb5HhVSaUKy2t81NuWe+zpaA=@vger.kernel.org X-Gm-Message-State: AOJu0YzXmluc9bYCczs3YNSoaAcxP0T1rgOJ+ibIzmufz0h3F1FNtvIE Q76gM64zigTtqVVxFBpM2cyGAyv+/0qOCVaOQav/L3b5U7i4+ZECrCR1erv493fiZmYTyKaI28a g9WeZNhLR/Zthzdemt8IG8EwLLRRMpmwjxfLGAdKi/srF4vJJ/LmXlMYRfrDFXpI= X-Gm-Gg: ASbGncs+07Cmbzw2YGZUBuJqdac6QCbBj/sxpjRjQwuJ+yA6AukUEXj8of7SxqzdCMT gnE2UsiAiR1Ve+Vss6HFBblWv/+gHy+nsZWr6Rpk6Wovfdg3uAavKibaekwB5t5bmpHVOONqFKL asw0G4jzDL1c2s4PmYjSOwgrlctfBDNjpHwLCgrD111lII8MfVU0UeJuaySS3lEf3Jv/f8eZi2l k1HYJoaTTSp0TqOwmAvOQU/nIpK+pJBR7zcyBDciNcBw4u5Nm/fW7EGMCFmQXtbhQyL0tD3Qs2l 9UCGkH0llSMgXiS0lnJ6qA2xNWxNnAUk1W5HLDHmmz8VGoGikBQ2+pix53K41HZ+TtSGcT2dNBe NglGuMjl6owdtQRUmSSKI91+nYbI5lg== X-Received: by 2002:a05:6a21:8dc8:b0:1e0:d934:6189 with SMTP id adf61e73a8af0-1ed7a6e12e6mr41633270637.31.1738643047449; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: X4nWnfbbE4o23hWRGj0VBtC-cEMRCJ_t X-Proofpoint-ORIG-GUID: X4nWnfbbE4o23hWRGj0VBtC-cEMRCJ_t 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 priorityscore=1501 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 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/a= th/ath12k/mac.c index 7defc2b20fb61dcaec06d0e332c48a1b6cd2f5d6..5f0388002e16c38a834d6c7c6c0= 20b7afa7044f0 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); } =20 +static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, + struct ath12k_link_vif *arvif, int link_id) +{ + struct ath12k_hw *ah =3D ahvif->ah; + u8 _link_id; + int i; + + lockdep_assert_wiphy(ah->hw->wiphy); + + if (WARN_ON(!arvif)) + return; + + if (WARN_ON(link_id >=3D ATH12K_NUM_MAX_LINKS)) + return; + + if (link_id < 0) + _link_id =3D 0; + else + _link_id =3D link_id; + + arvif->ahvif =3D ahvif; + arvif->link_id =3D _link_id; + + INIT_LIST_HEAD(&arvif->list); + INIT_DELAYED_WORK(&arvif->connection_loss_work, + ath12k_mac_vif_sta_connection_loss_work); + + for (i =3D 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy =3D 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 >=3D 0) { + rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); + ahvif->links_map |=3D 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 =3D ath12k_vif_to_ahvif(vif); struct ath12k_link_vif *arvif; - int i; =20 lockdep_assert_wiphy(ah->hw->wiphy); =20 @@ -4006,25 +4052,8 @@ static struct ath12k_link_vif *ath12k_mac_assign_lin= k_vif(struct ath12k_hw *ah, } } =20 - arvif->ahvif =3D ahvif; - arvif->link_id =3D link_id; - ahvif->links_map |=3D BIT(link_id); - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); - - for (i =3D 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy =3D 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); =20 - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); - ahvif->links_map |=3D BIT(link_id); - synchronize_rcu(); return arvif; } =20 @@ -8312,19 +8341,8 @@ static int ath12k_mac_op_add_interface(struct ieee80= 211_hw *hw, ahvif->ah =3D ah; ahvif->vif =3D vif; arvif =3D &ahvif->deflink; - arvif->ahvif =3D ahvif; - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); =20 - for (i =3D 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy =3D 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); =20 /* Allocate Default Queue now and reassign during actual vdev create */ vif->cab_queue =3D ATH12K_HW_DEFAULT_QUEUE; --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 22CD4204C09 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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513HfUbR017313 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-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k2e1h6j8-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-f198.google.com with SMTP id d9443c01a7336-2162259a5dcso180404385ad.3 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=JkBry4sbbibJrLpOMEYMkbJ+L+Ayh/vOiuS8amqadkqSMzU0Ybzx/yUbTRzwSay1DB nnumZP92EBKUf98Lg3jNCSaVJw7UM6neABzbIdXFI/X9uCVLRSJxQKGIDnVizs+sdkzk UPI/y+3Yp2bj1y52ZLh9AYeenSbw5D99ejyYAf98bkIDAvax/A1+P5ZMBkpL9hx0O7Yt NMCB6n6tTOFqAtx+muWPvpLwrTdo7F/wmjlv1fnzuU04jhsadtKZXS8CmoiPvpJRRGkn 9yX+7LoswFD0vZLfcxjrL2sASPIPQ6KgtSdWeE48i1ogPpav6EA4JEC8lZ4RcZ7uIwjp 5/aw== X-Forwarded-Encrypted: i=1; AJvYcCXgTX8iwRlKTl1nOe8gzo9+sEmnYwRAhtFQaharJQBoUPZV9lvu9epc6x1N++NmG56IpgsqaeMaZGlYbFg=@vger.kernel.org X-Gm-Message-State: AOJu0YwsjMozsV4N+3MD/A+d9hxpMIdok1HCN0JdSwZTPju12H6ViWYe dtFmdeCLvvRjzwfHm3BaPuluii21EmRnMucLDOsoaykTbNVBO8L4/xOafu00OjzILTUnrHYGRZH +pnMhtNOOVZz3UgvdzsCrLisHMTu/cVB13SPvcytAahd+619/Cklnu3Pw0YmbO1mN7wNioyU= X-Gm-Gg: ASbGncuf9vA/ua3Mt5WATco5IjmK9eX8858fCoyIrPEISs/Q54yfTm7drJNw8tPG6kV ID7SXl6V0t7HuNgU66HfY4EQa/wBqBdJWPTTCWF2mUQVvbt0oJTdR2+mE16LKKWgn8WQ69q9oxb C4LnGM4obuqd4yov2+0Ehhu8P4D5zLijOEq3e/b5y9xEKUneyWR2IDMtnUcttJHJA/kenvyjo5g fKb32fyXAMvHz9RttvdwjpzbmRqYJAxYUmjXBX4B6t3kmLdUOLtgun+/0ANTTnnrPbbQr/tgNyu oRV8YMS4nQuy71zOLw1Iw0t5CIOgpg+rwAjLvEb8fsX8oPw2NxJK/UnYs6MUbs5T/p8e2byF+zn ObAxcR0laTJr4c7UacMxNTr5CXHr/GQ== X-Received: by 2002:a05:6a21:6da5:b0:1e1:dbfd:1fde with SMTP id adf61e73a8af0-1ed7a5e7e38mr38458886637.27.1738643049755; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-GUID: Y1qs13ZPqjsT8sekuyEvT436Ag1XHA3n X-Proofpoint-ORIG-GUID: Y1qs13ZPqjsT8sekuyEvT436Ag1XHA3n 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 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 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/a= th/ath12k/mac.c index 5f0388002e16c38a834d6c7c6c020b7afa7044f0..db866c1419a613103f119037b19= e24b7edaa6c24 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 =3D arvif->ahvif; - struct ieee80211_vif *vif =3D ath12k_ahvif_to_vif(ahvif); - struct ieee80211_bss_conf *link_conf; struct ieee80211_sta *sta =3D NULL; struct ath12k_base *ab =3D ar->ab; struct ath12k_peer *peer; @@ -4686,19 +4683,10 @@ static int ath12k_mac_set_key(struct ath12k *ar, en= um set_key_cmd cmd, if (test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags)) return 1; =20 - link_conf =3D 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 l= ink %u\n", - vif->addr, arvif->link_id); - return -ENOLINK; - } - if (sta) peer_addr =3D arsta->addr; - else if (ahvif->vdev_type =3D=3D WMI_VDEV_TYPE_STA) - peer_addr =3D link_conf->bssid; else - peer_addr =3D link_conf->addr; + peer_addr =3D arvif->bssid; =20 key->hw_key_idx =3D key->keyidx; =20 --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 BBD34204C2B for ; Tue, 4 Feb 2025 04:24:13 +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=1738643055; cv=none; b=ZwWweOIE5nTde2P8mC/KU8psyEvUSUrD+BHiCCihc4sSAkRZsd2a83EbluXqMe8gbMznRIdyITsmTH77V02+feviYA6FHHzlEvO/qYazz8xWjOtzYBmSIr3er2AwHxsdlEkxtOet1dy5rCk3/MMdJdCnx1TX41hsXL4/2eQj5dU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738643055; 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=NDj0Ddhtfmk8QezH3/gkAJ78T4Zn6rFRv2kK86ULkjAOuCAhMMPrFNI7ud47JleD6XZZZ3fKg9oVljilKZGzNqIFAUyavnMjKvN3NQt6YbvoGU7iSDDT0jJ7o561ij79TAIJ6OGuNy7y0jl2vizqC24pgPxvDdLfM5zznJP0HPI= 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.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="eX1zT/y8" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513JlUjh028499 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-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k492gvuj-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-f197.google.com with SMTP id d9443c01a7336-2161d5b3eb5so106772915ad.3 for ; Mon, 03 Feb 2025 20:24:12 -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=LHlEAjzBqqKGGAcHJOP7Ia6KtMH8T743UNdEUY0szEDKtbfUIQynaiDwG1l3yas/Vd Fv24uspRlMcndA+/Q3UfaBtw1NhckvrgaHgDiEIvJXpzgnSp7UzAbQ6FGvIBLzHkq8YH e8zMKvjeelRmHLy3SSk4DvpEmvOWZ/0Pl0DGQZvMgLg7g4Vv7ivI8FJL2H9QS2m43mOx NRt1lXnNZD9PxA55gu44ZVu66IpzMUKyDBLJG+M0tI3YFxtAwi+mwAFiXX7DDMPrYlKL aW+dGEL3FePPQAMvnfIeG2Q0m1RkKOn/mSJ48i0tcwqhYgbLbD90VBMsI8uxiLeC6rHK 7o4Q== X-Forwarded-Encrypted: i=1; AJvYcCWuQn2dvgyZDTPbvSTw3Ew60ytG+MxNinaYceVS4tc/Ntj2jF6SY0bRWkb+xV7mftV+VFTrVqrL8hgDtus=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4DFFkxGrh6rLWVQbQ985RDjYzBZQqJlOGfV0VPieAx/n+aCY/ pBb1KGXTu4MsAQoEE6Ehz2gU+t6SnvQ7HzyY9HqkNiilE6N33r2KNxrjuT+vJc56xx35HQoyChr CTP7XTVrPvlIijpotIn4SQJeVgrxs8ZzcdtTwVl0iT5ybFzZRnZUPtEt1oot34Ks= X-Gm-Gg: ASbGncunWipNbzRGiZgaDMXUGif1pau25U5Ilnx/ET5Dtbhuxbky5/03OJssU86grzi oQEjJNCtkARsn+eNhbYmv7JOgNJi5NgQYLdoF9+GRwCWRvfhXoqzXOM9gQMY+f+/FoS+yoYmkzW 8zxfFa4R0mysHVmUF+do/8rbYRMPoSQ4TSGwW23Uo9V5VBuoFynDXeDikT4SDrG9GlXknq+b5vd H57kiDeZFYoxmXHfLgmkFhZy5s+C4SbNTAKRfHB4JB2wvY4U4TvriAtxlV5qxK5mrAA3QqjRycd R2BPqQjyxPMfNCM+wslbPI6pdE+kkeuptsQ2Ju/r+hWUJ5gGfpBrtTnnI0Bah0N74mXG/YUnkmn jC/6j87HR6NAiWwWNcVNRqWurIMzJuw== X-Received: by 2002:a17:902:d48e:b0:21a:5501:938 with SMTP id d9443c01a7336-21dd7e38e38mr386772175ad.52.1738643052101; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: GLAoSFVeofVu3_C5NlvMEhF9czSxSQvJ X-Proofpoint-ORIG-GUID: GLAoSFVeofVu3_C5NlvMEhF9czSxSQvJ 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 priorityscore=1501 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 mlxlogscore=976 bulkscore=0 spamscore=0 clxscore=1015 phishscore=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/a= th/ath12k/mac.c index db866c1419a613103f119037b19e24b7edaa6c24..5d80bbb664ea6a710eedd7b57db= 3523df9c893e6 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 ath= 12k *ar, ath12k_warn(ar->ab, "failed to set beacon tx rate %d\n", ret); } =20 +static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, + struct ath12k_link_vif *arvif, int link_id) +{ + struct ath12k_hw *ah =3D ahvif->ah; + u8 _link_id; + int i; + + lockdep_assert_wiphy(ah->hw->wiphy); + + if (WARN_ON(!arvif)) + return; + + if (WARN_ON(link_id >=3D ATH12K_NUM_MAX_LINKS)) + return; + + if (link_id < 0) + _link_id =3D 0; + else + _link_id =3D link_id; + + arvif->ahvif =3D ahvif; + arvif->link_id =3D _link_id; + + INIT_LIST_HEAD(&arvif->list); + INIT_DELAYED_WORK(&arvif->connection_loss_work, + ath12k_mac_vif_sta_connection_loss_work); + + for (i =3D 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy =3D 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 >=3D 0) { + rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); + ahvif->links_map |=3D 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 =3D ath12k_vif_to_ahvif(vif); + struct ath12k_link_vif *arvif; + + lockdep_assert_wiphy(ah->hw->wiphy); + + arvif =3D 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 =3D 0; + arvif =3D &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 !=3D ATH12K_DEFAULT_SCAN_LINK) { + arvif =3D &ahvif->deflink; + } else { + arvif =3D (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 =3D arvif->ahvif; + struct ath12k_hw *ah =3D ahvif->ah; + + lockdep_assert_wiphy(ah->hw->wiphy); + + rcu_assign_pointer(ahvif->link[arvif->link_id], NULL); + synchronize_rcu(); + ahvif->links_map &=3D ~BIT(arvif->link_id); + + if (arvif !=3D &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); } =20 -static void ath12k_mac_init_arvif(struct ath12k_vif *ahvif, - struct ath12k_link_vif *arvif, int link_id) -{ - struct ath12k_hw *ah =3D ahvif->ah; - u8 _link_id; - int i; - - lockdep_assert_wiphy(ah->hw->wiphy); - - if (WARN_ON(!arvif)) - return; - - if (WARN_ON(link_id >=3D ATH12K_NUM_MAX_LINKS)) - return; - - if (link_id < 0) - _link_id =3D 0; - else - _link_id =3D link_id; - - arvif->ahvif =3D ahvif; - arvif->link_id =3D _link_id; - - INIT_LIST_HEAD(&arvif->list); - INIT_DELAYED_WORK(&arvif->connection_loss_work, - ath12k_mac_vif_sta_connection_loss_work); - - for (i =3D 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy =3D 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 >=3D 0) { - rcu_assign_pointer(ahvif->link[arvif->link_id], arvif); - ahvif->links_map |=3D 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 =3D ath12k_vif_to_ahvif(vif); - struct ath12k_link_vif *arvif; - - lockdep_assert_wiphy(ah->hw->wiphy); - - arvif =3D 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 =3D 0; - arvif =3D &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 !=3D ATH12K_DEFAULT_SCAN_LINK) { - arvif =3D &ahvif->deflink; - } else { - arvif =3D (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 =3D arvif->ahvif; - struct ath12k_hw *ah =3D ahvif->ah; - - lockdep_assert_wiphy(ah->hw->wiphy); - - rcu_assign_pointer(ahvif->link[arvif->link_id], NULL); - synchronize_rcu(); - ahvif->links_map &=3D ~BIT(arvif->link_id); - - if (arvif !=3D &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) { --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 BCF702054F9 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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 513HfTce017305 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-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k2e1h6jf-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-f198.google.com with SMTP id d9443c01a7336-2166a1a5cc4so109662385ad.3 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=hCHrhPFWWpwTj0Hq+pqLFwze9WBLqBQMeMvtldOY6r5IePO0H1InBEVe0xWnmNWFQB ipEwPZAPDUB/E2b5d3ZJ2H9lUXDFBP4eWehPx7yvU4jiu/ZOj1NMk7O0GkzpffcJRWPv 4M0AaXVTws2SqnuUc/ADB7f+lHXjcsdkpJkfgmnJi3p22Qp2fz9bw6yt4hZefhwwKLK4 Ua6gh14OQNEeP1eNpvSFr62Ebosk95vLnP9WJl0gGgYgppG76wvW3hrABl2A/iAXpcfQ LwN0iUFuEdVc0qooxQcB2pI1/hAUKO6tOIlXJu+kO0pHX7nLWB3d2OsM3xMH7uCH/PmR 9fTA== X-Forwarded-Encrypted: i=1; AJvYcCWzXxM34a+fThXYVmoHM0Yq1ROYpan5mDuk0DBMaDJ4AYQ506VC+mbf3sXLBJdXw6sllqvlxF8p90H3R/w=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7YecsQmE5nM3FXjEtmHOI7LwvdDfXIqxkFMiRrNEsl+v2Cvk2 YbE/liV9vZhtZUmIoSmfvI+iJlhMOEncBVy8QkpKaEelp884AXB2ugmiTvmlWjzNNTCFp2JiaJi np9gcxP2yCPFzTRwrsYotgJkOGwcIm1rq64nawRv3hqNGvTgFTBZ2ULz9ki4enh8= X-Gm-Gg: ASbGncv7Tz+5GSjHm7Xu9X6rV9akjPokAf8W76ZbgPYylTf7UtTrkr95UBFcWC6enAH AcfVre5NY7MOfastb0ae4yr14JReKv8R/lvnvoF3pkGJwMlTwd6C2BtGDb39eznd8cSX0dNZ492 pZhgzheQUkNkAeRi1RxY3MiKgyxj3orL1BnPexjqjYVpuqjsiFR+AscsIM4YOVR4Ik2ZYKirErC 9h+R1NV0iMGSWvvrh9NJ/4IlQ2/zPho2cwjDuuJeXrINO3Fkny9DcdTwvmexRW6PDBCMo8ubM9j PSIzcGhfsUVxcISNjt4aoOGGac/Oy63ZbAA2vqt4ElHgoMYyydliVtogjAAfJnsECguVaEOR+Dt p6DrSnx8cUv4bYZfKEQAlzYqxmSipUQ== X-Received: by 2002:a05:6a21:3284:b0:1e8:bd15:6845 with SMTP id adf61e73a8af0-1ed7a5a50eamr38531507637.1.1738643054298; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-GUID: qEQnIvG61aHmgi0MziYLYAYx65lH8NsC X-Proofpoint-ORIG-GUID: qEQnIvG61aHmgi0MziYLYAYx65lH8NsC 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 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=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/a= th/ath12k/mac.c index 5d80bbb664ea6a710eedd7b57db3523df9c893e6..b9017002f3efb27d917f0aa35a0= ecc66af18ec99 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 =3D ath12k_vif_to_ahvif(vif); + unsigned long to_add =3D ~old_links & new_links; + struct ath12k_hw *ah =3D 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 =3D 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 =3D ath12k_mac_assign_link_vif(ah, vif, link_id); + if (WARN_ON(!arvif)) + return -EINVAL; + } + return 0; } =20 @@ -8765,6 +8790,9 @@ ath12k_mac_mlo_get_vdev_args(struct ath12k_link_vif *= arvif, if (arvif =3D=3D arvif_p) continue; =20 + if (!arvif_p->is_created) + continue; + link_conf =3D wiphy_dereference(ahvif->ah->hw->wiphy, ahvif->vif->link_conf[arvif_p->link_id]); =20 --=20 2.34.1 From nobody Sun Dec 14 08:07:04 2025 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 29C672063C8 for ; Tue, 4 Feb 2025 04:24:18 +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=1738643060; cv=none; b=nvMjQX4NwJJQT2ReyU/fB6d6tiPDQ+a0uCRiipCBCsMaTsjRrUPFgzcGSZOzcv4JUWhRE1pZTKKZ4Zt+JxsDepWS+zqX9I0CkUwS5PL/tqWUw4nLsdIbBdlR0q8ck7M9xmWvnc76pbCTYGbtYp8COpA0e000RfTWyB1lgRjXYWU= 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.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="AkJz/G+9" 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 513IaqXQ008831 for ; Tue, 4 Feb 2025 04:24:18 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-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44k37u120d-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-f198.google.com with SMTP id d9443c01a7336-21effc75088so9690355ad.2 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=S3VA0bECdWBpunA3fyHfTVeiVW0NbcXLGIlfXGLHYJgH2lCrgxKsGivwXXigtA4LCe 70vMU3uU/8bH36tw+1RZShZGqlRV8NUKeXrIeAhR+zzDlMzv6W+cBop0ZkJLHhyExNaM mpVL6ujGqc1Ms5pC3Ii/0d/7Jm9dCVrO8GWrMz4uNT4Mx0CSLjTWF7/cTvmWbKcNv+BT 5C4UKIK4R4W40rXp2kA5SnWcwTX7Zn/NhpOL0PovWg18jDdY8Vl3j+NEXudAws4e7ynh F0mzitTD6kn0bVzpbtgIfsolEIVmjZraGk7Da3UukLPty/LVOrJH2P2e3sNwfxNN+Y+3 CjDg== X-Forwarded-Encrypted: i=1; AJvYcCUbhf2IrLFAJyth/Ddwrf/w3fIe4RF1uGDrYybjEtg1Nqa7jv0rmak7z0odLEE3aqEquLTjOj68Qi0VDe8=@vger.kernel.org X-Gm-Message-State: AOJu0YxuWoZeMq6AxsT+GISadgb3Dk3aDCnuZmFZfgFCCLw9OyILFRtz iAg+Tir7Pcud5k23O3Ug86K8NIONaaeAiAefS+uTkuiRSzpJ6s7+zODpV5KSS48vMnwQnCbw/8S pFillg4w2gwUyafEFKTVQ1fbu4uBP67HsXh6AcnG4uIaZrUm2JdeEmtUrxHLo2tk= X-Gm-Gg: ASbGncuB4RpD9QyjqsM/f6P3mwj3BotpzjfGVNgw1cZMrS9YYS14vvQZcf6vxo9BUo6 bQSsUP7ahFA6h12W2valPrBrB9g6s9VTjOJS/no09Wjc+AZfqdO2t1n0Zt2LYGD0KsL5EwqNabE kb4Ijw8epmjJjIXoPCnjDfd9K8JUWudzrHXgzzJPOk2CrHQUhe7Bs322l7hIFO2RGPZCb7oZILj Qy+N42U0YPQb5/cwY3rvKIcXN0wjpHPCAxUWlrlK42T/sziVq4sujeQkbd3RmqaTQGwduIXjYML ZsWSGIGxTzbiBSM79zGOr0N5FEcpQWPUkmxSN6Z6yM1t36WdZoWWo88w0YwtZVXFMFLvoYRLd8f 1g/FC8JG7T5H5K0iE0MQTe1jNTRGRRg== X-Received: by 2002:a17:902:f606:b0:215:89a0:416f with SMTP id d9443c01a7336-21dd7d82c71mr370635105ad.30.1738643056473; 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-ORIG-GUID: aPBswuF508JGdUKtRA7wnTUin663m19h X-Proofpoint-GUID: aPBswuF508JGdUKtRA7wnTUin663m19h 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, 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/a= th/ath12k/mac.c index b9017002f3efb27d917f0aa35a0ecc66af18ec99..d965ae2e755821ea5bfa366a5d7= 4263020e5dee5 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 =3D ath12k_vif_to_ahvif(vif); + unsigned long to_remove =3D old_links & ~new_links; unsigned long to_add =3D ~old_links & new_links; struct ath12k_hw *ah =3D ath12k_hw_to_ah(hw); struct ath12k_link_vif *arvif; u8 link_id; + int ret; =20 lockdep_assert_wiphy(hw->wiphy); =20 @@ -3601,6 +3603,31 @@ ath12k_mac_op_change_vif_links(struct ieee80211_hw *= hw, return -EINVAL; } =20 + for_each_set_bit(link_id, &to_remove, IEEE80211_MLD_MAX_NUM_LINKS) { + arvif =3D 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 =3D 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; } =20 @@ -4100,7 +4127,8 @@ static void ath12k_mac_op_link_info_changed(struct ie= ee80211_hw *hw, } =20 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 =3D arvif->ahvif; struct ath12k_hw *ah =3D hw->priv; @@ -4111,7 +4139,9 @@ static void ath12k_mac_remove_link_interface(struct i= eee80211_hw *hw, =20 cancel_delayed_work_sync(&arvif->connection_loss_work); =20 - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac remove link interface (vdev %d li= nk 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); =20 if (ahvif->vdev_type =3D=3D WMI_VDEV_TYPE_AP) { @@ -4120,7 +4150,9 @@ static void ath12k_mac_remove_link_interface(struct i= eee80211_hw *hw, ath12k_warn(ar->ab, "failed to submit AP self-peer removal on vdev %d l= ink 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); } =20 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); =20 - ath12k_mac_remove_link_interface(ah->hw, arvif); + ath12k_mac_remove_link_interface(ah->hw, arvif, true); ath12k_mac_unassign_link_vif(arvif); =20 work_complete: @@ -4436,7 +4468,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw = *hw, return -EINVAL; =20 if (ar !=3D 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 =3D false; @@ -8274,7 +8306,7 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(s= truct ieee80211_hw *hw, ahvif->link[ATH12K_DEFAULT_SCAN_LINK]); if (scan_arvif && scan_arvif->ar =3D=3D ar) { ar->scan.arvif =3D 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(s= truct ieee80211_hw *hw, if (WARN_ON(arvif->is_started)) return NULL; =20 - 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 iee= e80211_hw *hw, spin_unlock_bh(&ar->data_lock); } =20 - 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_h= w *hw, ar->num_started_vdevs =3D=3D 1 && ar->monitor_vdev_created) ath12k_mac_monitor_stop(ar); =20 - ath12k_mac_remove_link_interface(hw, arvif); - ath12k_mac_unassign_link_vif(arvif); + ath12k_mac_remove_link_interface(hw, arvif, false); } =20 static int @@ -10293,7 +10324,7 @@ static int ath12k_mac_op_remain_on_channel(struct i= eee80211_hw *hw, return -EBUSY; =20 if (ar !=3D 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 =3D false; --=20 2.34.1