Commit 3995d265 authored by Schuyler Patton's avatar Schuyler Patton Committed by David S. Miller

net: cpsw: fix cpdma rx descriptor leak on down interface

This patch fixes a CPDMA RX Descriptor leak that occurs after taking
the interface down when the CPSW is in Dual MAC mode. Previously
the CPSW_ALE port was left open up which causes packets to be received
and processed by the RX interrupt handler and were passed to the
non active network interface where they were ignored.

The fix is for the slave_stop function of the selected interface
to disable the respective CPSW_ALE Port from forwarding packets. This
blocks traffic from being received on the inactive interface.
Signed-off-by: default avatarSchuyler Patton <spatton@ti.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ec495fac
...@@ -1164,11 +1164,17 @@ static void cpsw_init_host_port(struct cpsw_priv *priv) ...@@ -1164,11 +1164,17 @@ static void cpsw_init_host_port(struct cpsw_priv *priv)
static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv) static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
{ {
u32 slave_port;
slave_port = cpsw_get_slave_port(priv, slave->slave_num);
if (!slave->phy) if (!slave->phy)
return; return;
phy_stop(slave->phy); phy_stop(slave->phy);
phy_disconnect(slave->phy); phy_disconnect(slave->phy);
slave->phy = NULL; slave->phy = NULL;
cpsw_ale_control_set(priv->ale, slave_port,
ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
} }
static int cpsw_ndo_open(struct net_device *ndev) static int cpsw_ndo_open(struct net_device *ndev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment