From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 6968E38F651; Tue, 15 Sep 2026 07:42:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458140; cv=pass; b=mONdqzHHO34XeiSOAa1LwM+5uSQLXbN5XpbMV6mjxlrcw8zkqeNA37QFx/tBkV4j3xQl3Cl4u/c/kOJnjt+/Fi2JXdnP96fHJeoIuPDdyRoA/V0R/SdshK7KfltxYU22eispcBPDNCP+DaBidfGX5Pvrcoi2wYtNw0ULDI9+230= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458140; c=relaxed/simple; bh=2DqcLFZjMCwvz4P2NATYwLxdAxbP1BJo+S/HUmZkm3s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eY+/xxRhdhXjADMGVEMLlgiX3dAl9glAi12iCh2Mb3GcZrjQ/grPyhIoD0UBSSlmxoXa57767UDfaus61Rv3+laxr10tMv+wqYIAQ5A9yWI7akTHwyljgVtJw2PbiKfgUjCyT8z7mrAE4Sm86Eh2BctJwkRXGdcQvXfx8y5GA9U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=hQ3sLSty; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="hQ3sLSty" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYrM3MVdz49Q6x; Tue, 15 Sep 2026 10:42:11 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OnSIfRHoHMbuoGc49ZmGo5twqqhr6EXzw54yp5CgxrQ=; b=hQ3sLStyGskXfdK19cDQavOa4VJlyQtDSRKDOk9CAhITDiscVOMVnp+laekRBZXZ8ytn+v xJpfZJOUatK98uLYAKb23IJ2eGRzqRA35O80miwCMtTbSodbWrClqeGZqDXGpL3Rg2i3wb QhyJrKZRlJ34EEA74y78pN9eX3LbIcqQ3iEM/XJXXm/DtpMcvaHHPWJ8I1H5p7LsfA6pKT a8wA70SAU8OaB+W1tPNw27oo6UKRQOTuFU8sOoJj0QQCLMDNjuqVtc/yoYkPBZfoRF06kV apCpLNVrog0aNHoE3agZrAQz2UePqokQcqqmeG9c/me1pLrbHa922tIXUIa8CA== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458131; b=C/pGxqJYK2JYz+STw8K0inNrDk38CVhpuk9d/0y3V1hV7io0DlgdS0JgNhueIvcl3thrz4 t2tFD7zt7YxTu1R4d2Qv8X0Pr02qLMDFE8xNJhsDgpCjQORni82zoJBVTX21kR4nN152ks pmjR9tapfLN4bcZFfmDzaXiLtV1B9kMcjESh5zpQBkGM8+Hrf9yrmIy/5+dCTAMMflS32+ ja/UfEE/GQBsAQ1ts/pL6eSGNTLBsORg+rrcP64nrdRpHyLUdgk3J/bx1JZDS355n0vwuP KUsTBGc8Mrm4+XiU9lyPwPiJkzY0u8HcpHsHTpMp8Ur8VKb53aH192MXZweZxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OnSIfRHoHMbuoGc49ZmGo5twqqhr6EXzw54yp5CgxrQ=; b=NvnlXjzXw4+cc211btM8rAfzKKrsjm3nL7IC1oUmMxJSAdrfyF9RUY9OoGausJOiTFo3rp tD60t8dtaRgxrDnuVADBgkB82GuHRkq8GJcmKa/FbOqPCGL9CEZPTTQiBRst0/luuZlFHT RdpxwzVFwKaOLLUWXscVeGYGFU/RqnVS5aclKtAoz5fszwYUYNyl77K8J8DHIiKaTaOmFw x20ig+IIOUo0ZqjQD5iurrAISKkTILGFyRRRzkmfsBY/79iwK0Q8FUwmC7Y6HQCraY/lfp fXN6M6rdzLRhw9uOaB0mhYPbb/e/CGKkHfDkoHKgzML1r0dHzw5aSi9LdDaXHw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 01/12] net: qrtr: support getting new endpoint ids externally Date: Tue, 15 Sep 2026 10:41:24 +0300 Message-Id: <20260915074135.2567411-2-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is originally based on a patch by Mihai Moldovan, that allowed registering endpoint-specific data and getting endpoint ids by the endpoint-specific data. Unfortunately, the old API did not support freeing the ids, creating a memory leak if someone repeatedly unloads and reloads kernel modules. Also, the old API had O(N) complexity where N was the amount of leaked memory. Because the patch has been extensively changed, I reset authorship. So, the new patch version only supports getting ids externally, with the idea being that MHI controller would know about its endpoint id. I made sure getting new data ids is permissible while holding a spinlock, since multiple threads may race to get the same id. Originally-by: Mihai Moldovan Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- MAINTAINERS | 1 + include/net/qrtr.h | 10 ++++++++++ net/qrtr/af_qrtr.c | 42 ++++++++++++++++++++++++++++++++++++------ net/qrtr/qrtr.h | 2 ++ 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 include/net/qrtr.h diff --git a/MAINTAINERS b/MAINTAINERS index 0b42e898f4d8e..491f09cb7939c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22506,6 +22506,7 @@ QUALCOMM IPC ROUTER (QRTR) DRIVER M: Manivannan Sadhasivam L: linux-arm-msm@vger.kernel.org S: Maintained +F: include/net/qrtr.h F: include/trace/events/qrtr.h F: include/uapi/linux/qrtr.h F: net/qrtr/ diff --git a/include/net/qrtr.h b/include/net/qrtr.h new file mode 100644 index 0000000000000..762d60b03012e --- /dev/null +++ b/include/net/qrtr.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef __NET_QRTR_H +#define __NET_QRTR_H + +#include + +int qrtr_endpoint_get_data_id(u32 *endpoint_id); +void qrtr_endpoint_free_data_id(u32 endpoint_id); + +#endif /* __NET_QRTR_H */ diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index 7c50d32b11015..86a92e95e270f 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -11,6 +11,7 @@ #include =20 #include +#include =20 #include "qrtr.h" =20 @@ -753,8 +754,8 @@ static struct sk_buff *qrtr_alloc_ctrl_packet(struct qr= tr_ctrl_pkt **pkt, int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid) { struct qrtr_node *node; - u32 endpoint_id; - int rc; + u32 endpoint_id =3D 0; + int rc =3D 0; =20 if (!ep || !ep->xmit) return -EINVAL; @@ -763,9 +764,18 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, u= nsigned int nid) if (!node) return -ENOMEM; =20 - rc =3D xa_alloc_cyclic(&qrtr_endpoints, &endpoint_id, NULL, - QRTR_ENDPOINT_RANGE, &next_endpoint_id, - GFP_KERNEL); + if (ep->endpoint_data_id) + endpoint_id =3D ep->endpoint_data_id; + + /* + * If we're registering an endpoint into smd or tun based qrtr, + * we don't have endpoint_data_id. Thus, allocate a new one. + */ + if (!endpoint_id) { + rc =3D xa_alloc_cyclic(&qrtr_endpoints, &endpoint_id, NULL, + QRTR_ENDPOINT_RANGE, &next_endpoint_id, + GFP_KERNEL); + } =20 if (rc < 0) goto free_node; @@ -857,13 +867,33 @@ void qrtr_endpoint_unregister(struct qrtr_endpoint *e= p) =20 qrtr_node_release(node); =20 - xa_erase(&qrtr_endpoints, endpoint_id); + if (ep->endpoint_data_id !=3D endpoint_id) + xa_erase(&qrtr_endpoints, endpoint_id); // did allocate =20 ep->id =3D 0; ep->node =3D NULL; } EXPORT_SYMBOL_GPL(qrtr_endpoint_unregister); =20 +int qrtr_endpoint_get_data_id(u32 *endpoint_id) +{ + int rc; + + *endpoint_id =3D 0; + // GFP_ATOMIC to allow while holding spinlock + rc =3D xa_alloc_cyclic(&qrtr_endpoints, endpoint_id, NULL, + QRTR_ENDPOINT_RANGE, &next_endpoint_id, + GFP_ATOMIC); + return rc; +} +EXPORT_SYMBOL_GPL(qrtr_endpoint_get_data_id); + +void qrtr_endpoint_free_data_id(u32 endpoint_id) +{ + xa_erase(&qrtr_endpoints, endpoint_id); +} +EXPORT_SYMBOL_GPL(qrtr_endpoint_free_data_id); + /* Lookup socket by port. * * Callers must release with qrtr_port_put() diff --git a/net/qrtr/qrtr.h b/net/qrtr/qrtr.h index affc24f426c64..45e38be0b2cb6 100644 --- a/net/qrtr/qrtr.h +++ b/net/qrtr/qrtr.h @@ -21,6 +21,7 @@ struct qrtr_node_lookup_helper { /** * struct qrtr_endpoint - endpoint handle * @xmit: Callback for outgoing packets + * @endpoint_data_id: an already allocated id to be used instead of new al= loc * * The socket buffer passed to the xmit function becomes owned by the endp= oint * driver. As such, when the driver is done with the buffer, it should @@ -32,6 +33,7 @@ struct qrtr_endpoint { struct qrtr_node *node; struct qrtr_node_lookup_helper helper; u32 id; + u32 endpoint_data_id; }; =20 int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int nid); --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 7261738F651; Tue, 15 Sep 2026 07:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458156; cv=pass; b=Uyh2DbNUVxLPNy4HFwbaWj9U3cwwGBNrwfFBOg4VCPumZOXOAkipbgPXMTkQPbhFJT/Rx7wakttlqrIzJX9aVkPTmWpnXvVa3dQiXrsIFev8dpk+SXqa2iVTJm/92yt7rWnspz88bCflmMRYj3o1ymsEAg4UTN+jmH4hBRg20vA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458156; c=relaxed/simple; bh=4oPVfTuLdoKRiL1KhOv4pI7rErvpJxgcey+RwhBBvFU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e7o0NtP1KvlQNwGRuduSSkIMwL1uGYeqRUZAbB9LZvwjZlu5nU96/ftW1CMtXe3lTJCC/L6HnWH07TQgVxmslFRZITLwwApIgRtHeWTCWB906+BXXHfS55qEEVP9bKE6W/dpojnYHbUS+FNtAk4DaPDYU4mY0QH1ONPXMrDOtjc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=DbL/TjAg; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="DbL/TjAg" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYrh3T1rz49Q6x; Tue, 15 Sep 2026 10:42:28 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n6wZoihAX0RzIzEuG6gPIj7VNZNxAWj7RdKbKT8wUj4=; b=DbL/TjAggprTV6dX3LE381p36qm0gloLTtNjgx/mDDgp/idnKGo6vUih8O7rr+fHROzbxp 73uz/MHmgJP8vb3qcZRZ0JLkTYhhWTg69YW8r4YDKWHfjzyHELCL52HpP7kCFDr3Hdqwpi 9acmt0nqGXzBTWtrM7JLbImSxIHhXTg8oXSn9nrSggeEV9clEkgcXiD2KraCgeGATSV85k Tig02z/K5aPKnj7XVwktWqsJOogaFSkouRJpeZl4acdLmyZhNXHOfAxOon4csejjRIyifL MbzfQK5ipwBWovIek9XGQSmCzBVCA9pHrgXpdtHuRFvMnPnN42WXUV5xNyJ2LA== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458148; b=wca5xElpb59PpnQ26j3OJ0zFUIxNaOeOHE7Ii9tqP0JFrcue2oQvZJLbkCftwoJWcIezd2 hXeGzDgqvqECYgYRysJkASf98K5k3TRhFzO0nu64CVvMO+apHoGP2rab/zyJVYCwyl/8kE ApX1QWOXFAyCLX4ucmrbm7+wK963Z41p/dc5sXX2AVUeFjySaFmq6XHT1C/bAd6cGBNM5Y ivgQxW46v7TwoBjWXGxc3P6ZZeFvUnHaKEaSQbxQKgW3D/vCT5c+bu2sI/lXbDMyg0lvjh uWBESnYtaBDZR+r9cIsFN3aVwhzX3cs55LzpFlxtnUziIY3uxj4WXSUL56aXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n6wZoihAX0RzIzEuG6gPIj7VNZNxAWj7RdKbKT8wUj4=; b=glLpRHNux0v35r6NxrqX0XuDzTfv/vqeqWrSRTW5a5HyFOnNUm6KSp3x5sVx8FldnCelVS 7uZZ5YhKqXKI1Hkgv923Vc7UZd7WFJvP0T0IVqfnS8DzBxTu75+BjjG0y+AdFrJnQHL/MO Ul3UDBKGB4p3NR274q6A06qGqBmBOIUFq56TQLg54HosmMBYZ0xIScHCk9DAjqLvTZRtZw OtBFddJc96rXV25FMRe24A73mcxqVzy7HrjmX+fxbXs7HQ3ag6Yu4mjQkzRZBRDVvbMEqB SjUYwxCEANToYTxJG8YAZn0j63OQqtw99fnyf0lEum+71d6I4rEY5FSYx2sxGA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 02/12] bus: mhi: allow mhi to know about its qrtr endpoint id and free it Date: Tue, 15 Sep 2026 10:41:25 +0300 Message-Id: <20260915074135.2567411-3-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is slightly less than ideal to have MHI know about its QRTR endpoint id, since MHI can be compiled in without QRTR. However, since many users of MHI use QRTR, I was bold enough to edit the MHI controller data structure. The only alternative to this editing is to have a hash table or worse, an O(N) lookup list inside QRTR to turn MHI controller data pointer to QRTR endpoint id. However, even in that case the QRTR endpoint id needs to be freed when the MHI controller is freed, so it is impossible to do this in a non-leaky way without editing MHI controller. It's a good question whether the QRTR endpoint it should be stored to mhi_controller or mhi_device. In most cases, it shouldn't matter, as two PCIe ath11k/ath12k cards have two mhi_controllers. So, I followed the original idea by Mihai Moldovan that mhi_controller has 1:1 relationship to QRTR endpoint. MHI controller needs a function pointer to actually free the QRTR endpoint id, since MHI can be compiled in without QRTR, so the freeing has to happen externally. Signed-off-by: Juha-Matti Tilli --- drivers/bus/mhi/host/init.c | 8 ++++++++ include/linux/mhi.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c index fd3050889412d..d96b099432640 100644 --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -947,6 +947,9 @@ int mhi_register_controller(struct mhi_controller *mhi_= cntrl, rwlock_init(&mhi_cntrl->pm_lock); spin_lock_init(&mhi_cntrl->transition_lock); spin_lock_init(&mhi_cntrl->wlock); + spin_lock_init(&mhi_cntrl->qrtr_endpoint_lock); + mhi_cntrl->qrtr_endpoint_id =3D 0; + mhi_cntrl->free_qrtr_endpoint_id =3D NULL; INIT_WORK(&mhi_cntrl->st_worker, mhi_pm_st_worker); init_waitqueue_head(&mhi_cntrl->state_event); =20 @@ -1087,6 +1090,11 @@ void mhi_unregister_controller(struct mhi_controller= *mhi_cntrl) put_device(&mhi_dev->dev); =20 ida_free(&mhi_controller_ida, mhi_cntrl->index); + + spin_lock(&mhi_cntrl->qrtr_endpoint_lock); + if (mhi_cntrl->free_qrtr_endpoint_id) + mhi_cntrl->free_qrtr_endpoint_id(mhi_cntrl); + spin_unlock(&mhi_cntrl->qrtr_endpoint_lock); } EXPORT_SYMBOL_GPL(mhi_unregister_controller); =20 diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 8616bacd8675d..d6d5c93e41cb0 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -361,6 +361,7 @@ struct mhi_controller_config { * @st_worker: State transition worker * @hiprio_wq: High priority workqueue for MHI work such as state transiti= ons * @state_event: State change event + * @qrtr_endpoint_id: The QRTR endpoint id associated with this MHI contro= ller * @status_cb: CB function to notify power states of the device (required) * @wake_get: CB function to assert device wake (optional) * @wake_put: CB function to de-assert device wake (optional) @@ -373,6 +374,7 @@ struct mhi_controller_config { * @write_reg: Write a MHI register via the physical link (required) * @reset: Controller specific reset function (optional) * @edl_trigger: CB function to trigger EDL mode (optional) + * @free_qrtr_endpoint_id: Function to free the QRTR endpoint id * @buffer_len: Bounce buffer length * @index: Index of the MHI controller instance * @bounce_buf: Use of bounce buffer @@ -440,6 +442,8 @@ struct mhi_controller { struct work_struct st_worker; struct workqueue_struct *hiprio_wq; wait_queue_head_t state_event; + u32 qrtr_endpoint_id; + spinlock_t qrtr_endpoint_lock; =20 void (*status_cb)(struct mhi_controller *mhi_cntrl, enum mhi_callback cb); @@ -458,6 +462,7 @@ struct mhi_controller { u32 val); void (*reset)(struct mhi_controller *mhi_cntrl); int (*edl_trigger)(struct mhi_controller *mhi_cntrl); + void (*free_qrtr_endpoint_id)(void *mhi_cntrl_void); =20 size_t buffer_len; int index; --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 2B3D445D900; Tue, 15 Sep 2026 07:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458176; cv=pass; b=TN/AX3sIzuu381/NsZZv6YE4UsYDeX9kdhDdGxGbT4/XMK3+9x3fuVEuLEYMaHdg6xmbj2By7GHMuAvAf12zhbBwueFCaGGo1f5XOcCtvjf7eZjc8A0V3nIKenM3SRkUbIrQMUog+EXqz+B9gHkTzkNvh1oHs+YVb78hJ2RVyi8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458176; c=relaxed/simple; bh=B8GhkT17+ArMORtb+3H5LoP0LqXXLHms78MLvyrKV2c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kKriGNlDaaqJNNvjEnK5fw5asPpYXq1YkxUbENY3Dv5bQ50QNn8DzTVvekqHv6Io1jX88UuczHgQPBe3AqaG66W12ukjL++6BhrR2MuLErE1C4J7oqoiuNaaOeAS+Siljsl/gc6Oq1fE+ZwIZX3AMLlR+Qul7T1OD8E7fua9cEM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=AuaAdn8Q; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="AuaAdn8Q" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYs14CQrz49Q6x; Tue, 15 Sep 2026 10:42:45 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Angl7vosthCmbDal4tBWwtsxKy9LKqnIGYA36AA3r48=; b=AuaAdn8QybOKuXFMOM/VlqmJAQl0rjaUuLhJdMz8qmaIY1HPGmxldld4a8eaVKArjRD/Xu v8L8QxplrxY0s/GxWEyIUyUQ8xmnkogGJP34ekzJQwEiXC/f1yvtwGnErnNbw5G4tTRwBP EZTCYHOET0h9C0IepiwJ6JYDSYxGMGbsd3OeCtHNvWOWfK/t6MKtgITfGEHe8BJ3PI1O8r t2LrcaknHwghjY35WODghaWkKz6aJ2wku6kgyTKJULJY6Kgl6Igov/wlT7YK1mafdEZ8fY ovv78PzXqihiQ02ImEfZqJHMxLO+unGvzvLJve0gTRR9/NwZqf/TMZ2gKadPYg== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458165; b=PI21Vk+wZ8LkVQLq2V/9DSFWzUxKDoFE6euN+9TlhVDEUgEVcMIRakCFP0F5UKWIPKDOLj sGlh7o3+XcxLOk7KVNaFdDVoCUaS0uc58W2NnNWZ7WMXSqKdOG1Kkpmm81Ak1lbs/Ii3KF A8ff+K6ScVueQdtHg2j4nv7UURQ0mpBEk1PPk+MCH5qzJHMDQWRfDXhKnKddgNHgCSd6Ka Tu+gX1a+wSicLQmwsH4/JH5TSh0uhZBDq1Eo0By2izgd2eW4KO3QOLaLpM6U7WSqPLw9sF iTLtRGgu1Yq+kmj9j+HyqythxIPoiMSG7UIHLd3EdhHZTaPRhPt44rsebULYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Angl7vosthCmbDal4tBWwtsxKy9LKqnIGYA36AA3r48=; b=Jmr8WyOQa1eaf0rWN5jxieyYjlaqymiojPz24wbUkvtpsvuOaciiSdQ+eeNd/Efo0a7ffm veFW9+YUzD73BHfL6vavVoePX8dioUSgAooGYjg6D9TWo3h44x55sUODMuggzsOw8E5JBi ne1mDX+/e24ZJsWZd3/E4DPM/kUaoN8TTLQaGNHsGdoFKHJbUV5J7b/ZW4YrGXw61lFnRO zoI4mSuhySwnyd9EY0bCxoS2IdA7duWMiVcvpsZkQrMLuYxTy3YkSAvJAACQTkpfwTRZd3 mx7T8b673kiZo1qCy6MZ4BKSFKXdEkJ2m0SH1BHb6Bwz8KmuyyO/Em7wHfhfQA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 03/12] net: qrtr: mhi: register new qrtr endpoint id for mhi Date: Tue, 15 Sep 2026 10:41:26 +0300 Message-Id: <20260915074135.2567411-4-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" MHI will use the mhi_controller data structure to store the QRTR endpoint id, as explained previously. Signed-off-by: Juha-Matti Tilli --- net/qrtr/mhi.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/net/qrtr/mhi.c b/net/qrtr/mhi.c index 630ce0da060e5..41b58ab854725 100644 --- a/net/qrtr/mhi.c +++ b/net/qrtr/mhi.c @@ -7,6 +7,7 @@ #include #include #include +#include =20 #include "qrtr.h" =20 @@ -116,6 +117,17 @@ static ssize_t endpoint_show(struct device *dev, =20 static DEVICE_ATTR_RO(endpoint); =20 +static void qcom_mhi_qrtr_free_mhi_id(void *mhi_cntrl_void) +{ + struct mhi_controller *mhi_cntrl =3D mhi_cntrl_void; + u32 id =3D mhi_cntrl->qrtr_endpoint_id; + + if (id !=3D 0) + qrtr_endpoint_free_data_id(id); + mhi_cntrl->qrtr_endpoint_id =3D 0; + mhi_cntrl->free_qrtr_endpoint_id =3D NULL; +} + static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev, const struct mhi_device_id *id) { @@ -130,6 +142,23 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_= dev, qdev->dev =3D &mhi_dev->dev; qdev->ep.xmit =3D qcom_mhi_qrtr_send; =20 + spin_lock(&mhi_dev->mhi_cntrl->qrtr_endpoint_lock); + if (mhi_dev->mhi_cntrl->qrtr_endpoint_id) { + qdev->ep.endpoint_data_id =3D + mhi_dev->mhi_cntrl->qrtr_endpoint_id; + } else { + rc =3D qrtr_endpoint_get_data_id(&qdev->ep.endpoint_data_id); + if (rc) { + spin_unlock(&mhi_dev->mhi_cntrl->qrtr_endpoint_lock); + return -ENOMEM; + } + mhi_dev->mhi_cntrl->qrtr_endpoint_id =3D + qdev->ep.endpoint_data_id; + mhi_dev->mhi_cntrl->free_qrtr_endpoint_id =3D + qcom_mhi_qrtr_free_mhi_id; + } + spin_unlock(&mhi_dev->mhi_cntrl->qrtr_endpoint_lock); + dev_set_drvdata(&mhi_dev->dev, qdev); =20 /* start channels */ @@ -150,6 +179,9 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_d= ev, =20 dev_dbg(qdev->dev, "Qualcomm MHI QRTR driver probed\n"); =20 + mhi_dev->mhi_cntrl->qrtr_endpoint_id =3D qdev->ep.id; + mhi_dev->mhi_cntrl->free_qrtr_endpoint_id =3D qcom_mhi_qrtr_free_mhi_id; + return 0; =20 err_unregister: --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 E23464457C6; Tue, 15 Sep 2026 07:43:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458213; cv=pass; b=de/DqklpPJW/vlaWXP4pTCUOdFi0cVo/M0ITQm2X9ZrDq0EZRh5mmnfJt3hfJXExuDoRWGmgIf/zLs+ieE1ZuZRfh1HT4jhCCiUVuofNHTcqlTmL5mTD9XGIzmNxo2giGYKEbiZguRvpnEw6V6YE2eQveS/pzv/G2TXcXKUD0Ns= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458213; c=relaxed/simple; bh=abrrbXf+C9yT3jDSTjifMWlBVf4KJoVMvnOKyh+KQj4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iUU/HMKNgYZPOjek/Tjv0HJXR1jFHURihs8DYmko9TECLeVxA3BWaeMMLyx08v0kZsm33L6QuCwlr9/D6elwVwQM8FiDFZMy2BRFlcbXluYUGVSG9dBDLxv9h4s+1mnG0/fLHvdJaXDubcdOhhj0TEl0PeaGOpUxzmiAkOdTqWo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=sQZTsgij; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="sQZTsgij" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by meesny.iki.fi (Postfix) with ESMTPSA id 4hkYsm0xH2z10gQ; Tue, 15 Sep 2026 10:43:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bPA7RZq69BQzFDIgq2/jKxXiYvSrAjNW2sfY7vkWUj8=; b=sQZTsgijT5BJPzxeZO6a9ZD4L3yEQZfcJc+delxOjkxJtlJvP/ZaJVNl+U4yimEaa9scc+ AlXqhZlE4t5Bc97/t4/F0D8Z9Uf+TIFtCqe45o7sdOPTpsrfjzQNXnNCjONqxSIXVsbTql BuCvONLnSnl/rDE7CehWZFKJG7QJSRM= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1789458205; b=Np7ktd9E+ATajFhlNmOegyVEOIRnF+yuzqOt7VjvpA4ON23pYgN8MjulJh9qcuZ94rSz47 BK+RiFQ7f1CflCLZXg8xtQ9e9LxqiS1b3lslbYoJwxNMlvA4pwWMJROKCzTFu0SqSFknwn DmcvlTvnJoUH+t8XRwupXETtyZFFwaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bPA7RZq69BQzFDIgq2/jKxXiYvSrAjNW2sfY7vkWUj8=; b=bxUEYZTBusqXVe4YFqWSk95FDQRd8s+cctXMDt7lUJy5Xl1m2HPVF/sWn4AhitzBuPY3aj q1qyNZC+2R93bwJwS2/pdXjL1E6i6F55wnNarF6UUlP0jYhcNzokR4HTFlzT8JLYV9Y40T T4Ves6Q913O+2mDxm3cWC0QOCdwv35E= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 04/12] soc: qcom: qmi_helpers: add QRTR endpoint ID to qmi_handle Date: Tue, 15 Sep 2026 10:41:27 +0300 Message-Id: <20260915074135.2567411-5-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan Adding this allows us to easily supply an endpoint ID to bind on later on when creating the socket. Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- include/linux/soc/qcom/qmi.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/soc/qcom/qmi.h b/include/linux/soc/qcom/qmi.h index b9dcb437a0be5..c675d095df778 100644 --- a/include/linux/soc/qcom/qmi.h +++ b/include/linux/soc/qcom/qmi.h @@ -224,6 +224,7 @@ struct qmi_msg_handler { * @txns: outstanding transactions * @txn_lock: lock for modifications of @txns * @handlers: list of handlers for incoming messages + * @endpoint_id: QRTR endpoint ID to bind on */ struct qmi_handle { struct socket *sock; @@ -247,6 +248,8 @@ struct qmi_handle { struct mutex txn_lock; =20 const struct qmi_msg_handler *handlers; + + u32 endpoint_id; }; =20 int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 2D38138F651; Tue, 15 Sep 2026 07:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458230; cv=pass; b=I3DBCvBJBG1V7bij2SkN74qIgNsRT/8Iy5hR/T/QVQ6lCSefmxhtW3ZIu04DkUDqtB/L6Q1NAq3qboyr070YLpnH+bE1wcIg93LtGw/RBw60VhfYLjQHoBp6X9rt7gEm0xTlk1ubm/Q2B9tjgta4VN3pZY3PtZQXN6yhGwTj+z8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458230; c=relaxed/simple; bh=fFVpnQJZzO4PFI4NbxLVE75hxJzqPxs7InUICkJ+M+s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X/0VbHPZVYjPWw0RfSn3jTpOFMWaVBfbn2i40iaDZT9314A2lP5fbl13Vfjyyl2z39pvZ628SbjWwwGadjp0NDqGBkiRqbpu4R/GU+96ZU7R3J53sMGa4yGKyCvil/fr+mof6Iie6cH5LJ1JT3VzDyMEqY+0bPfaSDXOEke1k1s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=uF2UudJQ; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="uF2UudJQ" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by meesny.iki.fi (Postfix) with ESMTPSA id 4hkYt63SM6z10gQ; Tue, 15 Sep 2026 10:43:42 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UskWr+boRdHCKqvgiQhgiQCmhJi2c28VCTFGVe919rE=; b=uF2UudJQi1HbWTVWqlG2rGygix9dZkMlXzhFxDVNOWn1GEO1CGNETZL/WFeh/y2rnEciQR 09BjyeA8nmcs4NRAHgL+zNywuC54OHD8yGBf8QetE6MpRSlKwtdSkhwOFdRMEwwD8SuPJv wjs4RE034uc0kWuAhKaCWzpyH8mX4vo= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1789458222; b=py988pwZ3T9FKk43ST1Ebl7nq7c/K0VxGb3Cbu06lS7T5CmVcgiq9I4774d7ry3EzjBYWq pCtMn+WJCuOKhyjyVmE2YAysF42Yy/jP7y5Xq9fqhwlQVnysCNxz2k9969v7XUuMGDH02x Otw+D7Ybps9pU4U1sEP/dajRHI7fyfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UskWr+boRdHCKqvgiQhgiQCmhJi2c28VCTFGVe919rE=; b=BG/gyx31xY1cSmGwyq0CvB/kiH2sNTbQoOTr5eBZ6rrMlZ2vr7R5sdFm0JvTBy3CzaTBC1 rKrIpaVl8zxdr2ypZin7K29K1L+jgbpQiIOQUveopa65i2WfWjbUsNoU2nF20ht7/V5jsn yEX99xQUr1irBsRn4DEXA4/rtA62giU= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 05/12] soc: qcom: qmi_helpers: optionally bind to QRTR endpoint ID in qmi_sock_create Date: Tue, 15 Sep 2026 10:41:28 +0300 Message-Id: <20260915074135.2567411-6-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan For clients that already know the QRTR endpoint ID before actually creating the QMI socket and set it in struct qmi_handle, optionally try to bind to this QRTR endpoint ID when creating the socket. This can fail, and qmi_sock_create will issue diagnostic messages, but otherwise ignore the error. Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/soc/qcom/qmi_interface.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interf= ace.c index 16e2e24b60968..1550138a938d2 100644 --- a/drivers/soc/qcom/qmi_interface.c +++ b/drivers/soc/qcom/qmi_interface.c @@ -586,6 +586,7 @@ static struct socket *qmi_sock_create(struct qmi_handle= *qmi, struct sockaddr_qrtr *sq) { struct socket *sock; + const struct proto_ops *ops =3D NULL; int ret; =20 ret =3D sock_create_kern(&init_net, AF_QIPCRTR, SOCK_DGRAM, @@ -593,6 +594,33 @@ static struct socket *qmi_sock_create(struct qmi_handl= e *qmi, if (ret < 0) return ERR_PTR(ret); =20 + ops =3D READ_ONCE(sock->ops); + + if (!ops) { + pr_warn("sock->ops not available for QMI socket\n"); + pr_warn("will not be able to bind to endpoint ID.\n"); + /* N.B.: this error value will not be passed out. */ + ret =3D -ENXIO; + } + + if (!ret && !ops->setsockopt) { + pr_warn("ops->setsockopt not available for QMI socket\n"); + pr_warn("will not be able to bind to endpoint ID.\n"); + /* N.B.: this error value will not be passed out. */ + ret =3D -ENXIO; + } + + /* Only bind to a specific endpoint if a valid one was provided. */ + if (!ret && qmi->endpoint_id) { + ret =3D ops->setsockopt(sock, SOL_QRTR, QRTR_BIND_ENDPOINT, + KERNEL_SOCKPTR(&qmi->endpoint_id), + sizeof(qmi->endpoint_id)); + + if (ret < 0) + pr_warn("binding to QRTR endpoint ID failed: %d\n", + ret); + } + ret =3D kernel_getsockname(sock, (struct sockaddr *)sq); if (ret < 0) { sock_release(sock); --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 73BE845D935; Tue, 15 Sep 2026 07:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458247; cv=pass; b=jxwmlVKXL5WebeEiOBPYxUU7pcavo3iua5mNr8znHIi2w0ixLACBfyinRav283GQVT8xsFsnze8mWHvk4WOYte3/Pu8LdDQpzSvW0Q6JA1G+0LUbEbqBTJIyh0yzIhzc5g4/tjPYrG/poI3Fx9ht0/P0ixYmUNTAqgLOqliXIe8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458247; c=relaxed/simple; bh=0588P4/PihnaRq2ZOR9XGRYAUXqqFmCkvE8jbwLnQx8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lnx2mEy6zRQsuVaA04de2g7ji9F1MnCFepjlM6NgZj1dq4ncYRPmdpOjn5pNg2Qox4ioU+bWRZ92ATxAkny47uibtMJ+ohvnWnIFAjNvZKQmtQGWpU2OnU/eqmUJVVNQ/tECXR5zmVIW5eWLScDxVjwwqEE2kOyng++qSSzYKKI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=pUFqNekw; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="pUFqNekw" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by meesny.iki.fi (Postfix) with ESMTPSA id 4hkYtR32ZhzySb; Tue, 15 Sep 2026 10:43:59 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C+g3+5hKe1GDXl2AMiPOwBq2BGyQhQR5x73/iaY9V3w=; b=pUFqNekweAdzIq4YSdBxeOrQYwOYPxD0TYoIHnqbn0ic2Xd8R66/xvWu4FIQdu5bnQiTxZ uXO9Euq6n5lJxSXameNOZEH1vL9dkGTAQ6OdmeiGeM2UzN5HvZEXJVRrlFraVVxDKIiKxb HCtL9P4aM5yyUiJhJIf3kMJOvP+cuf0= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1789458239; b=k1P6w3mJu//26d+8AgghmkqRaZg+tHLoO/fh55XKuCTRSDeiz2YuMls7FL/ikVj6Y7+M0G /rcf2oX9LMbKeV53/kRVhyJkoKHTcO7hLRnDGJsBKHDPPhojiPvgSilyCcfp0TEAReu40O upAXe3oy3oeZEloKPpmod/OXOqSu0M0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C+g3+5hKe1GDXl2AMiPOwBq2BGyQhQR5x73/iaY9V3w=; b=YkghHMm6nd43qa8lgOwAbme70nsTz9pJVxwjgoX7Yo04P2i3gtMvqAg/vpGzgGbzHrLODN HPW33Io6jo6913AJrhQGSBSPh5boPMYKGzY3kgk26CEcgezHVBTezIMsrzwLBlkxzz+bQL pF2rfIzQJLwhwW72CBsgQgPJA2nWrz0= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 06/12] wifi: ath11k: add QRTR endpoint ID hif feature Date: Tue, 15 Sep 2026 10:41:29 +0300 Message-Id: <20260915074135.2567411-7-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan This will allow fetching the QRTR endpoint ID via hardware-specific means. Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath11k/hif.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/a= th/ath11k/hif.h index 017fed1b4bd15..2f1634bb9b181 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 (*set_qrtr_endpoint_id)(struct ath11k_base *ab); }; =20 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); } =20 +static inline int ath11k_set_qrtr_endpoint_id(struct ath11k_base *ab) +{ + if (!ab->hif.ops->set_qrtr_endpoint_id) + return -EOPNOTSUPP; + else + return ab->hif.ops->set_qrtr_endpoint_id(ab); +} + #endif /* _HIF_H_ */ --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 734E045D90A; Tue, 15 Sep 2026 07:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458265; cv=pass; b=V8QPPlVc6Gu6mekz6hnmzmaTeh5L4PygVCu1cWTPvzGlPIXwhtAvt9orE+Tsz6NNdv8iLbD78THBTMovsT7M/UBhTQQQW3LOLSo7E5NP5crsMokUB1ViMQgVDuk5FG1YvEmBEI14iX7HxOycG/A2XQjZ4xarCxjwlGa90Jb14Gc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458265; c=relaxed/simple; bh=Wn4IKjyUqQAeg93wKRRA9smjCbWjQ5UnbHEmDo+F8sU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TRc2by47MGmk1klRApiJgjgdOa7yshUDVWXRui2OMMGCbbRk/a82/nrUktNclSkRLzyAGzRoIgjc6Yjslu183Q6ycUQeMwS8gydwhZ93uTWp2o5OTTpxftXsHeSjXWI+JKiFIq+ZuDiiEJVnH06L9/7UmfxbnrIcp5yPBdA6AQM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=mx9ZOQq6; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="mx9ZOQq6" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by meesny.iki.fi (Postfix) with ESMTPSA id 4hkYtm1MG7zySb; Tue, 15 Sep 2026 10:44:16 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5udMw/D8l5XFimn7AbO4dlFXaCD2w5J+n7KjzzUgXYM=; b=mx9ZOQq6/28oaPH57sk3CDTqlpa0h5SOKNq7X4s1LhPXQNf88X7s2EsHBNe9sOJA6pn+ZJ no/v4mZqCUEdxqM0xIZ5l4lFlItw1hKa//TqjVitdBZ1Gzp/9FHgwAhtH+qSua1k2RJi2e PmHrGDGDF+XZ1c0h67xiaXnyIdRpKFE= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1789458256; b=GG+oXz5+E9gLaBV0zJ15mKV4vkHL2sbX9j8RL9e4mBnSuE5am3UQffI8CP0U0C/ROvAIFj vqHcCThi1EwAs2Nu7+ihqnytPK1lgMDNBvaDcyFz+8FQQiAr+Bwdd+7FQi6vjM3hI13a0W F8aV4G+2Lb3T0evQYux9vmCb5v/cvYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5udMw/D8l5XFimn7AbO4dlFXaCD2w5J+n7KjzzUgXYM=; b=ezuEBHqEi4sUifa1XjGIyNKO+3ckhBSfZSj2o28KOsiRxzyHcQAenUOy4nFpVeU46TzL1g U0aQR9r2EFZUtToheuSgZ26LwDtKet3S7IXwvs+AImgKY4KsVpDqL5MfS/VZDDpYBMDn9d loYnvYRw/PkRxtKdBuD64izBXF7JA5w= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 07/12] wifi: ath11k: stub QRTR endpoint ID fetching Date: Tue, 15 Sep 2026 10:41:30 +0300 Message-Id: <20260915074135.2567411-8-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan QRTR endpoint ID fetching will currently not be available for AHB. Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath11k/ahb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/a= th/ath11k/ahb.c index 27d01411b6e9c..1cd81d2ac1201 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -798,6 +798,11 @@ static int ath11k_ahb_hif_resume(struct ath11k_base *a= b) return 0; } =20 +static int ath11k_ahb_set_qrtr_endpoint_id(struct ath11k_base *ab) +{ + return -EOPNOTSUPP; +} + static const struct ath11k_hif_ops ath11k_ahb_hif_ops_ipq8074 =3D { .start =3D ath11k_ahb_start, .stop =3D ath11k_ahb_stop, @@ -811,6 +816,7 @@ static const struct ath11k_hif_ops ath11k_ahb_hif_ops_i= pq8074 =3D { .power_up =3D ath11k_ahb_power_up, .ce_irq_enable =3D ath11k_ahb_ce_irqs_enable, .ce_irq_disable =3D ath11k_ahb_ce_irq_disable_sync, + .set_qrtr_endpoint_id =3D ath11k_ahb_set_qrtr_endpoint_id, }; =20 static const struct ath11k_hif_ops ath11k_ahb_hif_ops_wcn6750 =3D { @@ -830,6 +836,7 @@ static const struct ath11k_hif_ops ath11k_ahb_hif_ops_w= cn6750 =3D { .resume =3D ath11k_ahb_hif_resume, .ce_irq_enable =3D ath11k_pci_enable_ce_irqs_except_wake_irq, .ce_irq_disable =3D ath11k_pci_disable_ce_irqs_except_wake_irq, + .set_qrtr_endpoint_id =3D ath11k_ahb_set_qrtr_endpoint_id, }; =20 static int ath11k_core_get_rproc(struct ath11k_base *ab) --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 69CA445D900; Tue, 15 Sep 2026 07:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458305; cv=pass; b=I7203+17yfQxLiI2fZ3qIp4LHsRGCbK7VOUOgGJggMj9hV/pQR/Xh4hcfOJi+sRKDTqAhGvK68iqNs1kFeb3rMdwO+Bdu0oW2FEDCX/qaOos48cOhUZPraPzZlzg8dVQvdLHMm2/3SZs0fCo4Wh20QZPfvfn2KXunUyDgFPgWNo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458305; c=relaxed/simple; bh=enV2kS1MIwHjXbYjHjRD3HBW9Nc1XOK61bJzzLEmGds=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cTZIvSeCUG/D7syGJhTys4ugV6J8WCCqmZY2iFMUz5HTZf3CGx8nw1s6kQw0d0V+rwGebvgsy6ZOoeKKR1qZHtnn8f73RSnKwpzmHQfqtyZeBY+tJwPeFHAiyUzwQUD2elqOCOhfTaM0YtuPvnfzJGCLtAFhl0hYEu/oUtlcTdI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=fssxXVkK; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="fssxXVkK" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYvZ2c8sz49Q6x; Tue, 15 Sep 2026 10:44:58 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dMiUD8CXxFO5/POyjEVKFLNmf5/jxdGfzIul6o7WvA0=; b=fssxXVkK8DgY8iIwyUdYnqoRCtMiHEoxVRRWm0G8vv1PLLCrk50pDW4XSGfO65dlOgGz4K CLiHU91nnRkM9yZYAe0bn7MP6wr/OOoVbOEcGHpw5sIr/QFdnsr1MG9QJ1eRs64zk0kJ1R YyTIF+r3kFcduNuF8f5BkG8y+2NxuaDGV+FmgyhHx2W8NhUHHN5nsYNglR/oS6ebLza/aY xMTZNae4DdTfjpuPa1qsNY3DDYaASg5nutiOTBz6ZDPnhX1qyzn87onVuOUNOetZcYUMwJ w0X6GS6+Z4EYUxRH5mOwlLb6IK3ckT9Dupq7mYYPjh8scOOh/oKbt0tdR9pWLg== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458298; b=N622PJwHRKgr2SvSUv6xpskxMSna5SH66lZizoeezWBVc1Nr8xwXgeJ8E3ctpjJCAjNU7M tnlGNuYMLMkdz8QUDuUadky6Vg8ceYl0b+PUB/w6cFn1mn+ghgAF0MymuAhbuh2Z3NHU7R cVHg0F1w3FUghd33uMY70OtZu5XHtRU9oaJEaEGu7pPsFcooneBElVD8DKAaez3pyRffuT VCe+0Da4uSio4gqm9nW+VtzMnjtB32tgqgtSR4mQnRkLwyqIUj8z9Y1viVgfXN+oV8ldp8 VBLvGtak69sJkrguezB64K933GQ3oOTDcQheP31zb+wntK42g45XDlpA54uVuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dMiUD8CXxFO5/POyjEVKFLNmf5/jxdGfzIul6o7WvA0=; b=O6xP6DD29KaPJIzUUa5MGKvZCo6jvo/pFzuknYmdV2JRtADc4Y+a7oei9GD9HSgSozC2wq +XVZY9V/ly2hWonri9Cm6juH4C06kqSllOQGjfdJkIrV9kSeX6osKtEUWiPWFd/pFXeok6 /KRADscJHkfo/kNK3r2vr0/S6Jm56kQWm2M7KjAnEKEj5q/IR8ztvWX0zVaEKojY3vwWjX gwHw5GaYVK73t8uOCMuL6g50k+HMvgG4DUVkRUvB9g/Ta8vhTxFpL7Yg8yQN6S30ZrcPIH fZYvqhlBU9/0WEeeNo3/HiI8bQDT17huYgajARx1Ft0CO7UHlXufz5BGUJhOpw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 08/12] wifi: ath11k: implement QRTR endpoint ID fetching for PCI Date: Tue, 15 Sep 2026 10:41:31 +0300 Message-Id: <20260915074135.2567411-9-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" QRTR endpoint ID fetching for PCIe devices will use MHI. Originally-by: Mihai Moldovan Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath11k/mhi.c | 46 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/mhi.h | 1 + drivers/net/wireless/ath/ath11k/pci.c | 1 + 3 files changed, 48 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/a= th/ath11k/mhi.c index a6c9ff112c68f..755a57b6058a1 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c @@ -11,6 +11,8 @@ #include #include =20 +#include + #include "core.h" #include "debug.h" #include "mhi.h" @@ -502,3 +504,47 @@ void ath11k_mhi_coredump(struct mhi_controller *mhi_ct= rl, bool in_panic) { mhi_download_rddm_image(mhi_ctrl, in_panic); } + +static void ath11k_mhi_qrtr_free_mhi_id(void *mhi_cntrl_void) +{ + struct mhi_controller *mhi_cntrl =3D mhi_cntrl_void; + u32 id =3D mhi_cntrl->qrtr_endpoint_id; + + if (id !=3D 0) + qrtr_endpoint_free_data_id(id); + mhi_cntrl->qrtr_endpoint_id =3D 0; + mhi_cntrl->free_qrtr_endpoint_id =3D NULL; +} + +int ath11k_mhi_set_qrtr_endpoint_id(struct ath11k_base *ab) +{ + struct ath11k_pci *ab_pci =3D ath11k_pci_priv(ab); + struct ath11k_qmi *qmi =3D &ab->qmi; + int ret; + + spin_lock(&ab_pci->mhi_ctrl->qrtr_endpoint_lock); + + if (ab_pci->mhi_ctrl->qrtr_endpoint_id) { + qmi->handle.endpoint_id =3D ab_pci->mhi_ctrl->qrtr_endpoint_id; + } else { + ret =3D qrtr_endpoint_get_data_id(&qmi->handle.endpoint_id); + if (!ret) { + ab_pci->mhi_ctrl->qrtr_endpoint_id =3D + qmi->handle.endpoint_id; + ab_pci->mhi_ctrl->free_qrtr_endpoint_id =3D + ath11k_mhi_qrtr_free_mhi_id; + } + } + + spin_unlock(&ab_pci->mhi_ctrl->qrtr_endpoint_lock); + + ath11k_dbg(ab, ATH11K_DBG_PCI, + "queried mhi_ctrl QRTR endpoint ID: %u\n", + qmi->handle.endpoint_id); + if (ret) { + ath11k_warn(ab, "failed to query QRTR endpoint ID: %d\n", ret); + return ret; + } + + return 0; +} diff --git a/drivers/net/wireless/ath/ath11k/mhi.h b/drivers/net/wireless/a= th/ath11k/mhi.h index 7e7561ce883cb..46a9c978b30d1 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.h +++ b/drivers/net/wireless/ath/ath11k/mhi.h @@ -28,4 +28,5 @@ int ath11k_mhi_suspend(struct ath11k_pci *ar_pci); int ath11k_mhi_resume(struct ath11k_pci *ar_pci); void ath11k_mhi_coredump(struct mhi_controller *mhi_ctrl, bool in_panic); =20 +int ath11k_mhi_set_qrtr_endpoint_id(struct ath11k_base *ab); #endif diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/a= th/ath11k/pci.c index a163168f36176..56490a21964a3 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -918,6 +918,7 @@ static const struct ath11k_hif_ops ath11k_pci_hif_ops = =3D { .ce_irq_enable =3D ath11k_pci_hif_ce_irq_enable, .ce_irq_disable =3D ath11k_pci_hif_ce_irq_disable, .get_ce_msi_idx =3D ath11k_pcic_get_ce_msi_idx, + .set_qrtr_endpoint_id =3D ath11k_mhi_set_qrtr_endpoint_id, #ifdef CONFIG_DEV_COREDUMP .coredump_download =3D ath11k_pci_coredump_download, #endif --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 2952832D7F8; Tue, 15 Sep 2026 07:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458323; cv=pass; b=BISCGR1vxQms8pZNE5do7fO96NWckPIGiB2BRvry0XyLYCTP3iEGi3B59e3iHJXYQHkQjD18Yx5oe0IzIfvm0IIfnTM2pnGnYaVmq5ky3yu6w1WFSXfSvQuRNtC+nfoIBUKloiSh/cGdwkDG2M4hkl+wB07wKtGisUfS5uNHIrc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458323; c=relaxed/simple; bh=MS4N+wBIu8d1ilLBdLyUw8sDD8/0Zw7lI6RU/EotEcw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tvLWXV5nJIZWDZqLfF61typ7NzL1RMTEWC5kzTj9LWvuGajeDhT8tS0KtRoq854BjjhUtL8TovGi7/F9R3UDYazIlP8YjGVzMSzH+/meAqT/phB4cbjclnhp48O+YDdTYZMT99SrZBSC1Z18bhkBgHnZ+ffSZao+typ+QOKLqRY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=KFoazCVb; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="KFoazCVb" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYvv061Xz49Q6x; Tue, 15 Sep 2026 10:45:15 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPWwjv2lCc78jyciiGeHhfapHx7+w7VurSqk2gEfFB0=; b=KFoazCVbt9KjJ3uE4qMhMFoxJ3RdjvAoV93BUqES91xZ5TunfAHuyNPqJVoYV56FWUf2A4 2ZG6XTr3PoNtNstubzTRS5FVJx39nN7I2En02rmxpFLj3fee5hvEWgYcQzN/uK0I+5tmWM 3sfZD23cs3A3EppZvQKpVsVU3pSNsIxevg7WL/RKD2g9yUfYsIxGSoZpBl0LMrC3YPQ7rT 27oUcf5gjl2aMFT2sH9ShomIfWnZ3cU2usgTt4RMicFy3fgVpem0i2fFD68EiY8jfVaY8a fJ9VWQ6vLMN91QurBrGoMBjwtvYX2bPLI2r08r8dStb1E39pZ+Uz5zHuiH9jVA== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458315; b=djaVSyXl+sHFFQp9z0hvr7LYJsMM5kDmhoV54l4z/UWqTLOtO9mHCgN6nkWHLBcboy0L+8 qwXSuPuMccwDi2J9UBK9crZL1vjO7M1r5JyTWatu2ZXVw46oNvLWzt7BWcpsy79FlpEMr2 JjSiN7ZnLDrz4ODOHgQHi06nOvJz8ORHYLepwZcx5/Nc2UYQN8sbOQhk+miPEpa7cPLf4H MjLvhCaqPZYSI0IgXA8ollhDsfqPSnbIfAlJP5n2SB4z4eVCC+cxiNY6Obuz9USq7GfkiS euiBKqWgDyarF4O9yUe1FZfnONCQd3/WLemMTA64VIj48TGCDQJwRCk3aHsNkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WPWwjv2lCc78jyciiGeHhfapHx7+w7VurSqk2gEfFB0=; b=UHzuubR+VxZYxtNsV7lm1EfJL397Ya7G/jGTvzmJf/Cm8vYH0CuaANguY9y7Gukn2LzwAy EKImPMGeNY973ne9NTmqvJ7alPj9hNH8+F0GYG2H6cFKr2f0PW6yHX8DTghd5yFjRWURCX gZ5fbPz6cn74cTTpbquW8vuUXtTYnUveM5qRn1BjsMpHR2S7Ymzivuu4/Ji3jxqJJ2KsWe h8hJlKXixqEPI3NnXx2Id50ezzhMMUQt+g1Wne4wrTePrM4vT07sXFS4mV0WbIjZG1rdT9 767mQc3LKguHz8xQdqk2FLifW9+fAQ3AtmOUwccVsoWbf1hzXXEt+BlBVs3OlQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 09/12] wifi: ath11k: bind to QRTR endpoint ID in ath11k_qmi_init_service Date: Tue, 15 Sep 2026 10:41:32 +0300 Message-Id: <20260915074135.2567411-10-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan If possible, fetch the QRTR endpoint ID in ath11k_qmi_init_service, just before calling qmi_handle_init, and make it available in the qmi_handle. qmi_helpers will then automatically bind to this endpoint for us. This finally allows using multiple ath11k-based cards with the same QRTR node/port combination to work simultanenous (and, for that matter, at all). Signed-off-by: Mihai Moldovan Tested-by: Juha-Matti Tilli Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04685-QCAHSPSWPL_V1_V2_SILICONZ_I= OE-1 Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath11k/qmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/a= th/ath11k/qmi.c index 7dc07339b9579..ee5effc113667 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define HOST_CSTATE_BIT 0x04 @@ -3324,6 +3325,13 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) ab->qmi.ab =3D ab; =20 ab->qmi.target_mem_mode =3D ab->hw_params.fw_mem_mode; + + ret =3D ath11k_set_qrtr_endpoint_id(ab); + if (ret) { + ath11k_warn(ab, "failed to set QRTR endpoint ID: %d\n", ret); + ath11k_warn(ab, "only one device per system will be supported\n"); + } + ret =3D qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX, &ath11k_qmi_ops, ath11k_qmi_msg_handlers); if (ret < 0) { --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 2A80B32D7F8; Tue, 15 Sep 2026 07:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458340; cv=pass; b=EH8T4f0empi5PpB8xDc/vXwbcQbBC/n5Iq7/WR01hoUux0JFzCuvPyvnDH1RN322sCJt3iRh5DK9MZ0QVfMuQUPbIha39SO+ZQOrpG1vIItNUjC0lOBb3sDKxUTucSjCS2XViEFG2boFSKVy6G99PWeUv4nrTbvV1Byq94hQZNY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458340; c=relaxed/simple; bh=on9XxVhWLOh5qBhiXVNTYYMYu4a7lEGjwAwi7dwFPvA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CWwznPuXZMni1a0ckWv/SVc2YdTuvfaP7Jkxm71y6+CVtAR9q9JJgUpa4CAvlxoqpe9NEs1aiMu3Va9iwu4Ul2j5skcP1Amskc7z1lu/nMQ9Bcjz4TxvGZudI/1OIMWgUf3ZMgITsWxwi7oHPzwNWahgyGgUmMbiStOtV6RzkiU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=GFI9TFNc; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="GFI9TFNc" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYwD17PFz49Q6x; Tue, 15 Sep 2026 10:45:32 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLt+l40Q3PpFquTJGHV0pr4yqekDZGuuw51X1SrFTE8=; b=GFI9TFNcwhRqA62Hr5qFGhZk+U388b3j0kbMGyCuLGxBhTr/19T/9e+nPa8iNhBawQp2Sc MnpEev0653GuSc82GOh5Weg9S4hkbWTxWjNs43k4p7hgFV7+ZC7QiISEFMQey/ShYczJ/G maKE7x960QmIF/IPuC5HsbosnokbEvO05AjG3lHSSZ8KWz/XvbuOHKwZb98ltl65R6WdSN CVKfmkjxXODe2l6oQ/Q9NjrqZBPcW5R69jn4iztYHuJTGyZvP/ELwjaqLpWzBaChK/pVkC juSvSjuv3YE1RPVDTHW3d7yoMXiDshBUUK7woKTUZTaJq42pmNAmdUdcj2tBhg== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458332; b=vGV1q9uOCXnIAbiq6g+n8Fh4+pyPnn4ZVSgSZyj5krs4bh/LxhPnoGuq1nEM8YtU1hydhb qzxPR2BJFtWVCxcATV2gWHt34RMIrJYPyosamsMUUfcVuXg7+p51oFFnB0fsMm88IH1xfl jTdyl8GrbG5uQy+yq2obKhMMR+NGm2um1A/SImm8dpAVUP+ldxTQpjitxdmTtJGrGD2ce6 gbhSTzXd5cWgvztLl+Y1FT4H0dKz14TFInNaiRpZQ/KXzRbFHFmcbOM8WF5xDcilhCrEY6 7hxN5LDLtExhI3SvqoZJ36qyULPaApZ6LSDhU+DpzM7V9l51M5mYIgz+BTDv+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLt+l40Q3PpFquTJGHV0pr4yqekDZGuuw51X1SrFTE8=; b=HYZo5SK+l0RWK0daZpPhBvo5TCKGKM4SkrIV0W+0vIzM7GSQa7kTwt2jfIWVmLgwUvhTXL r2bu/np+f2G2T1YE+HNIF6dnajxYmmGnq6C3xwC/70SWHCVX7ynzXJWQ9u5bd79NCXaqud mbVnlSAxR/PrSYuEloCgyaCl0xtTHXRp6uxLf2R457uZTs0IiOPLfcXMLJl8pLp9xT4SC/ V9sMx2ptlaqATniV27GwpY+UgefB3P6Sm0FDdsOQMrlYTIvVT03zM2A5MG/AQW3Tp6IhHO U81xEUTLiP896fOJy9p8VcjHad2iI9CN1UVJFizweYGPkQIOxpgQvyvNTb+Gcw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 10/12] wifi: ath12k: add QRTR endpoint ID hif feature Date: Tue, 15 Sep 2026 10:41:33 +0300 Message-Id: <20260915074135.2567411-11-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan This will allow fetching the QRTR endpoint ID via hardware-specific means. Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath12k/hif.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/hif.h b/drivers/net/wireless/a= th/ath12k/hif.h index 4de8667690e91..4591660519efb 100644 --- a/drivers/net/wireless/ath/ath12k/hif.h +++ b/drivers/net/wireless/ath/ath12k/hif.h @@ -32,6 +32,7 @@ struct ath12k_hif_ops { void (*get_ce_msi_idx)(struct ath12k_base *ab, u32 ce_id, u32 *msi_idx); int (*panic_handler)(struct ath12k_base *ab); void (*coredump_download)(struct ath12k_base *ab); + int (*set_qrtr_endpoint_id)(struct ath12k_base *ab); }; =20 static inline int ath12k_hif_map_service_to_pipe(struct ath12k_base *ab, u= 16 service_id, @@ -162,4 +163,13 @@ static inline void ath12k_hif_coredump_download(struct= ath12k_base *ab) if (ab->hif.ops->coredump_download) ab->hif.ops->coredump_download(ab); } + +static inline int ath12k_hif_set_qrtr_endpoint_id(struct ath12k_base *ab) +{ + if (!ab->hif.ops->set_qrtr_endpoint_id) + return -EOPNOTSUPP; + else + return ab->hif.ops->set_qrtr_endpoint_id(ab); +} + #endif /* ATH12K_HIF_H */ --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (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 D85BD394470; Tue, 15 Sep 2026 07:46:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458365; cv=pass; b=EEK6uZuKd00QBKTtX9L2UnIYIQiYKt/w+vFOIdq48CyvIpopVyJBsCpK0OgKdAYb0uaP9xj5rp7qrRZufTlUtapdt3qd/MLVWsNejyU2f5zKCxvjcojsjXjbHyKd8DvCsPIY+1Rf01fhg7KOaSf39oe+f2PVE9yRdZ1SG4n+LwU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458365; c=relaxed/simple; bh=xs+RvB1iCnuBwduzzzqF2lCfl4nixTxCqex0JP+Z/Lw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JCDGO0uDCYU1mTggN8S1wFcgCwCOEMRUnZqo1zGzTt7/qD42VszEUs4F6rWbIaHdeK15jZiGvxKiu1a+ArnkyYuHvr/CdlUxgQzF0Ng27qwdD6mbIlhAQj73/6b367yPaiN3ZUjCWv9cPO9FKWP8Fjnbqiss/PRu+pZpXCEsDMs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=tkgoV7sH; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="tkgoV7sH" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hkYwj6jV6z49Q8v; Tue, 15 Sep 2026 10:45:57 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DkkTpGuw3kjQPg0827cXMo9wlb6PxVdztbjyv9fxYRE=; b=tkgoV7sH2MyxlYGpctGt4LQrpHRunNaSmutUxAwS8R4rneEuLo6wapJOB+7ahBVHd4eMyu 0zaXbe/KTFVON0cH6Hjkeg9X8oRd/MfuslJBwDcDiU1N/qKuwZebcqUXPgpFA2pTkGlkXU UdSP9B2lUS4t9pwBuK6k88zB64YJBeWGTi6NMhURYFm2vdEYUtpPGWEfkt1hM9E2b972g7 hh8KMFUbgftOSLwRDoMpUQy7ymjSipV8B1ahr9NokKXZbp217mPnDCqKZfJsPOgvnZZ5aX ivY3/1Y1pBkHUWKovWgROIu15gZHGu3GcfR8nY29NbjebsX9gr65rN33LrvI0w== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1789458358; b=BhVhSAt39LAEYLm8MPu4TDgVBTBSJzLcHDOozD6K8OW0yr/Y0wq3G3cfR3JEhYvtz1/2DH q78Nbtlv88W8gG8AZfehIioxvhAD2cDZsw6WXlOO6IzVVNle9Gb90WGIaJWmjyFLDFs8/m plw5Ohggsdmz22uZU6YzCloBVY2eULfnbWT8G3DDA98xdeL9g80yay21eQFTWsP12EA6U+ xzh7/pBz7+/c8LrKwQBvwi3RJSIWxBafK1x0beAZkF9y4+egYpO5msoTQJfFa23bQEdsnI Jbb5LZQIUrl4FCZ2hZikfv9HqCmZAxYg8rC3rip7hDRPTTRL1feP6aum2iJNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1789458358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DkkTpGuw3kjQPg0827cXMo9wlb6PxVdztbjyv9fxYRE=; b=j+qBtzUZIfx3Eh4TxJcT9X1c1tNEBJ+QR7hhqkRIwArNZgyykrKkIn8qHu7oNCQ3kKfcYR 74ngVDvXRq7a0RIlfCSlvKEM2pKjhi5Vo49kqvMv+KE2KsoSysjaeLESgwpX3N4dLmz5KK hIqwLkA2o0b+fbokzsN0eqwlnqFMK6pyV+y29KQ4oZ1GBDyBjPqrE5rOAfF3a+1z7sQy9N gTLM9IsSG2IPLsa2fnjFJYD5JgLOJgVJEo/CrOERTwXVR1tjUVcmykCNDuixFfjqRa45iR 8MRoJ82L1q6S9Mh2kz5IhHbuqQKNSbz/iub6ShieOQzB9pi2xR4O++fQejFUYQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 11/12] wifi: ath12k: implement QRTR endpoint ID fetching for PCI Date: Tue, 15 Sep 2026 10:41:34 +0300 Message-Id: <20260915074135.2567411-12-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" QRTR endpoint ID fetching for PCIe devices will use MHI. Originally-by: Mihai Moldovan Signed-off-by: Mihai Moldovan Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath12k/mhi.c | 46 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/mhi.h | 3 ++ drivers/net/wireless/ath/ath12k/pci.c | 1 + 3 files changed, 50 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/a= th/ath12k/mhi.c index ee87f00bc5de9..3d0884e65939d 100644 --- a/drivers/net/wireless/ath/ath12k/mhi.c +++ b/drivers/net/wireless/ath/ath12k/mhi.c @@ -8,6 +8,8 @@ #include #include =20 +#include + #include "core.h" #include "debug.h" #include "mhi.h" @@ -527,3 +529,47 @@ void ath12k_mhi_coredump(struct mhi_controller *mhi_ct= rl, bool in_panic) { mhi_download_rddm_image(mhi_ctrl, in_panic); } + +static void ath12k_mhi_qrtr_free_mhi_id(void *mhi_cntrl_void) +{ + struct mhi_controller *mhi_cntrl =3D mhi_cntrl_void; + u32 id =3D mhi_cntrl->qrtr_endpoint_id; + + if (id !=3D 0) + qrtr_endpoint_free_data_id(id); + mhi_cntrl->qrtr_endpoint_id =3D 0; + mhi_cntrl->free_qrtr_endpoint_id =3D NULL; +} + +int ath12k_mhi_set_qrtr_endpoint_id(struct ath12k_base *ab) +{ + struct ath12k_pci *ab_pci =3D ath12k_pci_priv(ab); + struct ath12k_qmi *qmi =3D &ab->qmi; + int ret; + + spin_lock(&ab_pci->mhi_ctrl->qrtr_endpoint_lock); + + if (ab_pci->mhi_ctrl->qrtr_endpoint_id) { + qmi->handle.endpoint_id =3D ab_pci->mhi_ctrl->qrtr_endpoint_id; + } else { + ret =3D qrtr_endpoint_get_data_id(&qmi->handle.endpoint_id); + if (!ret) { + ab_pci->mhi_ctrl->qrtr_endpoint_id =3D + qmi->handle.endpoint_id; + ab_pci->mhi_ctrl->free_qrtr_endpoint_id =3D + ath12k_mhi_qrtr_free_mhi_id; + } + } + + spin_unlock(&ab_pci->mhi_ctrl->qrtr_endpoint_lock); + + ath12k_dbg(ab, ATH12K_DBG_PCI, + "queried mhi_ctrl QRTR endpoint ID: %u\n", + qmi->handle.endpoint_id); + if (ret) { + ath12k_warn(ab, "failed to query QRTR endpoint ID: %d\n", ret); + return ret; + } + + return 0; +} diff --git a/drivers/net/wireless/ath/ath12k/mhi.h b/drivers/net/wireless/a= th/ath12k/mhi.h index 3674326763858..3e692ce0b5108 100644 --- a/drivers/net/wireless/ath/ath12k/mhi.h +++ b/drivers/net/wireless/ath/ath12k/mhi.h @@ -41,4 +41,7 @@ void ath12k_mhi_clear_vector(struct ath12k_base *ab); void ath12k_mhi_suspend(struct ath12k_pci *ar_pci); void ath12k_mhi_resume(struct ath12k_pci *ar_pci); void ath12k_mhi_coredump(struct mhi_controller *mhi_ctrl, bool in_panic); + +int ath12k_mhi_set_qrtr_endpoint_id(struct ath12k_base *ab); + #endif diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/a= th/ath12k/pci.c index 6441927b53822..7b73672e5e8e4 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1508,6 +1508,7 @@ static const struct ath12k_hif_ops ath12k_pci_hif_ops= =3D { .ce_irq_enable =3D ath12k_pci_hif_ce_irq_enable, .ce_irq_disable =3D ath12k_pci_hif_ce_irq_disable, .get_ce_msi_idx =3D ath12k_pci_get_ce_msi_idx, + .set_qrtr_endpoint_id =3D ath12k_mhi_set_qrtr_endpoint_id, .panic_handler =3D ath12k_pci_panic_handler, #ifdef CONFIG_ATH12K_COREDUMP .coredump_download =3D ath12k_pci_coredump_download, --=20 2.34.1 From nobody Fri Sep 25 12:06:33 2026 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 02CAD3876CC; Tue, 15 Sep 2026 07:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458405; cv=pass; b=bp/yVilX6fBgl5BL/bYK4oj+Eh1oRuQjd5Xq/hOWcg3WEIbqvtRx1HEUsygxmyb/3HeavKUxvAHsfCXfpbP14sZIGbqRHqlnw5GrQjoBncaERwDPoovZ1xHHsEcoxYbbEIGWZGrG/OwuyRlAgErILLQzfY/ZABE2DUM29Fe/iXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789458405; c=relaxed/simple; bh=CjIuEh27k1Xal8RS7CusYRx4cMVCNqvokJf2yY4eXCU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sEQPQwFas1nhvsg8dGE9ZTcFv2b0TW9FIhoRv7A8+TaFJybjYAHdH9QeXXsj1WvFoN/t09aHIgndcan9IZ2Jq/i3Sn5hzYBjGQIJLfVolbtYv7l/PgrcN+UkIMUBY9udR8dvxcGDEubppUZChM07zBnfQb4pOE/6c2xwoWL06cI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=OqNGYX7v; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="OqNGYX7v" Received: from mandelbrot.. (xdsl-83-150-90-33.nebulazone.fi [83.150.90.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmtilli) by meesny.iki.fi (Postfix) with ESMTPSA id 4hkYxT3qlZzySb; Tue, 15 Sep 2026 10:46:37 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vRs19l52ovGuAIjGa7YqoKMg2NfGlSjJwTPL4k7vc2c=; b=OqNGYX7vVbvIxmsjtk2iQWRf8dbYFihlNE89E8lbUVn7GPXTxHKhx9rEZduo3om+1v6KJR LG07Ihot+saV2Mnj5N6DksBKYcVoX9PkMIjs5cvGfd1p6EzyFsMyjRP4d+GezG/iJIvsUY P118wN8WCBkY7dViRsPQbn2lhp1t5jc= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1789458397; b=oggymuq6kYnCD9ygbnfq5pW2izEpq/HMDNiT8xlKY8NWS088zm19ixvqM3dWW3yWQrJ2SK AsPM/clBPb83G8I4zNv6M8YaQ8CrY0QIEpT7u2h7bCiI6aDJA0VE5F1yIvTQgN1jLEynNQ YPfiB68/TscZLuN3RixRNXAJahCaELg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1789458397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vRs19l52ovGuAIjGa7YqoKMg2NfGlSjJwTPL4k7vc2c=; b=fax/XSqyVU8LzgedToyLxUTctI5UAwgECN+5d1KbxtWPNGFmjzQYWPHDpWCCOiGoUKUf4k Mmj7uPTrxtFm8X2kkh/SrOFSQT8rSJ3a0iZzbhWcrrwRGuOx4faPha9xUtLG7tUVoxkVWN 7iqeCFgqnMB+a7sHjS1PALni7QuZNjc= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=jmtilli smtp.mailfrom=juha-matti.tilli@iki.fi From: Juha-Matti Tilli To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam , Jeff Johnson Cc: Jeff Hugo , Bjorn Andersson , Konrad Dybcio , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Juha-Matti Tilli , Mihai Moldovan , Denis Kenzior Subject: [PATCH v4 12/12] wifi: ath12k: bind to QRTR endpoint ID in ath12k_qmi_init_service Date: Tue, 15 Sep 2026 10:41:35 +0300 Message-Id: <20260915074135.2567411-13-juha-matti.tilli@iki.fi> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> References: <20260915074135.2567411-1-juha-matti.tilli@iki.fi> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mihai Moldovan If possible, fetch the QRTR endpoint ID in ath12k_qmi_init_service, just before calling qmi_handle_init, and make it available in the qmi_handle. qmi_helpers will then automatically bind to this endpoint for us. This finally allows using multiple ath12k-based cards with the same QRTR node/port combination to work simultanenous (and, for that matter, at all), including combinations of ath11k-based and ath12k-based cards. Signed-off-by: Mihai Moldovan Old-version-tested-by: Mihai Moldovan Old-version-tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V= 1.0_V2.0_SILICONZ-3 Signed-off-by: Juha-Matti Tilli --- drivers/net/wireless/ath/ath12k/qmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/a= th/ath12k/qmi.c index 50082505c882d..3611d0eff22b3 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -9,11 +9,13 @@ #include "qmi.h" #include "core.h" #include "debug.h" +#include "hif.h" #include #include #include #include #include +#include =20 #define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02 #define HOST_CSTATE_BIT 0x04 @@ -4075,6 +4077,13 @@ int ath12k_qmi_init_service(struct ath12k_base *ab) ab->qmi.ab =3D ab; =20 ab->qmi.target_mem_mode =3D ab->target_mem_mode; + + ret =3D ath12k_hif_set_qrtr_endpoint_id(ab); + if (ret) { + ath12k_warn(ab, "failed to set QRTR endpoint ID: %d\n", ret); + ath12k_warn(ab, "only one device per system will be supported\n"); + } + ret =3D qmi_handle_init(&ab->qmi.handle, ATH12K_QMI_RESP_LEN_MAX, &ath12k_qmi_ops, ath12k_qmi_msg_handlers); if (ret < 0) { --=20 2.34.1