701-v6.2-0003-net-dpaa2-mac-absorb-phylink_start-call-into-dpaa2_m.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From 97c07369ab8bf9895e05d4b468f18e6567263154 Mon Sep 17 00:00:00 2001
  2. From: Vladimir Oltean <[email protected]>
  3. Date: Tue, 29 Nov 2022 16:12:12 +0200
  4. Subject: [PATCH 05/14] net: dpaa2-mac: absorb phylink_start() call into
  5. dpaa2_mac_start()
  6. The phylink handling is intended to be hidden inside the dpaa2_mac
  7. object. Move the phylink_start() call into dpaa2_mac_start(), and
  8. phylink_stop() into dpaa2_mac_stop().
  9. Signed-off-by: Vladimir Oltean <[email protected]>
  10. Reviewed-by: Andrew Lunn <[email protected]>
  11. Reviewed-by: Ioana Ciornei <[email protected]>
  12. Tested-by: Ioana Ciornei <[email protected]>
  13. Signed-off-by: Paolo Abeni <[email protected]>
  14. ---
  15. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 +----
  16. drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 8 ++++++++
  17. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 +----
  18. 3 files changed, 10 insertions(+), 8 deletions(-)
  19. --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
  20. +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
  21. @@ -2083,10 +2083,8 @@ static int dpaa2_eth_open(struct net_dev
  22. goto enable_err;
  23. }
  24. - if (dpaa2_eth_is_type_phy(priv)) {
  25. + if (dpaa2_eth_is_type_phy(priv))
  26. dpaa2_mac_start(priv->mac);
  27. - phylink_start(priv->mac->phylink);
  28. - }
  29. return 0;
  30. @@ -2160,7 +2158,6 @@ static int dpaa2_eth_stop(struct net_dev
  31. int retries = 10;
  32. if (dpaa2_eth_is_type_phy(priv)) {
  33. - phylink_stop(priv->mac->phylink);
  34. dpaa2_mac_stop(priv->mac);
  35. } else {
  36. netif_tx_stop_all_queues(net_dev);
  37. --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
  38. +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
  39. @@ -336,12 +336,20 @@ static void dpaa2_mac_set_supported_inte
  40. void dpaa2_mac_start(struct dpaa2_mac *mac)
  41. {
  42. + ASSERT_RTNL();
  43. +
  44. if (mac->serdes_phy)
  45. phy_power_on(mac->serdes_phy);
  46. +
  47. + phylink_start(mac->phylink);
  48. }
  49. void dpaa2_mac_stop(struct dpaa2_mac *mac)
  50. {
  51. + ASSERT_RTNL();
  52. +
  53. + phylink_stop(mac->phylink);
  54. +
  55. if (mac->serdes_phy)
  56. phy_power_off(mac->serdes_phy);
  57. }
  58. --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
  59. +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
  60. @@ -703,10 +703,8 @@ static int dpaa2_switch_port_open(struct
  61. dpaa2_switch_enable_ctrl_if_napi(ethsw);
  62. - if (dpaa2_switch_port_is_type_phy(port_priv)) {
  63. + if (dpaa2_switch_port_is_type_phy(port_priv))
  64. dpaa2_mac_start(port_priv->mac);
  65. - phylink_start(port_priv->mac->phylink);
  66. - }
  67. return 0;
  68. }
  69. @@ -718,7 +716,6 @@ static int dpaa2_switch_port_stop(struct
  70. int err;
  71. if (dpaa2_switch_port_is_type_phy(port_priv)) {
  72. - phylink_stop(port_priv->mac->phylink);
  73. dpaa2_mac_stop(port_priv->mac);
  74. } else {
  75. netif_tx_stop_all_queues(netdev);