From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3E2FC489FCF; Mon, 21 Sep 2026 11:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789989813; cv=none; b=mEy8XWYsYnm9pYcj+8m9kDc1bdmOAwj8+DGqmO49UanxJjfz9Yj1c3ZOaWkPmWlXBPeBGTxthnq+zMSaUgAdE8AvIjMSaX3UqRnx+27oTt0tc75415SlycC+qsVIqTY6ctkeaYcy/g60izWYT7eN8tIYI9d1vQhvgthtrHi5Z4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789989813; c=relaxed/simple; bh=XDDzM4aSYEc7ZNFEAujEu7CcK5fcN2uK5xdWdBsU3Yw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MZvfvZbhxlr6oF4Maaejo81bFvYin7V0zwt/IZAe7maxcyZE3kiXlR9CIww2+hIN3buqoPatf1n9JBdDDgIkOCIfwbvLHcQ9I0iCMqdfkdxbtf8hrHFI0rQo6nNSPFs7+Vad5NqKw1mfwFPoz0aapNSI9PqZevYPHkaniTZYWew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cs8/B+By; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cs8/B+By" Received: by smtp.kernel.org (Postfix) with ESMTPS id F3CA4C2BCB8; Mon, 21 Sep 2026 11:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1789989813; bh=XDDzM4aSYEc7ZNFEAujEu7CcK5fcN2uK5xdWdBsU3Yw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cs8/B+Bye797EpeKOxmRaLOuwb9aCQO014x9iKpdFxfR0jLEce4qEc6vwIhFYrJZw 1HHVSrb0vPoIWBytZu2XxHIKEl78nYl9EycBXXiNH+vk3pWNAzbvleX/9qHVz0et69 rUGf8/zCirwS5SZv9+D1vCIfvCHwcVIQqNe5t//N9oyGzS4uKVZXJLqT1tCbBDWPkU ABtWmn95bVt9iVM54xpytzEiZQRrlCVVNJ5j5KlPO2Mt6ebdCcPmaXfsDrG7bmX319 OzN2p4kcmpdUDJzGLpteUYfnIgvj4RqMzn4gaszoc/IJci45KLO8KHYZFVFmUnf6hu 6BP3D5u37082g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF677C982EE; Mon, 21 Sep 2026 11:23:32 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 21 Sep 2026 13:23:29 +0200 Subject: [PATCH v2 3/4] wifi: ath11k: Connect to the QMI server belonging to the device owned by this driver Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260921-qrtr-multi-ep-v2-3-27dd80d841a0@oss.qualcomm.com> References: <20260921-qrtr-multi-ep-v2-0-27dd80d841a0@oss.qualcomm.com> In-Reply-To: <20260921-qrtr-multi-ep-v2-0-27dd80d841a0@oss.qualcomm.com> To: Manivannan Sadhasivam , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jeff Johnson Cc: linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, Bjorn Andersson , Chris Lew , Deepak Kumar Singh , Raj Kumar Bhagat , Juha-Matti Tilli , Jeff Hugo , Manivannan Sadhasivam X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4047; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=LLx7gXAkXsmoLEJnemQrijc01fAxmMC5ydG4+GSiAaI=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBqsROyVCfNYWTDn5qcRfNToj9qFO2htOZUzMN3s vrz1q4dyAKJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCarETsgAKCRBVnxHm/pHO 9eNSCACPGty/j8lFSPl+QCifkvQNjbShpBxzw1ygp9/O18AplWnNbPIP/4ftMibyRFpOFJKi/RX c4KQpUqPxEYyqSh/Zcz8ghoUsofrYYh4ZJoc7i+c4QxuOj9NDX00ZpbRH5Gh3JAc09G2oPooN67 WkPVy671dVTjdSBaCnchkM4w1AC/cT8T/cIlv7lHPwIyS8E/GtDYf9HK1ioE8kdKP3Lf2u+99Nu 88zzcXynmO2hZ/XMjoiHtapT4Ow3SffKWeti3PX8HRoxoGaOve9mFI/Dln3aCO9IO/BbLtJ6FfE Z4FZU9R0SHtMVDY8QR2tuQv8zn8R6XrELTPPAlXH7RgA2F+Z X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam When two identical ath11k PCIe devices are connected to the same host, both advertise the WLFW service with the same service and instance id. The QMI lookup reports both servers to each device, so a device may connect to the firmware running on the other device. But now, QRTR provides each MHI endpoint a unique node id which is different from the node id announced by the device. So use the same id to pick the correct server. Add a get_qrtr_node_id() HIF callback that returns the node id derived from the MHI controller index and zero for transports that do not assign one. In the new_server callback, skip any service whose node id does not match. A node id of zero disables the check, so transports that do not assign one keep their current behavior. Signed-off-by: Manivannan Sadhasivam --- drivers/net/wireless/ath/ath11k/hif.h | 9 +++++++++ drivers/net/wireless/ath/ath11k/pci.c | 9 +++++++++ drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++++ 3 files changed, 28 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/ath/ath11k/hif.h index 017fed1b4bd1..0da9025c7ed8 100644 --- a/drivers/net/wireless/ath/ath11k/hif.h +++ b/drivers/net/wireless/ath/ath11k/hif.h @@ -32,6 +32,7 @@ struct ath11k_hif_ops { void (*ce_irq_disable)(struct ath11k_base *ab); void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx); void (*coredump_download)(struct ath11k_base *ab); + int (*get_qrtr_node_id)(struct ath11k_base *ab); }; static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab) @@ -159,4 +160,12 @@ static inline void ath11k_hif_coredump_download(struct ath11k_base *ab) ab->hif.ops->coredump_download(ab); } +static inline int ath11k_hif_get_qrtr_node_id(struct ath11k_base *ab) +{ + if (!ab->hif.ops->get_qrtr_node_id) + return 0; + + return ab->hif.ops->get_qrtr_node_id(ab); +} + #endif /* _HIF_H_ */ diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index a163168f3617..4d327b5cc98a 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "pci.h" #include "core.h" @@ -900,6 +901,13 @@ static int ath11k_pci_start(struct ath11k_base *ab) return 0; } +static int ath11k_pci_get_qrtr_node_id(struct ath11k_base *ab) +{ + struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); + + return qrtr_host_node_id(ab_pci->mhi_ctrl->index); +} + static const struct ath11k_hif_ops ath11k_pci_hif_ops = { .start = ath11k_pci_start, .stop = ath11k_pcic_stop, @@ -921,6 +929,7 @@ static const struct ath11k_hif_ops ath11k_pci_hif_ops = { #ifdef CONFIG_DEV_COREDUMP .coredump_download = ath11k_pci_coredump_download, #endif + .get_qrtr_node_id = ath11k_pci_get_qrtr_node_id, }; static void ath11k_pci_read_hw_version(struct ath11k_base *ab, u32 *major, u32 *minor) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index 7dc07339b957..dadf78f30b89 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -3170,8 +3170,18 @@ static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl, struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); struct ath11k_base *ab = qmi->ab; struct sockaddr_qrtr *sq = &qmi->sq; + int node_id; int ret; + /* Identical devices advertise the same QMI services, so connect only to + * the QMI server on this device's node. A node id of 0 means the + * transport has not assigned a unique node id, so accept the server + * unfiltered. + */ + node_id = ath11k_hif_get_qrtr_node_id(ab); + if (node_id && service->node != node_id) + return 0; + sq->sq_family = AF_QIPCRTR; sq->sq_node = service->node; sq->sq_port = service->port; -- 2.43.0