From patchwork Thu Aug 25 11:18:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikanta Pubbisetty X-Patchwork-Id: 12954552 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C39B9C64992 for ; Thu, 25 Aug 2022 11:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241427AbiHYLSv (ORCPT ); Thu, 25 Aug 2022 07:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239077AbiHYLSu (ORCPT ); Thu, 25 Aug 2022 07:18:50 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A618BAEDA3 for ; Thu, 25 Aug 2022 04:18:49 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27P4Q35O010129; Thu, 25 Aug 2022 11:18:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=gpOoq6K+fdQ+vkPooeACGPDLk/61cBBk1wvVavXaks4=; b=pNuysyc45QkKU1S8aEMWqEtHY88uZBnM99LHX841toYcVf9L+1J/Kf0n8wQn6szZ5tHe UBvUpv+yPEHmRRmd3le+mVDSXgPnvH6FdfczhLvD/cfQNLHPDSXJ1cz+0N/JJ9+7kctn TidrNkrDV+Z1ZTo3oqJCbA56e5kA5b4mWnlIVmir5EAnU5f1mX5duHl6WYyGHbedc9qF twVTr152SEpYLVx90w3LcD0fJRHF21GVhid8fJrCOpju23GCnc61PoneTF/ipK/K4/x4 RRa8kDRQ/NYVGsoitA8mXHSObvO8eY7CUnkiwEOJ88NVTZu3P7TxZvJb8AxD6/R+17Fy HA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3j60etsawm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Aug 2022 11:18:44 +0000 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 27PBIi0E017280 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Aug 2022 11:18:44 GMT Received: from mpubbise-linux.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.986.29; Thu, 25 Aug 2022 04:18:42 -0700 From: Manikanta Pubbisetty To: CC: , Manikanta Pubbisetty Subject: [PATCH v2 4/4] ath11k: Fix failed to parse regulatory event print Date: Thu, 25 Aug 2022 16:48:18 +0530 Message-ID: <20220825111818.30869-5-quic_mpubbise@quicinc.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220825111818.30869-1-quic_mpubbise@quicinc.com> References: <20220825111818.30869-1-quic_mpubbise@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] 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: gerrdOcMt0w5DMjOZdVMPZHFLGFplBt3 X-Proofpoint-ORIG-GUID: gerrdOcMt0w5DMjOZdVMPZHFLGFplBt3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-25_05,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208250044 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In the continuous WiFi ON/OFF scenario, we see a lot of "failed to parse regulatory event" prints on the console. This is because we already would have created a regulatory domain for the wiphy and we will discard the subsequent events to create the same regulatory event. Fix this error print by freeing up the regulatory resources in WiFi OFF and create the database again in WiFi ON. The same applies for hardware recovery as well. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty --- drivers/net/wireless/ath/ath11k/core.c | 3 ++- drivers/net/wireless/ath/ath11k/reg.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 88a54b36e178..6002bd7b7799 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -1175,7 +1175,6 @@ static int ath11k_core_soc_create(struct ath11k_base *ab) static void ath11k_core_soc_destroy(struct ath11k_base *ab) { ath11k_debugfs_soc_destroy(ab); - ath11k_reg_free(ab); ath11k_qmi_deinit_service(ab); } @@ -1471,6 +1470,7 @@ static void ath11k_core_reconfigure_on_crash(struct ath11k_base *ab) mutex_unlock(&ab->core_lock); ath11k_dp_free(ab); + ath11k_reg_free(ab); ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - 1; } @@ -1844,6 +1844,7 @@ void ath11k_core_stop_device(struct ath11k_base *ab) ath11k_thermal_unregister(ab); ath11k_dp_pdev_free(ab); ath11k_dp_free(ab); + ath11k_reg_free(ab); } EXPORT_SYMBOL(ath11k_core_stop_device); diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c index 7ee3ff69dfc8..0aa4c7b039d0 100644 --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c @@ -757,5 +757,7 @@ void ath11k_reg_free(struct ath11k_base *ab) for (i = 0; i < ab->hw_params.max_radios; i++) { kfree(ab->default_regd[i]); kfree(ab->new_regd[i]); + ab->default_regd[i] = NULL; + ab->new_regd[i] = NULL; } }