Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mugunthan V N and committed by
David S. Miller
a84bc2a9 ff11d8b2

+7 -3
+7 -3
drivers/net/ethernet/ti/cpsw.c
··· 884 884 u32 addnl_dvdr = 1; 885 885 u32 coal_intvl = 0; 886 886 887 - if (!coal->rx_coalesce_usecs) 888 - return -EINVAL; 889 - 890 887 coal_intvl = coal->rx_coalesce_usecs; 891 888 892 889 int_ctrl = readl(&priv->wr_regs->int_control); 893 890 prescale = priv->bus_freq_mhz * 4; 891 + 892 + if (!coal->rx_coalesce_usecs) { 893 + int_ctrl &= ~(CPSW_INTPRESCALE_MASK | CPSW_INTPACEEN); 894 + goto update_return; 895 + } 894 896 895 897 if (coal_intvl < CPSW_CMINTMIN_INTVL) 896 898 coal_intvl = CPSW_CMINTMIN_INTVL; ··· 921 919 int_ctrl |= CPSW_INTPACEEN; 922 920 int_ctrl &= (~CPSW_INTPRESCALE_MASK); 923 921 int_ctrl |= (prescale & CPSW_INTPRESCALE_MASK); 922 + 923 + update_return: 924 924 writel(int_ctrl, &priv->wr_regs->int_control); 925 925 926 926 cpsw_notice(priv, timer, "Set coalesce to %d usecs.\n", coal_intvl);