Commit eedf4c66 authored by David S. Miller's avatar David S. Miller

Merge branch 'cpsw-cleanups'

Richard Cochran says:

====================
cpsw cleanups

While working on an out-of-tree customization, I noticed a few minor
problems in the cpsw code.  This series cleans up the issues I found.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d1a0ed79 61d22596
...@@ -1361,7 +1361,6 @@ static int cpsw_ndo_stop(struct net_device *ndev) ...@@ -1361,7 +1361,6 @@ static int cpsw_ndo_stop(struct net_device *ndev)
if (cpsw_common_res_usage_state(priv) <= 1) { if (cpsw_common_res_usage_state(priv) <= 1) {
cpts_unregister(priv->cpts); cpts_unregister(priv->cpts);
cpsw_intr_disable(priv); cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
cpdma_ctlr_stop(priv->dma); cpdma_ctlr_stop(priv->dma);
cpsw_ale_stop(priv->ale); cpsw_ale_stop(priv->ale);
} }
...@@ -1456,7 +1455,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv) ...@@ -1456,7 +1455,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
if (priv->cpts->rx_enable) if (priv->cpts->rx_enable)
ctrl |= CTRL_V2_RX_TS_BITS; ctrl |= CTRL_V2_RX_TS_BITS;
break; break;
case CPSW_VERSION_3: case CPSW_VERSION_3:
default: default:
ctrl &= ~CTRL_V3_ALL_TS_MASK; ctrl &= ~CTRL_V3_ALL_TS_MASK;
...@@ -1466,7 +1465,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv) ...@@ -1466,7 +1465,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
if (priv->cpts->rx_enable) if (priv->cpts->rx_enable)
ctrl |= CTRL_V3_RX_TS_BITS; ctrl |= CTRL_V3_RX_TS_BITS;
break; break;
} }
mtype = (30 << TS_SEQ_ID_OFFSET_SHIFT) | EVENT_MSG_BITS; mtype = (30 << TS_SEQ_ID_OFFSET_SHIFT) | EVENT_MSG_BITS;
...@@ -1589,10 +1588,8 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev) ...@@ -1589,10 +1588,8 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
cpsw_err(priv, tx_err, "transmit timeout, restarting dma\n"); cpsw_err(priv, tx_err, "transmit timeout, restarting dma\n");
ndev->stats.tx_errors++; ndev->stats.tx_errors++;
cpsw_intr_disable(priv); cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
cpdma_chan_stop(priv->txch); cpdma_chan_stop(priv->txch);
cpdma_chan_start(priv->txch); cpdma_chan_start(priv->txch);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
} }
...@@ -1629,10 +1626,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev) ...@@ -1629,10 +1626,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
struct cpsw_priv *priv = netdev_priv(ndev); struct cpsw_priv *priv = netdev_priv(ndev);
cpsw_intr_disable(priv); cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
cpsw_rx_interrupt(priv->irqs_table[0], priv); cpsw_rx_interrupt(priv->irqs_table[0], priv);
cpsw_tx_interrupt(priv->irqs_table[1], priv); cpsw_tx_interrupt(priv->irqs_table[1], priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
} }
#endif #endif
......
...@@ -268,39 +268,6 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid) ...@@ -268,39 +268,6 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
} }
EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast); EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast);
static void cpsw_ale_flush_ucast(struct cpsw_ale *ale, u32 *ale_entry,
int port_mask)
{
int port;
port = cpsw_ale_get_port_num(ale_entry);
if ((BIT(port) & port_mask) == 0)
return; /* ports dont intersect, not interested */
cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
}
int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int ret, idx;
for (idx = 0; idx < ale->params.ale_entries; idx++) {
cpsw_ale_read(ale, idx, ale_entry);
ret = cpsw_ale_get_entry_type(ale_entry);
if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR)
continue;
if (cpsw_ale_get_mcast(ale_entry))
cpsw_ale_flush_mcast(ale, ale_entry, port_mask);
else
cpsw_ale_flush_ucast(ale, ale_entry, port_mask);
cpsw_ale_write(ale, idx, ale_entry);
}
return 0;
}
EXPORT_SYMBOL_GPL(cpsw_ale_flush);
static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry, static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry,
int flags, u16 vid) int flags, u16 vid)
{ {
...@@ -752,18 +719,6 @@ static void cpsw_ale_timer(unsigned long arg) ...@@ -752,18 +719,6 @@ static void cpsw_ale_timer(unsigned long arg)
} }
} }
int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout)
{
del_timer_sync(&ale->timer);
ale->ageout = ageout * HZ;
if (ale->ageout) {
ale->timer.expires = jiffies + ale->ageout;
add_timer(&ale->timer);
}
return 0;
}
EXPORT_SYMBOL_GPL(cpsw_ale_set_ageout);
void cpsw_ale_start(struct cpsw_ale *ale) void cpsw_ale_start(struct cpsw_ale *ale)
{ {
u32 rev; u32 rev;
......
...@@ -90,8 +90,6 @@ int cpsw_ale_destroy(struct cpsw_ale *ale); ...@@ -90,8 +90,6 @@ int cpsw_ale_destroy(struct cpsw_ale *ale);
void cpsw_ale_start(struct cpsw_ale *ale); void cpsw_ale_start(struct cpsw_ale *ale);
void cpsw_ale_stop(struct cpsw_ale *ale); void cpsw_ale_stop(struct cpsw_ale *ale);
int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout);
int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask);
int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid); int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid);
int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
int flags, u16 vid); int flags, u16 vid);
......
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