mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/chunkeey.git] / target / linux / layerscape / patches-5.4 / 701-net-0161-staging-fsl-dpaa2-mac-Request-atomic-context-MC-port.patch
1 From 001bad547937cdd667adee45b5c7ebe78a1de1d0 Mon Sep 17 00:00:00 2001
2 From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
3 Date: Fri, 22 Sep 2017 12:20:02 +0300
4 Subject: [PATCH] staging: fsl-dpaa2/mac: Request atomic context MC portals
5
6 The MAC driver may need to issue MC commands while in atomic
7 context (e.g. dpaa2_mac_get_stats can be called from a critical
8 section), so we need to use MC portals that don't sleep while
9 waiting for a command response to arrive.
10
11 Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
12 ---
13 drivers/staging/fsl-dpaa2/mac/mac.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16 --- a/drivers/staging/fsl-dpaa2/mac/mac.c
17 +++ b/drivers/staging/fsl-dpaa2/mac/mac.c
18 @@ -490,7 +490,9 @@ static int dpaa2_mac_probe(struct fsl_mc
19
20 dev_set_drvdata(dev, priv);
21
22 - err = fsl_mc_portal_allocate(mc_dev, 0, &mc_dev->mc_io);
23 + /* We may need to issue MC commands while in atomic context */
24 + err = fsl_mc_portal_allocate(mc_dev, FSL_MC_IO_ATOMIC_CONTEXT_PORTAL,
25 + &mc_dev->mc_io);
26 if (err || !mc_dev->mc_io) {
27 dev_err(dev, "fsl_mc_portal_allocate error: %d\n", err);
28 err = -ENODEV;