net: fix amd-xgbe flow-control issue
authortangpengpeng <tangpengpeng@higon.com>
Thu, 26 Jul 2018 06:45:16 +0000 (14:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:44 +0000 (07:50 +0200)
[ Upstream commit 7f3fc7ddf719cd6faaf787722c511f6918ac6aab ]

If we enable or disable xgbe flow-control by ethtool ,
it does't work.Because the parameter is not properly
assigned,so we need to adjust the assignment order
of the parameters.

Fixes: c1ce2f77366b ("amd-xgbe: Fix flow control setting logic")
Signed-off-by: tangpengpeng <tangpengpeng@higon.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

index 1b45cd73a258f05211bfc2ca6e69124c5347bda8..119777986ea48ab26f148b372dd9702613422092 100644 (file)
@@ -1128,14 +1128,14 @@ static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata)
 
                if (pdata->tx_pause != pdata->phy.tx_pause) {
                        new_state = 1;
-                       pdata->hw_if.config_tx_flow_control(pdata);
                        pdata->tx_pause = pdata->phy.tx_pause;
+                       pdata->hw_if.config_tx_flow_control(pdata);
                }
 
                if (pdata->rx_pause != pdata->phy.rx_pause) {
                        new_state = 1;
-                       pdata->hw_if.config_rx_flow_control(pdata);
                        pdata->rx_pause = pdata->phy.rx_pause;
+                       pdata->hw_if.config_rx_flow_control(pdata);
                }
 
                /* Speed support */