OSDN Git Service

soc: qcom: glink_smem_native_xprt: Move rx_worker in irq handler
authorDhoat Harpal <hdhoat@codeaurora.org>
Fri, 13 Apr 2018 13:36:42 +0000 (19:06 +0530)
committerDhoat Harpal <hdhoat@codeaurora.org>
Tue, 8 May 2018 06:08:18 +0000 (11:38 +0530)
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: Dhoat Harpal <hdhoat@codeaurora.org>
drivers/soc/qcom/glink_smem_native_xprt.c

index df94bbc..6cf4c7b 100644 (file)
@@ -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;
@@ -1191,18 +1188,6 @@ static void __rx_worker(struct edge_info *einfo, bool atomic_ctx)
 }
 
 /**
- * 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: