aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSchuyler Patton2014-03-18 12:51:58 -0500
committerPraneeth Bajjuri2014-03-18 12:57:44 -0500
commitd89088b8b3a6e1396a239e5ad4659a338ed06189 (patch)
tree65d3868339ae6ff45909d49464e4c7469a7850da
parent7abdbc9153baca5ca38769511b586af4e2ab7c56 (diff)
downloadkernel-video-d89088b8b3a6e1396a239e5ad4659a338ed06189.tar.gz
kernel-video-d89088b8b3a6e1396a239e5ad4659a338ed06189.tar.xz
kernel-video-d89088b8b3a6e1396a239e5ad4659a338ed06189.zip
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. Change-Id: Ic0cdc4d9392127db36423d6f33f67be431d0a4e1 Signed-off-by: Schuyler Patton <spatton@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ravi Babu <ravibabu@ti.com>
-rw-r--r--drivers/net/ethernet/ti/cpsw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 6a4e1b11bd9..25bedd84719 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -951,11 +951,17 @@ static int cpsw_ndo_open(struct net_device *ndev)
951 951
952static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv) 952static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
953{ 953{
954 u32 slave_port;
955
956 slave_port = cpsw_get_slave_port(priv, slave->slave_num);
957
954 if (!slave->phy) 958 if (!slave->phy)
955 return; 959 return;
956 phy_stop(slave->phy); 960 phy_stop(slave->phy);
957 phy_disconnect(slave->phy); 961 phy_disconnect(slave->phy);
958 slave->phy = NULL; 962 slave->phy = NULL;
963 cpsw_ale_control_set(priv->ale, slave_port,
964 ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
959} 965}
960 966
961static int cpsw_ndo_stop(struct net_device *ndev) 967static int cpsw_ndo_stop(struct net_device *ndev)