290-net-dsa-mv88e6xxx-depend-on-PTP-conditionally.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From e6866ed4219b8c7754dcd3eb1a654f6f524b0e56 Mon Sep 17 00:00:00 2001
  2. From: "Johnny S. Lee" <[email protected]>
  3. Date: Thu, 15 Dec 2022 17:49:04 +0800
  4. Subject: [PATCH] net: dsa: mv88e6xxx: depend on PTP conditionally
  5. PTP hardware timestamping related objects are not linked when PTP
  6. support for MV88E6xxx (NET_DSA_MV88E6XXX_PTP) is disabled, therefore
  7. NET_DSA_MV88E6XXX should not depend on PTP_1588_CLOCK_OPTIONAL
  8. regardless of NET_DSA_MV88E6XXX_PTP.
  9. Instead, condition more strictly on how NET_DSA_MV88E6XXX_PTP's
  10. dependencies are met, making sure that it cannot be enabled when
  11. NET_DSA_MV88E6XXX=y and PTP_1588_CLOCK=m.
  12. In other words, this commit allows NET_DSA_MV88E6XXX to be built-in
  13. while PTP_1588_CLOCK is a module, as long as NET_DSA_MV88E6XXX_PTP is
  14. prevented from being enabled.
  15. Fixes: e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies")
  16. Signed-off-by: Johnny S. Lee <[email protected]>
  17. ---
  18. drivers/net/dsa/mv88e6xxx/Kconfig | 4 ++--
  19. 1 file changed, 2 insertions(+), 2 deletions(-)
  20. --- a/drivers/net/dsa/mv88e6xxx/Kconfig
  21. +++ b/drivers/net/dsa/mv88e6xxx/Kconfig
  22. @@ -2,7 +2,6 @@
  23. config NET_DSA_MV88E6XXX
  24. tristate "Marvell 88E6xxx Ethernet switch fabric support"
  25. depends on NET_DSA
  26. - depends on PTP_1588_CLOCK_OPTIONAL
  27. select IRQ_DOMAIN
  28. select NET_DSA_TAG_EDSA
  29. select NET_DSA_TAG_DSA
  30. @@ -13,7 +12,8 @@ config NET_DSA_MV88E6XXX
  31. config NET_DSA_MV88E6XXX_PTP
  32. bool "PTP support for Marvell 88E6xxx"
  33. default n
  34. - depends on NET_DSA_MV88E6XXX && PTP_1588_CLOCK
  35. + depends on (NET_DSA_MV88E6XXX = y && PTP_1588_CLOCK = y) || \
  36. + (NET_DSA_MV88E6XXX = m && PTP_1588_CLOCK)
  37. help
  38. Say Y to enable PTP hardware timestamping on Marvell 88E6xxx switch
  39. chips that support it.