From: Mugunthan V N Date: Wed, 18 Jun 2014 11:51:48 +0000 (+0530) Subject: drivers: net: cpsw: fix dual EMAC stall when connected to same switch X-Git-Tag: v3.15.7~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54e9c55c8bfa1e255d4ebd3291c13c22e359eb07;p=thirdparty%2Fkernel%2Fstable.git drivers: net: cpsw: fix dual EMAC stall when connected to same switch [ Upstream commit e6afea0bbf129f88dc3fc39fd0d769f9ff064172 ] In commit 629c9a8fd0bbdfc6d702526b327470166ec39c6b (drivers: net: cpsw: Add default vlan for dual emac case also), api cpsw_add_default_vlan() also changes the port vlan which is required to seperate the ports which results in the following behavior In Dual EMAC mode, when both the Etnernet connected is connected to same switch, it creates a loop in the switch and when a broadcast packet is received it is forwarded to the other port which stalls the whole switch and needs a reset/power cycle to the switch to recover. So intead of using the api, add only the default VLAN entry in dual EMAC case. Cc: Yegor Yefremov Cc: Felipe Balbi Signed-off-by: Mugunthan V N Tested-by: Yegor Yefremov Tested-by: Felipe Balbi Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c331b7ebc8124..80d75ee60da84 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1201,7 +1201,12 @@ static int cpsw_ndo_open(struct net_device *ndev) for_each_slave(priv, cpsw_slave_open, priv); /* Add default VLAN */ - cpsw_add_default_vlan(priv); + if (!priv->data.dual_emac) + cpsw_add_default_vlan(priv); + else + cpsw_ale_add_vlan(priv->ale, priv->data.default_vlan, + ALE_ALL_PORTS << priv->host_port, + ALE_ALL_PORTS << priv->host_port, 0, 0); if (!cpsw_common_res_usage_state(priv)) { /* setup tx dma to fixed prio and zero offset */