diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2014-07-15 20:26:53 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-15 23:13:57 -0700 |
commit | a84bc2a9013fb123deeca7283480955d021503fb (patch) | |
tree | a47c93945856394da7790338705130036872c259 /drivers/net/ethernet/ti | |
parent | ff11d8b27dcd85e7b96ac2570116d5061130bd5e (diff) | |
download | op-kernel-dev-a84bc2a9013fb123deeca7283480955d021503fb.zip op-kernel-dev-a84bc2a9013fb123deeca7283480955d021503fb.tar.gz |
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: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b988d16..ae6379a 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -884,14 +884,16 @@ static int cpsw_set_coalesce(struct net_device *ndev, u32 addnl_dvdr = 1; u32 coal_intvl = 0; - if (!coal->rx_coalesce_usecs) - return -EINVAL; - coal_intvl = coal->rx_coalesce_usecs; int_ctrl = readl(&priv->wr_regs->int_control); 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) coal_intvl = CPSW_CMINTMIN_INTVL; @@ -919,6 +921,8 @@ static int cpsw_set_coalesce(struct net_device *ndev, int_ctrl |= CPSW_INTPACEEN; int_ctrl &= (~CPSW_INTPRESCALE_MASK); int_ctrl |= (prescale & CPSW_INTPRESCALE_MASK); + +update_return: writel(int_ctrl, &priv->wr_regs->int_control); cpsw_notice(priv, timer, "Set coalesce to %d usecs.\n", coal_intvl); |