aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0348-staging-fsl-dpaa2-mac-reverse-order-of-handling-stop.patch
blob: 6788b8425b1808f6f5c73d49a7d3bf7480b818e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From c9db7ecdd08e38fb1af207c2a7e810b4bd0d1043 Mon Sep 17 00:00:00 2001
From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: Wed, 11 Dec 2019 17:06:40 +0200
Subject: [PATCH] staging: fsl-dpaa2/mac: reverse order of handling stop/start
 IRQs

Both the LINK_UP_REQ and the LINK_DOWN_REQ IRQs can be received in the
same time when a reset is performed on the DPMAC's partner.
Handle first the link down and then the link up so that we do not
trigger a phylib WARNING like the following:

[  446.272011] called from state NOLINK
[  446.275604] WARNING: CPU: 0 PID: 473 at drivers/net/phy/phy.c:874
phy_start+0x44/0xa8

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/staging/fsl-dpaa2/mac/mac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/staging/fsl-dpaa2/mac/mac.c
+++ b/drivers/staging/fsl-dpaa2/mac/mac.c
@@ -482,12 +482,11 @@ static irqreturn_t dpaa2_mac_irq_handler
 		configure_link(priv, &link_cfg);
 	}
 
-	if (status & DPMAC_IRQ_EVENT_LINK_UP_REQ)
-		phy_start(ndev->phydev);
-
 	if (status & DPMAC_IRQ_EVENT_LINK_DOWN_REQ)
 		phy_stop(ndev->phydev);
 
+	if (status & DPMAC_IRQ_EVENT_LINK_UP_REQ)
+		phy_start(ndev->phydev);
 out:
 	dpmac_clear_irq_status(mc_dev->mc_io, 0, mc_dev->mc_handle,
 			       DPMAC_IRQ_INDEX, status);