Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a6eb4b3 authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Chris Lew
Browse files

net: qrtr: Make qrtr rx threads as RT priorities



To support high priority clients like sensor use cases in all system
conditions elevating the router reader threads to RT priorities based
on configuration.

Change-Id: I6f46097f6678f2e00c3ec8872b208d773c377224
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
parent 5219be0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ static int qrtr_fifo_xprt_probe(struct platform_device *pdev)
	qrtr_fifo_config_init(xprtp);

	xprtp->ep.xmit = xprt_write;
	ret = qrtr_endpoint_register(&xprtp->ep, QRTR_EP_NID_AUTO);
	ret = qrtr_endpoint_register(&xprtp->ep, QRTR_EP_NID_AUTO, false);
	if (ret)
		return ret;

+4 −1
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,
{
	struct qrtr_mhi_dev *qdev;
	u32 net_id;
	bool rt;
	int rc;

	qdev = devm_kzalloc(&mhi_dev->dev, sizeof(*qdev), GFP_KERNEL);
@@ -160,10 +161,12 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,
	if (rc < 0)
		net_id = QRTR_EP_NET_ID_AUTO;

	rt = of_property_read_bool(mhi_dev->dev.of_node, "qcom,low-latency");

	INIT_LIST_HEAD(&qdev->ul_pkts);
	spin_lock_init(&qdev->ul_lock);

	rc = qrtr_endpoint_register(&qdev->ep, net_id);
	rc = qrtr_endpoint_register(&qdev->ep, net_id, rt);
	if (rc)
		return rc;

+7 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/uidgid.h>

#include <net/sock.h>
#include <uapi/linux/sched/types.h>

#include "qrtr.h"

@@ -921,13 +922,16 @@ static void qrtr_node_rx_work(struct kthread_work *work)
 * qrtr_endpoint_register() - register a new endpoint
 * @ep: endpoint to register
 * @nid: desired node id; may be QRTR_EP_NID_AUTO for auto-assignment
 * @rt: flag to notify real time low latency endpoint
 * Return: 0 on success; negative error code on failure
 *
 * The specified endpoint must have the xmit function pointer set on call.
 */
int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id)
int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id,
			   bool rt)
{
	struct qrtr_node *node;
	struct sched_param param = {.sched_priority = 1};

	if (!ep || !ep->xmit)
		return -EINVAL;
@@ -950,6 +954,8 @@ int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id)
		kfree(node);
		return -ENOMEM;
	}
	if (rt)
		sched_setscheduler(node->task, SCHED_FIFO, &param);

	mutex_init(&node->qrtr_tx_lock);
	INIT_RADIX_TREE(&node->qrtr_tx_flow, GFP_KERNEL);
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ struct qrtr_endpoint {
	struct qrtr_node *node;
};

int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id);
int qrtr_endpoint_register(struct qrtr_endpoint *ep, unsigned int net_id,
			   bool rt);

void qrtr_endpoint_unregister(struct qrtr_endpoint *ep);

+4 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev)
{
	struct qrtr_smd_dev *qdev;
	u32 net_id;
	bool rt;
	int rc;

	qdev = devm_kzalloc(&rpdev->dev, sizeof(*qdev), GFP_KERNEL);
@@ -74,7 +75,9 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev)
	if (rc < 0)
		net_id = QRTR_EP_NET_ID_AUTO;

	rc = qrtr_endpoint_register(&qdev->ep, net_id);
	rt = of_property_read_bool(rpdev->dev.of_node, "qcom,low-latency");

	rc = qrtr_endpoint_register(&qdev->ep, net_id, rt);
	if (rc)
		return rc;

Loading