mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/mkresin.git] / target / linux / layerscape / patches-5.4 / 701-net-0151-soc-fsl-dpio-Prefer-the-CPU-affine-DPIO.patch
1 From 33b7977ba754b6ec4e65aaae34de92d4086ea0bd Mon Sep 17 00:00:00 2001
2 From: Roy Pledge <roy.pledge@nxp.com>
3 Date: Wed, 13 Sep 2017 17:03:06 -0400
4 Subject: [PATCH] soc: fsl: dpio: Prefer the CPU affine DPIO
5
6 Use the cpu affine DPIO unless there isn't one which can happen
7 if less DPIOs than cores are assign to the kernel.
8
9 Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
10 ---
11 drivers/soc/fsl/dpio/dpio-service.c | 6 +++++-
12 1 file changed, 5 insertions(+), 1 deletion(-)
13
14 --- a/drivers/soc/fsl/dpio/dpio-service.c
15 +++ b/drivers/soc/fsl/dpio/dpio-service.c
16 @@ -58,7 +58,7 @@ static inline struct dpaa2_io *service_s
17 * If cpu == -1, choose the current cpu, with no guarantees about
18 * potentially being migrated away.
19 */
20 - if (unlikely(cpu < 0))
21 + if (cpu < 0)
22 cpu = smp_processor_id();
23
24 /* If a specific cpu was requested, pick it up immediately */
25 @@ -70,6 +70,10 @@ static inline struct dpaa2_io *service_s
26 if (d)
27 return d;
28
29 + d = service_select_by_cpu(d, -1);
30 + if (d)
31 + return d;
32 +
33 spin_lock(&dpio_list_lock);
34 d = list_entry(dpio_list.next, struct dpaa2_io, node);
35 list_del(&d->node);