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

Commit 92caad5b authored by Dhoat Harpal's avatar Dhoat Harpal
Browse files

soc: qcom: glink_smem_native_xprt: Move rx_worker in irq handler



Tx_data cmd is processed in tasklet which is not guranteed to be
scheduled immidiatley. This decreases performance of glink.

Process tx_data command in irq handler.

CRs-Fixed: 2225619
Change-Id: Ida5e51b83fa46c76f72ae886260752baa8b942b9
Signed-off-by: default avatarDhoat Harpal <hdhoat@codeaurora.org>
parent 463cf733
Loading
Loading
Loading
Loading
+1 −22
Original line number Diff line number Diff line
@@ -171,8 +171,6 @@ struct mailbox_config_info {
 * @kwork:			Work to be executed when an irq is received.
 * @kworker:			Handle to the entity processing of
				deferred commands.
 * @tasklet			Handle to tasklet to process incoming data
				packets in atomic manner.
 * @task:			Handle to the task context used to run @kworker.
 * @use_ref:			Active uses of this transport use this to grab
 *				a reference.  Used for ssr synchronization.
@@ -216,7 +214,6 @@ struct edge_info {
	struct kthread_work kwork;
	struct kthread_worker kworker;
	struct task_struct *task;
	struct tasklet_struct tasklet;
	struct srcu_struct use_ref;
	bool in_ssr;
	spinlock_t rx_lock;
@@ -1190,18 +1187,6 @@ static void __rx_worker(struct edge_info *einfo, bool atomic_ctx)
	srcu_read_unlock(&einfo->use_ref, rcu_id);
}

/**
 * rx_worker_atomic() - worker function to process received command in atomic
 *			context.
 * @param:	The param parameter passed during initialization of the tasklet.
 */
static void rx_worker_atomic(unsigned long param)
{
	struct edge_info *einfo = (struct edge_info *)param;

	__rx_worker(einfo, true);
}

/**
 * rx_worker() - worker function to process received commands
 * @work:	kwork associated with the edge to process commands on.
@@ -1221,7 +1206,7 @@ irqreturn_t irq_handler(int irq, void *priv)
	if (einfo->rx_reset_reg)
		writel_relaxed(einfo->out_irq_mask, einfo->rx_reset_reg);

	tasklet_hi_schedule(&einfo->tasklet);
	__rx_worker(einfo, true);
	einfo->rx_irq_count++;

	return IRQ_HANDLED;
@@ -2373,7 +2358,6 @@ static int glink_smem_native_probe(struct platform_device *pdev)
	init_waitqueue_head(&einfo->tx_blocked_queue);
	init_kthread_work(&einfo->kwork, rx_worker);
	init_kthread_worker(&einfo->kworker);
	tasklet_init(&einfo->tasklet, rx_worker_atomic, (unsigned long)einfo);
	einfo->read_from_fifo = read_from_fifo;
	einfo->write_to_fifo = write_to_fifo;
	init_srcu_struct(&einfo->use_ref);
@@ -2477,7 +2461,6 @@ smem_alloc_fail:
	flush_kthread_worker(&einfo->kworker);
	kthread_stop(einfo->task);
	einfo->task = NULL;
	tasklet_kill(&einfo->tasklet);
kthread_fail:
	iounmap(einfo->out_irq_reg);
ioremap_fail:
@@ -2563,7 +2546,6 @@ static int glink_rpm_native_probe(struct platform_device *pdev)
	init_waitqueue_head(&einfo->tx_blocked_queue);
	init_kthread_work(&einfo->kwork, rx_worker);
	init_kthread_worker(&einfo->kworker);
	tasklet_init(&einfo->tasklet, rx_worker_atomic, (unsigned long)einfo);
	einfo->intentless = true;
	einfo->read_from_fifo = memcpy32_fromio;
	einfo->write_to_fifo = memcpy32_toio;
@@ -2725,7 +2707,6 @@ toc_init_fail:
	flush_kthread_worker(&einfo->kworker);
	kthread_stop(einfo->task);
	einfo->task = NULL;
	tasklet_kill(&einfo->tasklet);
kthread_fail:
	iounmap(msgram);
msgram_ioremap_fail:
@@ -2854,7 +2835,6 @@ static int glink_mailbox_probe(struct platform_device *pdev)
	init_waitqueue_head(&einfo->tx_blocked_queue);
	init_kthread_work(&einfo->kwork, rx_worker);
	init_kthread_worker(&einfo->kworker);
	tasklet_init(&einfo->tasklet, rx_worker_atomic, (unsigned long)einfo);
	einfo->read_from_fifo = read_from_fifo;
	einfo->write_to_fifo = write_to_fifo;
	init_srcu_struct(&einfo->use_ref);
@@ -2977,7 +2957,6 @@ smem_alloc_fail:
	flush_kthread_worker(&einfo->kworker);
	kthread_stop(einfo->task);
	einfo->task = NULL;
	tasklet_kill(&einfo->tasklet);
kthread_fail:
	iounmap(einfo->rx_reset_reg);
rx_reset_ioremap_fail: