8eac290b3a17c69b142c755baf220b86723d5a0f
[openwrt/staging/pepe2k.git] /
1 From 31fa4aeafa41a38c76085af4de7192c572e85119 Mon Sep 17 00:00:00 2001
2 From: Akhil Goyal <akhil.goyal@nxp.com>
3 Date: Fri, 20 Jul 2018 16:43:25 +0530
4 Subject: [PATCH] staging: fsl_ppfe: performance tuning for user space
5
6 interrupt coalescing of 100 usec is added.
7
8 Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
9 Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
10 ---
11 drivers/staging/fsl_ppfe/pfe_cdev.c | 12 +++++++++---
12 1 file changed, 9 insertions(+), 3 deletions(-)
13
14 --- a/drivers/staging/fsl_ppfe/pfe_cdev.c
15 +++ b/drivers/staging/fsl_ppfe/pfe_cdev.c
16 @@ -116,15 +116,18 @@ static irqreturn_t hif_us_isr(int irq, v
17
18 if (int_status & HIF_RXPKT_INT) {
19 int_enable_mask &= ~(HIF_RXPKT_INT);
20 + /* Disable interrupts, they will be enabled after
21 + * they are serviced
22 + */
23 + writel_relaxed(int_enable_mask, HIF_INT_ENABLE);
24 +
25 eventfd_signal(trigger, 1);
26 }
27
28 - /*Disable interrupts, they will be enabled after they are serviced */
29 - writel_relaxed(int_enable_mask, HIF_INT_ENABLE);
30 -
31 return IRQ_HANDLED;
32 }
33
34 +#define PFE_INTR_COAL_USECS 100
35 static long pfe_cdev_ioctl(struct file *fp, unsigned int cmd,
36 unsigned long arg)
37 {
38 @@ -159,6 +162,9 @@ static long pfe_cdev_ioctl(struct file *
39 eventfd_ctx_put(g_trigger);
40 g_trigger = NULL;
41 }
42 + writel((PFE_INTR_COAL_USECS * (pfe->ctrl.sys_clk / 1000)) |
43 + HIF_INT_COAL_ENABLE, HIF_INT_COAL);
44 +
45 pr_debug("request_irq for hif interrupt: %d\n", pfe->hif_irq);
46 ret = 0;
47 break;