提交 a84bc2a9 编写于 作者: M Mugunthan V N 提交者: David S. Miller

drivers: net: cpsw: disable coalesce when rx_coalesce_usecs is zero

instead of return error on zero rx_coalesce_usecs, disable coalesce
Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ff11d8b2
...@@ -884,14 +884,16 @@ static int cpsw_set_coalesce(struct net_device *ndev, ...@@ -884,14 +884,16 @@ static int cpsw_set_coalesce(struct net_device *ndev,
u32 addnl_dvdr = 1; u32 addnl_dvdr = 1;
u32 coal_intvl = 0; u32 coal_intvl = 0;
if (!coal->rx_coalesce_usecs)
return -EINVAL;
coal_intvl = coal->rx_coalesce_usecs; coal_intvl = coal->rx_coalesce_usecs;
int_ctrl = readl(&priv->wr_regs->int_control); int_ctrl = readl(&priv->wr_regs->int_control);
prescale = priv->bus_freq_mhz * 4; prescale = priv->bus_freq_mhz * 4;
if (!coal->rx_coalesce_usecs) {
int_ctrl &= ~(CPSW_INTPRESCALE_MASK | CPSW_INTPACEEN);
goto update_return;
}
if (coal_intvl < CPSW_CMINTMIN_INTVL) if (coal_intvl < CPSW_CMINTMIN_INTVL)
coal_intvl = CPSW_CMINTMIN_INTVL; coal_intvl = CPSW_CMINTMIN_INTVL;
...@@ -919,6 +921,8 @@ static int cpsw_set_coalesce(struct net_device *ndev, ...@@ -919,6 +921,8 @@ static int cpsw_set_coalesce(struct net_device *ndev,
int_ctrl |= CPSW_INTPACEEN; int_ctrl |= CPSW_INTPACEEN;
int_ctrl &= (~CPSW_INTPRESCALE_MASK); int_ctrl &= (~CPSW_INTPRESCALE_MASK);
int_ctrl |= (prescale & CPSW_INTPRESCALE_MASK); int_ctrl |= (prescale & CPSW_INTPRESCALE_MASK);
update_return:
writel(int_ctrl, &priv->wr_regs->int_control); writel(int_ctrl, &priv->wr_regs->int_control);
cpsw_notice(priv, timer, "Set coalesce to %d usecs.\n", coal_intvl); cpsw_notice(priv, timer, "Set coalesce to %d usecs.\n", coal_intvl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册