Просмотр исходного кода

net: ethernet: prueth: fix storm prev enable for DualEMAC

The timer function for storm prevention checked that both ports are
configured before reseting the counter. In single EMAC case, only one
port may be configured so it should not check for both ports (this was
causing storm prevention to not function at all when only one port was
active). This change makes the check for both ports only applicable
to HSR/PRP case (the individual ports are still checked before
actual update).

Signed-off-by: Aaron Kramer <a-kramer@ti.com>
Aaron Kramer 6 лет назад
Родитель
Сommit
9d8ff393a8
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      drivers/net/ethernet/ti/prueth.c

+ 1 - 1
drivers/net/ethernet/ti/prueth.c

@@ -1466,7 +1466,7 @@ static enum hrtimer_restart prueth_timer(struct hrtimer *timer)
 	enum prueth_mac mac;
 
 	hrtimer_forward_now(timer, ktime_set(0, prueth->tbl_check_period));
-	if (prueth->emac_configured !=
+	if (PRUETH_HAS_RED(prueth) && prueth->emac_configured !=
 		(BIT(PRUETH_PORT_MII0) | BIT(PRUETH_PORT_MII1)))
 		return HRTIMER_RESTART;