793-v6.6-net-pcs-lynxi-implement-pcs_disable-op.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From e4ccdfb78a47132f2d215658aab8902fc457c4b4 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Fri, 18 Aug 2023 04:07:46 +0100
  4. Subject: [PATCH 082/125] net: pcs: lynxi: implement pcs_disable op
  5. When switching from 10GBase-R/5GBase-R/USXGMII to one of the interface
  6. modes provided by mtk-pcs-lynxi we need to make sure to always perform
  7. a full configuration of the PHYA.
  8. Implement pcs_disable op which resets the stored interface mode to
  9. PHY_INTERFACE_MODE_NA to trigger a full reconfiguration once the LynxI
  10. PCS driver had previously been deselected in favor of another PCS
  11. driver such as the to-be-added driver for the USXGMII PCS found in
  12. MT7988.
  13. Signed-off-by: Daniel Golle <[email protected]>
  14. Link: https://lore.kernel.org/r/f23d1a60d2c9d2fb72e32dcb0eaa5f7e867a3d68.1692327891.git.daniel@makrotopia.org
  15. Signed-off-by: Jakub Kicinski <[email protected]>
  16. ---
  17. drivers/net/pcs/pcs-mtk-lynxi.c | 8 ++++++++
  18. 1 file changed, 8 insertions(+)
  19. --- a/drivers/net/pcs/pcs-mtk-lynxi.c
  20. +++ b/drivers/net/pcs/pcs-mtk-lynxi.c
  21. @@ -234,11 +234,19 @@ static void mtk_pcs_lynxi_link_up(struct
  22. }
  23. }
  24. +static void mtk_pcs_lynxi_disable(struct phylink_pcs *pcs)
  25. +{
  26. + struct mtk_pcs_lynxi *mpcs = pcs_to_mtk_pcs_lynxi(pcs);
  27. +
  28. + mpcs->interface = PHY_INTERFACE_MODE_NA;
  29. +}
  30. +
  31. static const struct phylink_pcs_ops mtk_pcs_lynxi_ops = {
  32. .pcs_get_state = mtk_pcs_lynxi_get_state,
  33. .pcs_config = mtk_pcs_lynxi_config,
  34. .pcs_an_restart = mtk_pcs_lynxi_restart_an,
  35. .pcs_link_up = mtk_pcs_lynxi_link_up,
  36. + .pcs_disable = mtk_pcs_lynxi_disable,
  37. };
  38. struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev,