From patchwork Wed May 29 04:30:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13677761 X-Patchwork-Delegate: kvalo@adurom.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B35820311 for ; Wed, 29 May 2024 04:31:15 +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=1716957078; cv=none; b=mfHhDhGe7PheaLrUjhz/zbJjPIk2H5hAjULWodNaBcbvZH0Gwom3oGSDWOrsvI96PFfN+VcNYUBvgpFCX70mHeJvMXmIRQOoi6gqQt18N5O4pqKcPki+CqAh709ldbRFoU7qYH55Sxbz/Xw5LHJnoDACpsm07DHTQG04yeCzTNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716957078; c=relaxed/simple; bh=TsbdgBIuXkaiYXuCGblAZt7F8d1QCaRIZ3qWNogR26E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RzASM+d5f1nGtOSF27FMT1nNsYFqAlMQHZ9HZhTq/mGHk+59/0pMCrUvamCYmshjNG06dQ1LKUcsdZCTPdoKTlyRR67ggMSqIgnumCJnjyTprNmHtQ5vok0KDP6F7Wynph+bgP/umN1o/EAxgXKlEsUaDtAIollfAMTRVqcVCVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ALn8jDp6; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ALn8jDp6" 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 44T0VGw0015671; Wed, 29 May 2024 04:31:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iN3HAAv6f7vBHYns3kVLpDsY7GbzgoD9/Rl7ps1uS+Q=; b=ALn8jDp60i7Az823 f4KfKVkXBwBMAoZN+A0ZuJ1gudU2+df6FWVrCvtT+l6KXHyI3xOvHUhV8z0w0vgm VwKQ4164LkcbnbeFphYN/7k/O35jP9Sng/SPSPyhpQWyMqWqlBBuv9nnvCpx+Iiz X9Yf7dKYNV6GkVs5AhWh1Umi48so9NFrF/SB/WwHnzOaoPTDlWa5BTBPlwXD5bsS qXIsQAC52meHnphJA3ncoaxBktXgJvrBRxzUjJ6sedTs8rcSRJ/heEwSWGxzJhpO ZsSvmyjSXeDJfBHo/h0z/Yk+XGuTj85wNkWgdoa4dqMQT1vaKM+oy+IgoNLcktya QefBng== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yb9yj81ta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:09 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44T4V8lU030539 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:08 GMT Received: from hu-adisi-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 28 May 2024 21:31:06 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 1/3] wifi: ath12k: fix per pdev debugfs registration Date: Wed, 29 May 2024 10:00:41 +0530 Message-ID: <20240529043043.2488031-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529043043.2488031-1-quic_adisi@quicinc.com> References: <20240529043043.2488031-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: r0M6-jbi88Lct5DEgkLPJO84FcKuOGy9 X-Proofpoint-ORIG-GUID: r0M6-jbi88Lct5DEgkLPJO84FcKuOGy9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-28_14,2024-05-28_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 impostorscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405290025 Function ath12k_debugfs_register() is called once inside the function ath12k_mac_hw_register(). However, with single wiphy model, there could be multiple pdevs registered under single hardware. Hence, need to register debugfs for each one of them. Move the caller inside the loop which iterates over all underlying pdevs. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Fixes: f8bde02a26b9 ("wifi: ath12k: initial debugfs support") Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 784964ae03ec..beec42d4ec24 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -9077,9 +9077,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) ath12k_err(ar->ab, "ath12k regd update failed: %d\n", ret); goto err_unregister_hw; } - } - ath12k_debugfs_register(ar); + ath12k_debugfs_register(ar); + } return 0; From patchwork Wed May 29 04:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13677762 X-Patchwork-Delegate: kvalo@adurom.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 5F28743ACC for ; Wed, 29 May 2024 04:31:17 +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=1716957078; cv=none; b=R+NXNwNTteFfzwHcg0HeD0sDiW0+BBRGif/BSUTiI/H4RYZyOn+bJ2s47w7naQni8aoKooD+agVNgiZZ1w16L5200xA1vV8gEzX0+MNbnXrEJBJaMXtFTOUXPoQfSUiQUzphrT0nyf5y1iIVnuQ42QeF1S5VLMRoU/i73zMUA8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716957078; c=relaxed/simple; bh=VPiaJKpFXRmyw+k7gFGPS6fHHC0IhN2d0T09FhvbU28=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s1qG/iNAiioeGvH2WuMtvRFAqdza/NuLzelMWWjOc7A+sIEBdfVSO2eAGQFDo2YDkjL9BX2UvO7Wb8y+FUHua4f8nT8V62n7E9UVmUfkf17OCierp485hT8Q48K/0W2XBjpvys/fCwxQj/92FzaRaMVJurZK7xlC++uUryUxmr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ExYIU4Ny; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ExYIU4Ny" 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 44SLlh1b030864; Wed, 29 May 2024 04:31:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= XqV/OMrOhbJVxSfLWE6KiaAMCXjZncyUMWZDNF36pVU=; b=ExYIU4NyygBgxL0m 1q9hqnu7Whe4w3xloAbUlrSUR/sedl9eSvqiKDkxbZJdE1nqf+CFvAnY90+hTnNU NbNeyNVsFoC49BvHQ91Y/MQWtXCrHITfBXK7NXH+X/SisDtGH0cxMge46oF/CrNG DikA6+sofmDQKnX+2z38W0XUcQ2o7nEMZDkqdOb2ZztFzXxDyJ1gHIrkE+t3rFdt JXvT4DZTAsAOZfCwxsVCB2Q628T+j7jG6yUl1k3fTMuzI0gQnQVOnuoSZ9qVQbLn Xo27TbRKYKpObC2ksu055+l4m6rmrCvocv/dwPsbsKPkcOb17SboaUvplztJxhXu TPdQFA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yba2pr1u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:11 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44T4V9s9010670 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:09 GMT Received: from hu-adisi-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 28 May 2024 21:31:08 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 2/3] wifi: ath12k: unregister per pdev debugfs Date: Wed, 29 May 2024 10:00:42 +0530 Message-ID: <20240529043043.2488031-3-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529043043.2488031-1-quic_adisi@quicinc.com> References: <20240529043043.2488031-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: lcm4Dvgl27ZMcn_LGpLw63P_lpesYe6j X-Proofpoint-ORIG-GUID: lcm4Dvgl27ZMcn_LGpLw63P_lpesYe6j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-28_14,2024-05-28_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 phishscore=0 mlxlogscore=992 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405290025 During normal de-initialization path or if any error happens while registering the hardware, there is no support to unregister the per pdev debugfs. Add support for the same. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/debugfs.c | 10 ++++++++++ drivers/net/wireless/ath/ath12k/debugfs.h | 6 +++++- drivers/net/wireless/ath/ath12k/mac.c | 7 ++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c index 8d8ba951093b..3b464cd40da6 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs.c +++ b/drivers/net/wireless/ath/ath12k/debugfs.c @@ -88,3 +88,13 @@ void ath12k_debugfs_register(struct ath12k *ar) &fops_simulate_radar); } } + +void ath12k_debugfs_unregister(struct ath12k *ar) +{ + if (!ar->debug.debugfs_pdev) + return; + + /* TODO: Remove symlink under ieee80211/phy* */ + debugfs_remove_recursive(ar->debug.debugfs_pdev); + ar->debug.debugfs_pdev = NULL; +} diff --git a/drivers/net/wireless/ath/ath12k/debugfs.h b/drivers/net/wireless/ath/ath12k/debugfs.h index a62f2a550b23..8d64ba03aa9a 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs.h +++ b/drivers/net/wireless/ath/ath12k/debugfs.h @@ -11,7 +11,7 @@ void ath12k_debugfs_soc_create(struct ath12k_base *ab); void ath12k_debugfs_soc_destroy(struct ath12k_base *ab); void ath12k_debugfs_register(struct ath12k *ar); - +void ath12k_debugfs_unregister(struct ath12k *ar); #else static inline void ath12k_debugfs_soc_create(struct ath12k_base *ab) { @@ -25,6 +25,10 @@ static inline void ath12k_debugfs_register(struct ath12k *ar) { } +static inline void ath12k_debugfs_unregister(struct ath12k *ar) +{ +} + #endif /* CONFIG_ATH12K_DEBUGFS */ #endif /* _ATH12K_DEBUGFS_H_ */ diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index beec42d4ec24..381fee8ca748 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -8836,8 +8836,10 @@ static void ath12k_mac_hw_unregister(struct ath12k_hw *ah) struct ath12k *ar; int i; - for_each_ar(ah, ar, i) + for_each_ar(ah, ar, i) { cancel_work_sync(&ar->regd_update_work); + ath12k_debugfs_unregister(ar); + } ieee80211_unregister_hw(hw); @@ -9084,6 +9086,9 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) return 0; err_unregister_hw: + for_each_ar(ah, ar, i) + ath12k_debugfs_unregister(ar); + ieee80211_unregister_hw(hw); err_free_if_combs: From patchwork Wed May 29 04:30:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 13677763 X-Patchwork-Delegate: kvalo@adurom.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81A0613D899 for ; Wed, 29 May 2024 04:31:17 +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=1716957078; cv=none; b=iFuO+wn+6b/RftB4ODMs+YMEltDcMKlqZgwAOyZ7Ky8+zL80wSDjL9Vs04ANOrT28nY/tRuYlWHq32nOD56yYTMblUpPpgjsqO2CGFXUtxN9JlrHno+42wk8NgwdwFiNeX/smkahdIVPlftVeraWe/M/GZZhzgmejj0H7ev29KE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716957078; c=relaxed/simple; bh=UmSIwMM8vYBUxnX8Kub7+tNBnqVlPwhVAnhMDN+CeZg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HkhN6O5liGkRjNrE199eVBuLHBXBVYLyhRuw1UuhUqZk3L9L/NPH6hQDewrYWl0ZbT5C9nAGI/l90uhyTZHE7hjwxEJmWQHP/GLXtcq0Kn0QwSLYI0/Uot/cy8LbfdJ0yXvybRfr6d2taYyKZNBTrLwqP/YoTvgznLihqDg4lN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=lOh7WaxD; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="lOh7WaxD" 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 44SMGtQu010169; Wed, 29 May 2024 04:31:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= QhKvaLf+cz/0/SwEWuvLpjy1RgvayoIRI+//7DEZS38=; b=lOh7WaxDC8EHfqZ1 R9qmDZBohZaAQloMSnqy+msV4uDD7CVOzO5IW5R0Y2qRD2zvXoo5OFqWOHmaofZm rbG/mJGfWRxAmdOLMdFVUWqfeFomHHjffEQ/qykcNkyM1n9FHNLKTv8KtR30C2IG 0J+mae7BbYs/95vHpeFsV8JnEQejSE2/v3/6aSTx/dyqA19YIh9cJNyNJsN2jfhZ dPppCJ6JWf55RMlI8JFp/jWPLMtDbZD86QdyOhf+1arjzMuUvuAQY8Qad34R2Kuy hB4QlpUBKS1UMfOZ2Ox5IcLZs/lCn4gNXv+CMce26MuDMbgZ62zUE5dKmFoR4R6l PkBV4A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yba2myx5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:13 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44T4VCY4030593 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 May 2024 04:31:12 GMT Received: from hu-adisi-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 28 May 2024 21:31:10 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 3/3] wifi: ath12k: handle symlink cleanup for per pdev debugfs dentry Date: Wed, 29 May 2024 10:00:43 +0530 Message-ID: <20240529043043.2488031-4-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529043043.2488031-1-quic_adisi@quicinc.com> References: <20240529043043.2488031-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ozb3t9v81kMWpiU6DGDLSf_sJauKa4gP X-Proofpoint-ORIG-GUID: ozb3t9v81kMWpiU6DGDLSf_sJauKa4gP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-28_14,2024-05-28_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405290025 Whenever per pdev debugfs directory is created, a symlink to it is also placed in ieee80211/phy* directory. During clean up of per pdev debugfs, this symlink also needs to be cleaned up. Add changes to clean up the symlink whenever the per pdev debugfs is removed. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/core.h | 1 + drivers/net/wireless/ath/ath12k/debugfs.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 7d20b09c52e6..87cb3fde68c2 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -473,6 +473,7 @@ struct ath12k_fw_stats { struct ath12k_debug { struct dentry *debugfs_pdev; + struct dentry *debugfs_pdev_symlink; }; struct ath12k_per_peer_tx_stats { diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c index 3b464cd40da6..751a9b04386a 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs.c +++ b/drivers/net/wireless/ath/ath12k/debugfs.c @@ -80,7 +80,9 @@ void ath12k_debugfs_register(struct ath12k *ar) /* Create a symlink under ieee80211/phy* */ scnprintf(buf, sizeof(buf), "../../ath12k/%pd2", ar->debug.debugfs_pdev); - debugfs_create_symlink("ath12k", hw->wiphy->debugfsdir, buf); + ar->debug.debugfs_pdev_symlink = debugfs_create_symlink("ath12k", + hw->wiphy->debugfsdir, + buf); if (ar->mac.sbands[NL80211_BAND_5GHZ].channels) { debugfs_create_file("dfs_simulate_radar", 0200, @@ -94,7 +96,9 @@ void ath12k_debugfs_unregister(struct ath12k *ar) if (!ar->debug.debugfs_pdev) return; - /* TODO: Remove symlink under ieee80211/phy* */ + /* Remove symlink under ieee80211/phy* */ + debugfs_remove(ar->debug.debugfs_pdev_symlink); debugfs_remove_recursive(ar->debug.debugfs_pdev); + ar->debug.debugfs_pdev_symlink = NULL; ar->debug.debugfs_pdev = NULL; }