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

Merge branch 'stmmac-fixes'

Jose Abreu says:

====================
net: stmmac: Misc fixes

Some misc fixes for stmmac targeting -net.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+24 -8
+10 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 721 721 { 722 722 unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); 723 723 724 - if (!clk) 725 - return 0; 724 + if (!clk) { 725 + clk = priv->plat->clk_ref_rate; 726 + if (!clk) 727 + return 0; 728 + } 726 729 727 730 return (usec * (clk / 1000000)) / 256; 728 731 } ··· 734 731 { 735 732 unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); 736 733 737 - if (!clk) 738 - return 0; 734 + if (!clk) { 735 + clk = priv->plat->clk_ref_rate; 736 + if (!clk) 737 + return 0; 738 + } 739 739 740 740 return (riwt * 256) / (clk / 1000000); 741 741 }
+13 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 3023 3023 3024 3024 tx_q = &priv->tx_queue[queue]; 3025 3025 3026 + if (priv->tx_path_in_lpi_mode) 3027 + stmmac_disable_eee_mode(priv); 3028 + 3026 3029 /* Manage oversized TCP frames for GMAC4 device */ 3027 3030 if (skb_is_gso(skb) && priv->tso) { 3028 - if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) 3031 + if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { 3032 + /* 3033 + * There is no way to determine the number of TSO 3034 + * capable Queues. Let's use always the Queue 0 3035 + * because if TSO is supported then at least this 3036 + * one will be capable. 3037 + */ 3038 + skb_set_queue_mapping(skb, 0); 3039 + 3029 3040 return stmmac_tso_xmit(skb, dev); 3041 + } 3030 3042 } 3031 3043 3032 3044 if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) { ··· 3052 3040 } 3053 3041 return NETDEV_TX_BUSY; 3054 3042 } 3055 - 3056 - if (priv->tx_path_in_lpi_mode) 3057 - stmmac_disable_eee_mode(priv); 3058 3043 3059 3044 entry = tx_q->cur_tx; 3060 3045 first_entry = entry;
+1
include/linux/stmmac.h
··· 184 184 struct clk *pclk; 185 185 struct clk *clk_ptp_ref; 186 186 unsigned int clk_ptp_rate; 187 + unsigned int clk_ref_rate; 187 188 struct reset_control *stmmac_rst; 188 189 struct stmmac_axi *axi; 189 190 int has_gmac4;