From nobody Sun Dec 14 14:14:08 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