From patchwork Tue Oct 29 17:30:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 839371 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 29680209F55; Tue, 29 Oct 2024 17:31:38 +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=1730223101; cv=none; b=piQ0n1TQdKUCr+XtkoVfsrZUlN9LiuYJ0WXvcLDsdAsHCbh3pt3eb7bdan286F4m9ZmI7SLuNZ3sPhdEtOGOeA61sCpvWFB59+b/KXTrZphT2QJ3RT0E1gIrcdriYmt67nJ5snYSYvG3HAOz1llbQgLEdTzQsY66Z0N2MK+TeLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223101; c=relaxed/simple; bh=ezdt/xjV6eeEh8ySedXwkeEeiIkGtHY/naUu6Go1u1g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S7OwATECLP3u7l8ilQMnpvA660tnkGVjtCQgAv84Xe6lLrvlmwnEboKJjBIXwRBnIBK8wbA7UcoCOjqaKro26L3gmq9AkFvMBQAX7iwj6B/2EuCAGN1PeoOC6w/BuHuCEDGkqgljmkuXWURwocAA73725XDJr8Ht8dprGIpXRPQ= 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=I813tiGJ; 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="I813tiGJ" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49TAaNwR013129; Tue, 29 Oct 2024 17:31:31 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= 5xoMNr+5RKeB4Zhsppi1kqysRJPtuusOykLQ1SgCZ+E=; b=I813tiGJMX3PYMYc puZEfUPCVQ/b9bO4fizfojrrOaonvQmvvpMIw6wWQoApD89cR41LdYaVlj+QAJRL sZw5FVk5rgiGiBUrV7ayxgWuAXNAMUYfQBbr+VYD47pDpFQ82xIohDICATHyvr+y lluyxNbAJsL5z0xKgeFT7+sQoJVLPudjPIyz8Ofc9H9JtkEyY+OWLojoLXmVCHDN 2hVeqUn5OSmpVVpVNQ/6Kuis5OWsbPMLPEBhVB55XUWJHWJJj3RQseQqleULycAb mL6e1c3al1rkeFp2BAnQQTQnP26svSljgytMoPnIxXN54m63n4lpkAmmgdoIotMI YpT57w== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gqe614wc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:30 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49THVTpN014851 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:29 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 29 Oct 2024 10:31:25 -0700 From: Raj Kumar Bhagat To: CC: , Kalle Valo , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Jeff Johnson , "Bjorn Andersson" , Konrad Dybcio , , , , Raj Kumar Bhagat Subject: [RFC PATCH v2 1/5] dt-bindings: net: wireless: ath12k: describe WSI properties for QCN9274 Date: Tue, 29 Oct 2024 23:00:46 +0530 Message-ID: <20241029173050.2188150-2-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> References: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: eCz9aDWFc5sfOT9-BzYLUNT-HrfRtA79 X-Proofpoint-ORIG-GUID: eCz9aDWFc5sfOT9-BzYLUNT-HrfRtA79 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410290132 QCN9274 device has WSI support. WSI stands for WLAN Serial Interface. It is used for the exchange of specific control information across radios based on the doorbell mechanism. This WSI connection is essential to exchange control information among these devices Hence, describe WSI interface supported in QCN9274 with the following properties: - qcom,wsi-group-id: It represents the identifier assigned to the WSI connection. All the ath12k devices connected to same WSI connection have the same wsi-group-id. - qcom,wsi-master: Indicates if this device is the WSI master. - ports: This is a graph ports schema that has two ports: TX (port@0) and RX (port@1). This represents the actual WSI connection among multiple devices. Also, describe the ath12k device property "qcom,ath12k-calibration-variant". This is a common property among ath12k devices. Signed-off-by: Raj Kumar Bhagat --- .../bindings/net/wireless/qcom,ath12k.yaml | 241 +++++++++++++++++- 1 file changed, 232 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k.yaml index 1b5884015b15..42bcd73dd159 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath12k.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath12k.yaml @@ -1,5 +1,6 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright (c) 2024 Linaro Limited +# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. %YAML 1.2 --- $id: http://devicetree.org/schemas/net/wireless/qcom,ath12k.yaml# @@ -18,10 +19,17 @@ properties: compatible: enum: - pci17cb,1107 # WCN7850 + - pci17cb,1109 # QCN9274 reg: maxItems: 1 + qcom,ath12k-calibration-variant: + $ref: /schemas/types.yaml#/definitions/string + description: | + string to uniquely identify variant of the calibration data for designs + with colliding bus and device ids + vddaon-supply: description: VDD_AON supply regulator handle @@ -49,21 +57,100 @@ properties: vddpcie1p8-supply: description: VDD_PCIE_1P8 supply regulator handle + wsi: + type: object + description: | + The ath12k devices (QCN9274) feature WSI support. WSI stands for + WLAN Serial Interface. It is used for the exchange of specific + control information across radios based on the doorbell mechanism. + This WSI connection is essential to exchange control information + among these devices. + + Diagram to represent one WSI connection (one WSI group) among + three devices. + + +-------+ +-------+ +-------+ + | pcie2 | | pcie3 | | pcie1 | + | | | | | | + +----->| wsi |------->| wsi |------->| wsi |-----+ + | | grp 0 | | grp 0 | | grp 2 | | + | +-------+ +-------+ +-------+ | + +------------------------------------------------------+ + + Diagram to represent two WSI connections (two separate WSI groups) + among four devices. + + +-------+ +-------+ +-------+ +-------+ + | pcie2 | | pcie3 | | pcie1 | | pcie0 | + | | | | | | | | + +-->| wsi |--->| wsi |--+ +-->| wsi |--->| wsi |--+ + | | grp 0 | | grp 0 | | | | grp 1 | | grp 1 | | + | +-------+ +-------+ | | +-------+ +-------+ | + +---------------------------+ +---------------------------+ + + properties: + qcom,wsi-group-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + It represents the identifier assigned to the WSI connection. All + the ath12k devices connected to same WSI connection have the + same wsi-group-id. + + qcom,wsi-master: + type: boolean + description: + Indicates if this device is the WSI master. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: + These ports are used to connect multiple WSI supported devices to + form the WSI group. + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: + This is the TX port of WSI interface. It is attached to the RX + port of the next device in the WSI connection. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: + This is the RX port of WSI interface. It is attached to the TX + port of the previous device in the WSI connection. + + required: + - qcom,wsi-group-id + - ports + + additionalProperties: false + required: - compatible - reg - - vddaon-supply - - vddwlcx-supply - - vddwlmx-supply - - vddrfacmn-supply - - vddrfa0p8-supply - - vddrfa1p2-supply - - vddrfa1p8-supply - - vddpcie0p9-supply - - vddpcie1p8-supply additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - pci17cb,1107 + then: + required: + - vddaon-supply + - vddwlcx-supply + - vddwlmx-supply + - vddrfacmn-supply + - vddrfa0p8-supply + - vddrfa1p2-supply + - vddrfa1p8-supply + - vddpcie0p9-supply + - vddpcie1p8-supply + examples: - | #include @@ -97,3 +184,139 @@ examples: }; }; }; + + - | + pcie1 { + #address-cells = <3>; + #size-cells = <2>; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + qcom,ath12k-calibration-variant = "RDP433_1"; + + wsi { + qcom,wsi-group-id = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi1_wsi_tx: endpoint { + remote-endpoint = <&wifi2_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + + wifi1_wsi_rx: endpoint { + remote-endpoint = <&wifi3_wsi_tx>; + }; + }; + }; + }; + }; + }; + }; + + pcie2 { + #address-cells = <3>; + #size-cells = <2>; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + qcom,ath12k-calibration-variant = "RDP433_2"; + + wsi { + qcom,wsi-group-id = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi2_wsi_tx: endpoint { + remote-endpoint = <&wifi3_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + + wifi2_wsi_rx: endpoint { + remote-endpoint = <&wifi1_wsi_tx>; + }; + }; + }; + }; + }; + }; + }; + + pcie3 { + #address-cells = <3>; + #size-cells = <2>; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi3@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + qcom,ath12k-calibration-variant = "RDP433_3"; + + wsi { + qcom,wsi-group-id = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi3_wsi_tx: endpoint { + remote-endpoint = <&wifi1_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + + wifi3_wsi_rx: endpoint { + remote-endpoint = <&wifi2_wsi_tx>; + }; + }; + }; + }; + }; + }; + }; From patchwork Tue Oct 29 17:30:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 839632 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 12DE2209F5C; Tue, 29 Oct 2024 17:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223102; cv=none; b=YIxz7nvLYrectOPhBn7cSmD1Yio/+CSwDuxZFozxWlGCYgVarT77DNJZ3MC7XKmkTq8z56Um3B1ZHr81Xgq7bnENkmCkv2MTq3TE9XiO3DB6Ylow63zxI04C3zdiK/DFzKDtr5cf+ZD/GANccKO0d6vSmkqA8iEcMcvrQMYpj0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223102; c=relaxed/simple; bh=mLQ+TLAvaM4YrTLMKHG+Hs2KCbCz/kmO0agxJu+IMnw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IRzyGURYSceBNsPZ8I2iFUBkE8o++rmgP8aVSAU+kdeZYxNhwiO3/DlVheU5Et+4usIVZ+UqqdTKj2jwGx1sxpGaw3+hr+WiJ9fMDtBNfT8nh+OaUyXV03BlZK05Ak49B38ebBU0d+tIT4BbtBFmLBOeEqMvaXmObusPiEkaY+0= 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=Nd+No7Wc; 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="Nd+No7Wc" 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 49T91x8K025437; Tue, 29 Oct 2024 17:31:35 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= gqoCXZKM8qva/zeHoKoQD0B0r7y7M1nqa2ZEdcXkf1M=; b=Nd+No7WcxeIH9Ba+ zOkwvvvHI68f22RtEtB013FAHzjUCwEJThsmyf3dpXmjosoUTS5gnk4wopfNNLji uPnxBzj4DVDQmEXD/IHxXwnUpsm5+5Kf1EmS8NPR+vIUWxEnubiasu7z4rdqDuBp p5C5M4SeH2cUmDa8jBkzDQ0GplRxUgtPHMrFaiyaoris7WsazhbSJExQOKIN2AbT 5Iq71jLTHthZhEMTrn1Qt+9AIOv9leSHys+gWgQ/uDkPtxyjZtXkMYiQCwUJofHL g1b3zTQ050qhFea+dX2FooxXANODFr/xLBCpYmO+XtdtIfG86nNmQiWa0OEBGazA GqkhBQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gsq8h7cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:35 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49THVYOO014400 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:34 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 29 Oct 2024 10:31:29 -0700 From: Raj Kumar Bhagat To: CC: , Kalle Valo , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Jeff Johnson , "Bjorn Andersson" , Konrad Dybcio , , , , Harshitha Prem , Aditya Kumar Singh , Raj Kumar Bhagat Subject: [RFC PATCH v2 2/5] wifi: ath12k: parse multiple device information from device tree Date: Tue, 29 Oct 2024 23:00:47 +0530 Message-ID: <20241029173050.2188150-3-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> References: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: y_0fJK20BVlxY6NaDtJ3Uo952n0uLcvh X-Proofpoint-ORIG-GUID: y_0fJK20BVlxY6NaDtJ3Uo952n0uLcvh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 adultscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410290132 From: Harshitha Prem Currently, single device is part of device group abstraction but for multi link operation, multiple devices have to be combined together. Information of how many devices involved in grouping can be parsed from device tree and it would have the valid group id information as well. Add changes to parse devices involved and group id from device tree file to form device group Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Harshitha Prem Co-developed-by: Aditya Kumar Singh Signed-off-by: Aditya Kumar Singh Co-developed-by: Raj Kumar Bhagat Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/core.c | 154 +++++++++++++++++++++++-- drivers/net/wireless/ath/ath12k/core.h | 8 ++ 2 files changed, 151 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 3f0f44cbdb4c..91950ee50bf3 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "core.h" #include "dp_tx.h" #include "dp_rx.h" @@ -1403,6 +1404,7 @@ ath12k_core_hw_group_alloc(u8 id, u8 max_devices) ag->num_devices = max_devices; list_add(&ag->list, &ath12k_hw_group_list); mutex_init(&ag->mutex_lock); + ag->mlo_capable = false; return ag; } @@ -1417,34 +1419,156 @@ static void ath12k_core_hw_group_free(struct ath12k_hw_group *ag) mutex_unlock(&ath12k_ag_list_lock); } +/* This function needs to be used only when dt has multi chip grouping information */ +static struct ath12k_hw_group *ath12k_core_hw_group_find_by_id(u8 group_id) +{ + struct ath12k_hw_group *ag; + + /* group ids will be unique only for multi chip group */ + list_for_each_entry(ag, &ath12k_hw_group_list, list) { + if (group_id == ag->id && ag->num_devices > 1) + return ag; + } + + return NULL; +} + +static int ath12k_core_get_wsi_info(struct ath12k_base *ab, + struct ath12k_wsi_info *wsi_info) +{ + struct device_node *wsi_dev, *next_wsi_dev; + struct device_node *tx_endpoint, *next_rx_endpoint; + int device_count = 0, wsi_master_index = -1; + + wsi_dev = of_get_child_by_name(ab->dev->of_node, "wsi"); + if (!wsi_dev) + return -ENODEV; + + if (of_property_read_u32(wsi_dev, "qcom,wsi-group-id", + &wsi_info->group_id)) { + of_node_put(wsi_dev); + return -EINVAL; + } + + next_wsi_dev = wsi_dev; + + do { + if (of_property_read_bool(next_wsi_dev, "qcom,wsi-master")) + wsi_master_index = device_count; + + tx_endpoint = of_graph_get_endpoint_by_regs(next_wsi_dev, 0, -1); + if (!tx_endpoint) { + of_node_put(next_wsi_dev); + return -ENODEV; + } + + next_rx_endpoint = of_graph_get_remote_endpoint(tx_endpoint); + if (!next_rx_endpoint) { + of_node_put(next_wsi_dev); + of_node_put(tx_endpoint); + return -ENODEV; + } + + of_node_put(tx_endpoint); + of_node_put(next_wsi_dev); + next_wsi_dev = of_graph_get_port_parent(next_rx_endpoint); + if (!next_wsi_dev) { + of_node_put(next_rx_endpoint); + return -ENODEV; + } + of_node_put(next_rx_endpoint); + + device_count++; + if (device_count > ATH12K_MAX_SOCS) { + ath12k_warn(ab, "device count in DT %d is more than limit %d\n", + device_count, ATH12K_MAX_SOCS); + of_node_put(next_wsi_dev); + return -EINVAL; + } + } while (wsi_dev != next_wsi_dev); + + of_node_put(next_wsi_dev); + if (wsi_master_index == -1) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, "no WSI master defined in DT"); + return -EINVAL; + } + + wsi_info->num_devices = device_count; + wsi_info->index = (device_count - wsi_master_index) % device_count; + return 0; +} + static struct ath12k_hw_group *ath12k_core_assign_hw_group(struct ath12k_base *ab) { struct ath12k_hw_group *ag; - u32 group_id = ATH12K_INVALID_GROUP_ID; + struct ath12k_wsi_info *wsi = &ab->wsi_info; + int ret; lockdep_assert_held(&ath12k_ag_list_lock); - /* The grouping of multiple devices will be done based on device tree file. - * TODO: device tree file parsing to know about the devices involved in group. - * - * The platforms that do not have any valid group information would have each - * device to be part of its own invalid group. + /* The grouping of multiple devices will be done based on device + * tree file. * - * Currently, we are not parsing any device tree information and hence, grouping - * of multiple devices is not involved. Thus, single device is added to device - * group. + * The platforms that do not have any valid group information would + * have each device to be part of its own invalid group. + */ + ret = ath12k_core_get_wsi_info(ab, wsi); + if (ret) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "unable to get complete WSI Info from DT, err = %d", ret); + wsi->group_id = ATH12K_INVALID_GROUP_ID; + wsi->num_devices = 1; + wsi->index = 0; + goto invalid_group; + } + + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "WSI info: group-id: %d, num-devices: %d, index: %d", + wsi->group_id, wsi->num_devices, wsi->index); + + /* Currently only one group of multiple devices are supported, + * since we use group id ATH12K_INVALID_GROUP_ID for single + * device group which didn't have dt entry, there could be many + * groups with same group id, i.e ATH12K_INVALID_GROUP_ID. So + * default group id of ATH12K_INVALID_GROUP_ID combined with + * num devices in ath12k_hw_group determines if the group is + * multi device or single device group */ - ag = ath12k_core_hw_group_alloc(group_id, 1); + ag = ath12k_core_hw_group_find_by_id(wsi->group_id); + if (!ag) { + ag = ath12k_core_hw_group_alloc(wsi->group_id, wsi->num_devices); + if (!ag) { + ath12k_warn(ab, "unable to create new hw group\n"); + return NULL; + } + goto exit; + } else if (test_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags)) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, "group id %d in unregister state\n", + ag->id); + wsi->group_id = ATH12K_INVALID_GROUP_ID; + goto invalid_group; + } else { + goto exit; + } + +invalid_group: + ag = ath12k_core_hw_group_alloc(wsi->group_id, 1); if (!ag) { ath12k_warn(ab, "unable to create new hw group\n"); return NULL; } ath12k_dbg(ab, ATH12K_DBG_BOOT, "Single device is added to hardware group\n"); +exit: + if (ag->num_probed >= ag->num_devices) { + ath12k_warn(ab, "unable to add new device to group, max limit reached\n"); + wsi->group_id = ATH12K_INVALID_GROUP_ID; + goto invalid_group; + } + ab->device_id = ag->num_probed++; ag->ab[ab->device_id] = ab; ab->ag = ag; - ag->mlo_capable = false; return ag; } @@ -1511,6 +1635,14 @@ static void ath12k_core_hw_group_cleanup(struct ath12k_hw_group *ag) return; mutex_lock(&ag->mutex_lock); + + if (test_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags)) { + mutex_unlock(&ag->mutex_lock); + return; + } + + set_bit(ATH12K_GROUP_FLAG_UNREGISTER, &ag->flags); + ath12k_core_hw_group_stop(ag); for (i = 0; i < ag->num_devices; i++) { diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index cde35616ba56..6ade7a3cf6ff 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -211,6 +211,7 @@ enum ath12k_scan_state { enum ath12k_hw_group_flags { ATH12K_GROUP_FLAG_REGISTERED, + ATH12K_GROUP_FLAG_UNREGISTER, }; enum ath12k_dev_flags { @@ -845,6 +846,12 @@ struct ath12k_hw_group { bool mlo_capable; }; +struct ath12k_wsi_info { + u32 group_id; + u32 num_devices; + u32 index; +}; + /* Master structure to hold the hw data which may be used in core module */ struct ath12k_base { enum ath12k_hw_rev hw_rev; @@ -1026,6 +1033,7 @@ struct ath12k_base { struct notifier_block panic_nb; struct ath12k_hw_group *ag; + struct ath12k_wsi_info wsi_info; /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); From patchwork Tue Oct 29 17:30:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 839370 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 B6ED720ADCB; Tue, 29 Oct 2024 17:31:44 +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=1730223106; cv=none; b=EXydkkT9MZRsM5xHb8DXOoSGPn7S/QI2ozyXu7Bjb9p87MThYCCtZ3Vo1NrYnYGi8IgLuEHwgRS3f7n4z6eySgLYyv0EyRwK9Xh46Cttr8C7EYGxFRnB+EhlKb5RPkfgInB75cpH3CyJPdrDCUhgDSob1M+rfuuj2vQ8EyJSZS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223106; c=relaxed/simple; bh=HYF5Iq4Q9TjseQhZaMlec1WVhiNYlw7rxMHbsBMt/xk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qbicXE+QPjVHPW4iVkHV1xNQkhGk7aZjmf2aeAAmroCKXDmUd8/GqvW/O0emOJqtPX4wjjLcSUyfVevas0NrEBiW5+mjiihvAd59ojO0zh7H9ssXT67BvkZouLPW+PSfYOZERSwWqtkmrK5uHlm2GH3Wb+t16i37uzFRbe5PXK0= 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=cVc82bBL; 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="cVc82bBL" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49T9aLrn010746; Tue, 29 Oct 2024 17:31:40 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= VZ6szvlA0Ilv5PHdmu4JIiqAYVgmeX9bYSCSHXNxfuA=; b=cVc82bBLWWSGsjkG Xh5rCZbfgbevbAfFGfk8vrI4JUJOaK82DvXAdh+74xs4Q52HORDQ+WGURi4acMUJ MpCL/Xm+ZOLbW/UeMMP802v92P321CD30/uM8H0paiFNCNcOiWbta0zrValfllhd TlUXct0jjaeBMFG1UIrgdYkezGdpf2/3PKC3PA6OquIJLuEdeFZWnPhKi2hG1DrP Now+SEdQPRILbm3XfSWlKCEJmBxaHXU3oTeqNP5DJ/7xn1w0wl3ZpfmzBuxwrFHf zINWpK88fdTCH5NHobJ5ksWjEvABJt4A/4Ul9d4OYvrW23X1Cft+qgvO3z4w5Szo mvye9w== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gqcqsa2p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:39 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49THVdAq014410 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:39 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 29 Oct 2024 10:31:34 -0700 From: Raj Kumar Bhagat To: CC: , Kalle Valo , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Jeff Johnson , "Bjorn Andersson" , Konrad Dybcio , , , , Karthikeyan Periyasamy , Harshitha Prem , "Raj Kumar Bhagat" Subject: [RFC PATCH v2 3/5] wifi: ath12k: Send partner device details in QMI MLO capability Date: Tue, 29 Oct 2024 23:00:48 +0530 Message-ID: <20241029173050.2188150-4-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> References: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: GpxKaNrGcUGgVmf4pbZ2aGn5diDzJCTO X-Proofpoint-GUID: GpxKaNrGcUGgVmf4pbZ2aGn5diDzJCTO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410290132 From: Karthikeyan Periyasamy Currently, QMI MLO host capability is sent with the details of local links and hw_link id only for particular device but in case of multi device group abstraction, it has to include the details of hw_link_id, num_local_links of every partner device that is involved in the group during QMI MLO capability exchange. Add changes to send partner device details in QMI MLO capability exchange. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Harshitha Prem Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/qmi.c | 86 ++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index 5ebfe13b5313..689171b7b19f 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -2016,17 +2016,19 @@ static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = { }, }; -static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab, - struct qmi_wlanfw_host_cap_req_msg_v01 *req) +static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, + struct qmi_wlanfw_host_cap_req_msg_v01 *req) { struct wlfw_host_mlo_chip_info_s_v01 *info; + struct ath12k_hw_group *ag = ab->ag; + struct ath12k_base *partner_ab; u8 hw_link_id = 0; - int i; + int i, j, ret; - if (!ab->ag->mlo_capable) { + if (!ag->mlo_capable) { ath12k_dbg(ab, ATH12K_DBG_QMI, "MLO is disabled hence skip QMI MLO cap"); - return; + return 0; } if (!ab->qmi.num_radios || ab->qmi.num_radios == U8_MAX) { @@ -2035,7 +2037,13 @@ static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab, ath12k_dbg(ab, ATH12K_DBG_QMI, "skip QMI MLO cap due to invalid num_radio %d\n", ab->qmi.num_radios); - return; + return 0; + } + + if (ab->device_id == ATH12K_INVALID_DEVICE_ID) { + ath12k_err(ab, "failed to send MLO cap due to invalid device id\n"); + ret = -EINVAL; + return ret; } req->mlo_capable_valid = 1; @@ -2043,27 +2051,71 @@ static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab, req->mlo_chip_id_valid = 1; req->mlo_chip_id = ab->device_id; req->mlo_group_id_valid = 1; - req->mlo_group_id = 0; + req->mlo_group_id = ag->id; req->max_mlo_peer_valid = 1; /* Max peer number generally won't change for the same device * but needs to be synced with host driver. */ req->max_mlo_peer = ab->hw_params->max_mlo_peer; req->mlo_num_chips_valid = 1; - req->mlo_num_chips = 1; + req->mlo_num_chips = ag->num_devices; - info = &req->mlo_chip_info[0]; - info->chip_id = ab->device_id; - info->num_local_links = ab->qmi.num_radios; + mutex_lock(&ag->mutex_lock); + for (i = 0; i < ag->num_devices; i++) { + info = &req->mlo_chip_info[i]; + partner_ab = ag->ab[i]; + + if (partner_ab->device_id == ATH12K_INVALID_DEVICE_ID) { + ath12k_err(ab, "failed to send MLO cap due to invalid partner device id\n"); + ret = -EINVAL; + goto device_cleanup; + } + + info->chip_id = partner_ab->device_id; + info->num_local_links = partner_ab->qmi.num_radios; - for (i = 0; i < info->num_local_links; i++) { - info->hw_link_id[i] = hw_link_id; - info->valid_mlo_link_id[i] = 1; + ath12k_dbg(ab, ATH12K_DBG_QMI, "MLO device id %d num_link %d\n", + info->chip_id, info->num_local_links); - hw_link_id++; + for (j = 0; j < info->num_local_links; j++) { + info->hw_link_id[j] = hw_link_id; + info->valid_mlo_link_id[j] = 1; + + hw_link_id++; + } } + if (hw_link_id <= 0) + ag->mlo_capable = false; + req->mlo_chip_info_valid = 1; + + mutex_unlock(&ag->mutex_lock); + return 0; + +device_cleanup: + for (i = i - 1; i >= 0; i--) { + info = &req->mlo_chip_info[i]; + + memset(info, 0, sizeof(*info)); + } + + req->mlo_num_chips = 0; + req->mlo_num_chips_valid = 0; + + req->max_mlo_peer = 0; + req->max_mlo_peer_valid = 0; + req->mlo_group_id = 0; + req->mlo_group_id_valid = 0; + req->mlo_chip_id = 0; + req->mlo_chip_id_valid = 0; + req->mlo_capable = 0; + req->mlo_capable_valid = 0; + + ag->mlo_capable = false; + mutex_unlock(&ag->mutex_lock); + + return ret; } static int ath12k_qmi_host_cap_send(struct ath12k_base *ab) @@ -2111,7 +2163,9 @@ static int ath12k_qmi_host_cap_send(struct ath12k_base *ab) req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET; } - ath12k_host_cap_parse_mlo(ab, &req); + ret = ath12k_host_cap_parse_mlo(ab, &req); + if (ret < 0) + goto out; ret = qmi_txn_init(&ab->qmi.handle, &txn, qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp); From patchwork Tue Oct 29 17:30:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 839631 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 BE15F20B1F9; Tue, 29 Oct 2024 17:31:50 +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=1730223112; cv=none; b=NbM678YKj1owaVEZbWi3AjnllZHh+9+flJ9S6bxTIloEPcUwUCNjToJdcIeXe5CX7DVF8glzjhCjjf+0o7X+xTvvHr8LwTbfq2up1Sw5F0Q0DbxIEl1MPBFZGyJQSe3wxQEn4sRzKEoO0MS1vs73fjuKBkr0dXr+LHxhOoQsLxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223112; c=relaxed/simple; bh=INhknuaCOYaPV9SW5C0ugCSpbpYuNpoTuFA7r5n32CU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f5kR66LSYGaFDB6/2NTJKe68dr7pnD7iADL7OhRCXJZPC5tQd0HD7bRHyRg9bAxj3l99kvaY8/yJpzR8zsZ7mbK5Iwpulmp45jvmEerqx4wZMyciiwafyC+BZ0IBP+T4EkpdJAlBYrvUllmaqDDibdwMUzMNIe2jQGDJUkWJXvQ= 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=BRyOpK6H; 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="BRyOpK6H" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49TA3nZ2020162; Tue, 29 Oct 2024 17:31:45 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= HLdFqyiE2PDOXEBR5r3Kh/7ADCF/CV30mk2ocFyKoYw=; b=BRyOpK6Haps3ej6T OGL+7gkv7yFx3ovemwbEFlCR6C7tD2Jx2Ui+Ayky5L1Z3/lar7yrWUXUUP45yUOl 04rXSl3zHK6AiOZAnYaYdIr/Cy9TWFzQEBUQ6iKxCgbJ9Z8IIPr0+TZabAq3JtJ7 ECwLXp5cA9Vm2wXv0zEV2QuEg8bHj7u4hY8GEAParrkmSRQkuxr/RIb+qvMml9eo UiBmXv39u2TVuVOQ2wR4jPRVsOoTTKestHe1pk0y6+r1NJLMnHet29FFkN0krR4l VD/DRjc39QEF6okXaiksm+vpsXGh2je6knd/ag44/N08oTKYj9bkckKTMwUZ0HgI IP2fVA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gqrgs479-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:44 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49THVhiN023929 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:43 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 29 Oct 2024 10:31:39 -0700 From: Raj Kumar Bhagat To: CC: , Kalle Valo , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Jeff Johnson , "Bjorn Andersson" , Konrad Dybcio , , , , Aditya Kumar Singh , Raj Kumar Bhagat Subject: [RFC PATCH v2 4/5] wifi: ath12k: assign unique hardware link IDs during QMI host cap Date: Tue, 29 Oct 2024 23:00:49 +0530 Message-ID: <20241029173050.2188150-5-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> References: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: j-StXGOofRnYFjKidNKwKqAkL1JahYmy X-Proofpoint-GUID: j-StXGOofRnYFjKidNKwKqAkL1JahYmy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410290132 From: Aditya Kumar Singh Currently, in the QMI host capability, the device index, the number of local links, and the corresponding hardware link IDs are sent. The hardware link ID assignment is based on the local variable `hw_link_id`, which starts from 0 and ranges up to `num_local_links` in the device. Starting from 0 is not ideal because it can result in the same link ID being assigned to different devices in certain scenarios (e.g., split MAC). Additionally, for multi link operations the firmware expects the hardware link IDs in the same order as the Wireless Serial Interface (WSI) connection. Hence, for MLO to function seamlessly, the hardware link IDs across devices need to be unique and should follow the order of the WSI connection. To address this, a previous change read the WSI index from the Device Tree (DT) and stored it. Use this WSI index to determine the starting hardware link IDs for each device, ensuring uniqueness and correct order across all devices. While at it, add debug prints to clearly show the MLO capability advertisement sent during QMI host capability exchange. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Co-developed-by: Raj Kumar Bhagat Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath12k/core.h | 2 ++ drivers/net/wireless/ath/ath12k/qmi.c | 41 ++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 6ade7a3cf6ff..a4f772ad96c0 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -844,12 +844,14 @@ struct ath12k_hw_group { struct ath12k_hw *ah[ATH12K_GROUP_MAX_RADIO]; u8 num_hw; bool mlo_capable; + bool hw_link_id_init_done; }; struct ath12k_wsi_info { u32 group_id; u32 num_devices; u32 index; + u32 hw_link_id_base; }; /* Master structure to hold the hw data which may be used in core module */ diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index 689171b7b19f..7ecb539f60f2 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -2016,6 +2016,25 @@ static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = { }, }; +static void ath12k_host_cap_hw_link_id_init(struct ath12k_hw_group *ag) +{ + struct ath12k_base *ab, *partner_ab; + int i, j, hw_id_base; + + for (i = 0; i < ag->num_devices; i++) { + hw_id_base = 0; + ab = ag->ab[i]; + for (j = 0; j < ag->num_devices; j++) { + partner_ab = ag->ab[j]; + if (partner_ab->wsi_info.index >= ab->wsi_info.index) + continue; + hw_id_base += partner_ab->qmi.num_radios; + } + ab->wsi_info.hw_link_id_base = hw_id_base; + } + ag->hw_link_id_init_done = true; +} + static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, struct qmi_wlanfw_host_cap_req_msg_v01 *req) { @@ -2060,7 +2079,17 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, req->mlo_num_chips_valid = 1; req->mlo_num_chips = ag->num_devices; + ath12k_dbg(ab, ATH12K_DBG_QMI, "MLO Capability advertisement:"); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * device_id: %d", req->mlo_chip_id); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * group_id: %d", req->mlo_group_id); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * num_devices: %d", req->mlo_num_chips); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * Devices info:"); + mutex_lock(&ag->mutex_lock); + + if (!ag->hw_link_id_init_done) + ath12k_host_cap_hw_link_id_init(ag); + for (i = 0; i < ag->num_devices; i++) { info = &req->mlo_chip_info[i]; partner_ab = ag->ab[i]; @@ -2074,13 +2103,19 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, info->chip_id = partner_ab->device_id; info->num_local_links = partner_ab->qmi.num_radios; - ath12k_dbg(ab, ATH12K_DBG_QMI, "MLO device id %d num_link %d\n", - info->chip_id, info->num_local_links); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * device_id: %d", + info->chip_id); + ath12k_dbg(ab, ATH12K_DBG_QMI, " * num_links: %d", + info->num_local_links); for (j = 0; j < info->num_local_links; j++) { - info->hw_link_id[j] = hw_link_id; + info->hw_link_id[j] = partner_ab->wsi_info.hw_link_id_base + j; info->valid_mlo_link_id[j] = 1; + ath12k_dbg(ab, ATH12K_DBG_QMI, + " * hw_link_id: %d\n", + info->hw_link_id[j]); + hw_link_id++; } } From patchwork Tue Oct 29 17:30:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raj Kumar Bhagat X-Patchwork-Id: 839369 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 69AAC20B214; Tue, 29 Oct 2024 17:31:54 +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=1730223116; cv=none; b=YH5ktGWt9fGJ9SGwaOTLseNMenHDrEsstqrWMdDnFC7e4XS2e1ja3m7CO1NNNQktrIchccMohvwSK6+Bi8u/ARCvEbIX9gSIXIScKMh2dbs503zEn+aDfUDjj3R6RQPTE7nMIQid7TyWFmhC5h7WmWFMV/HU57/Gsx7MQFBRuWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730223116; c=relaxed/simple; bh=Fcusc6fplzeYzfxqMjbeHOwKEx+ya8tu6hFlmrRZ9rw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W8VW6/5EInVSHDp6XXIzgFOtXVd9By5fu0TTvQtUL/36pqgIzcfe8MAQbb8Ezi2dgCAhu9+OT67vM3kz3KndqHERbduVAVf9gyldiap7sRsYuBWyUMVef73bOUk21j4eDS2pRUhYTu51FOw0a7fV1oYl/qMjRMLd9wFazF2UJIE= 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=NPpSiuJI; 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="NPpSiuJI" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49TAUtQN017942; Tue, 29 Oct 2024 17:31:49 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= 65yvnD26sz+F+JIFKjIUO91u2nGvJ/8frS1l3kchIwU=; b=NPpSiuJIaa0s8R31 WeDTmNKsXxH8vtKQeiXg1Kqjo2fBQCaEYyN8FoVPTdtMkfnNW5M6lPqjt4bYjfR2 V+GEakN/Cp0bSYzxKhSg1Nhxz+jm+jlzbD99lHZ23TQbiAnpknYAn6vApW9o9/SD 9pNU65HMX3BYjq/55thO/PDt6138PMNMywQX0I368nlCoEI2+JmJIcAFy1vai0TF Pwxoc/BOkCOCCHU0J3XHRBXcsyOEZm3jlRgUM3ld8U4b/ITBsQAiIlNTLSWgTNaj 1OjBhrq9p5apT/NcA2q1JINrDKe22zuhVAvfRFq2DHWXFbinLj2IFE/onqaLE+ny wiJJMw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gqrgs47g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:49 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49THVliD023944 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 17:31:47 GMT Received: from hu-rajkbhag-blr.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 29 Oct 2024 10:31:43 -0700 From: Raj Kumar Bhagat To: CC: , Kalle Valo , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Jeff Johnson , "Bjorn Andersson" , Konrad Dybcio , , , , Raj Kumar Bhagat Subject: [RFC PATCH v2 5/5] arm64: dts: qcom: ipq9574: Add WiFi nodes for RDP433 Date: Tue, 29 Oct 2024 23:00:50 +0530 Message-ID: <20241029173050.2188150-6-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> References: <20241029173050.2188150-1-quic_rajkbhag@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 6S_ot7rnr18gQr2EpBfn24eFsvZuwvnN X-Proofpoint-GUID: 6S_ot7rnr18gQr2EpBfn24eFsvZuwvnN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 priorityscore=1501 mlxlogscore=733 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410290132 The RDP433 is a Qualcomm Reference Design Platform based on the IPQ9574. It has three QCN9274 WiFi devices connected to PCIe1, PCIe2, and PCIe3. These devices are also connected among themselves via WSI connection. This WSI connection is essential to exchange control information among these devices The WSI connection in RDP433 is represented below: +-------+ +-------+ +-------+ | pcie2 | | pcie3 | | pcie1 | | | | | | | +----->| wsi |------->| wsi |------->| wsi |-----+ | | grp 0 | | grp 0 | | grp 0 | | | +-------+ +-------+ +-------+ | +------------------------------------------------------+ Based on the above, the WSI properties for QCN9274 at pcie2 are (considering QCN9274 at pcie2 is WSI master): qcom,wsi-group-id = 0 qcom,wsi-master ports: tx-port (port@0): endpoint at pcie3 RX port. rx-port (port@1): endpoint at pcie1 TX port. Hence, add WiFi nodes with WSI properties for all three QCN9274 devices connected to RDP433. Signed-off-by: Raj Kumar Bhagat --- arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 116 +++++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts index 165ebbb59511..d0ecaefe5b41 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts @@ -3,7 +3,7 @@ * IPQ9574 RDP433 board device tree source * * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ /dts-v1/; @@ -27,6 +27,44 @@ &pcie1 { perst-gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; wake-gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; status = "okay"; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + wsi { + qcom,wsi-group-id = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi1_wsi_tx: endpoint { + remote-endpoint = <&wifi2_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + + wifi1_wsi_rx: endpoint { + remote-endpoint = <&wifi3_wsi_tx>; + }; + }; + }; + }; + }; + }; }; &pcie2_phy { @@ -40,6 +78,45 @@ &pcie2 { perst-gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; wake-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; status = "okay"; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + wsi { + qcom,wsi-group-id = <0>; + qcom,wsi-master; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi2_wsi_tx: endpoint { + remote-endpoint = <&wifi3_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + + wifi2_wsi_rx: endpoint { + remote-endpoint = <&wifi1_wsi_tx>; + }; + }; + }; + }; + }; + }; }; &pcie3_phy { @@ -53,6 +130,43 @@ &pcie3 { perst-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; wake-gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; status = "okay"; + + pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi3@0 { + compatible = "pci17cb,1109"; + reg = <0x0 0x0 0x0 0x0 0x0>; + + wsi { + qcom,wsi-group-id = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wifi3_wsi_tx: endpoint { + remote-endpoint = <&wifi1_wsi_rx>; + }; + }; + + port@1 { + reg = <1>; + wifi3_wsi_rx: endpoint { + remote-endpoint = <&wifi2_wsi_tx>; + }; + }; + }; + }; + }; + }; }; &sdhc_1 {