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

Commit 3b5c20d7 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 b2117d5f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/uidgid.h>

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

#include "qrtr.h"

@@ -843,13 +844,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;
@@ -872,6 +876,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);

+5 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015, Sony Mobile Communications Inc.
 * Copyright (c) 2013, 2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013, 2018-2019 The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -61,6 +61,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);
@@ -75,7 +76,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;

+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static int qrtr_tun_open(struct inode *inode, struct file *filp)

	filp->private_data = tun;

	return qrtr_endpoint_register(&tun->ep, QRTR_EP_NET_ID_AUTO);
	return qrtr_endpoint_register(&tun->ep, QRTR_EP_NET_ID_AUTO, 0);
}

static ssize_t qrtr_tun_read_iter(struct kiocb *iocb, struct iov_iter *to)