Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 0376d14a758f9815bdcd05997e38446874b585f3
- Author: Arnd Bergmann <arnd@arndb.de>
- Date: Wed Nov 11 17:52:58 2020 +0100
- ptp: rework Kconfig again
- The use of Kconfig 'imply' and 'IS_REACHABLE()' in the header makes it
- rather unpredictable whether PTP is actually usable from anywhere.
- Rework this by avoiding both and using two extra Kconfig symbols
- to define the behavior we actually want:
- - any driver that is able to use selects 'HAVE_PTP_1588_CLOCK'
- - if posix timers are disabled, this has no effect and it
- is impossible to turn it on
- - otherwise, the option to enable building PTP support is
- visible to users, and this can be set to module or built-in
- - If any built-in driver selects HAVE_PTP_1588_CLOCK, PTP
- support can only be built-in or disabled
- - if a built-in driver calls PTP interface functions but fails
- to select HAVE_PTP_1588_CLOCK or depend on PTP_1588_CLOCK,
- and PTP support is a loadable module, we get a link error
- instead of having an unusable clock.
- Signed-off-by: Arnd Bergmann <arnd@arndb.de>
- diff --git a/drivers/net/dsa/mv88e6xxx/Kconfig b/drivers/net/dsa/mv88e6xxx/Kconfig
- index 51185e4d7d15..576e59e723c6 100644
- --- a/drivers/net/dsa/mv88e6xxx/Kconfig
- +++ b/drivers/net/dsa/mv88e6xxx/Kconfig
- @@ -13,6 +13,7 @@ config NET_DSA_MV88E6XXX_GLOBAL2
- bool "Switch Global 2 Registers support"
- default y
- depends on NET_DSA_MV88E6XXX
- + select HAVE_PTP_1588_CLOCK
- help
- This registers set at internal SMI address 0x1C provides extended
- features like EEPROM interface, trunking, cross-chip setup, etc.
- diff --git a/drivers/net/dsa/sja1105/Kconfig b/drivers/net/dsa/sja1105/Kconfig
- index 5e83b365f17a..b47a13b70e05 100644
- --- a/drivers/net/dsa/sja1105/Kconfig
- +++ b/drivers/net/dsa/sja1105/Kconfig
- @@ -2,6 +2,7 @@
- config NET_DSA_SJA1105
- tristate "NXP SJA1105 Ethernet switch family support"
- depends on NET_DSA && SPI
- + select HAVE_PTP_1588_CLOCK
- select NET_DSA_TAG_SJA1105
- select PACKING
- select CRC32
- diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig
- index d0b0609bbe23..591d6b903e6d 100644
- --- a/drivers/net/ethernet/amd/Kconfig
- +++ b/drivers/net/ethernet/amd/Kconfig
- @@ -172,7 +172,7 @@ config AMD_XGBE
- select CRC32
- select PHYLIB
- select AMD_XGBE_HAVE_ECC if X86
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports the AMD 10GbE Ethernet device found on an
- AMD SoC.
- diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
- index 7fb42f388d59..020d47ffbfa4 100644
- --- a/drivers/net/ethernet/broadcom/Kconfig
- +++ b/drivers/net/ethernet/broadcom/Kconfig
- @@ -114,7 +114,7 @@ config TIGON3
- tristate "Broadcom Tigon3 support"
- depends on PCI
- select PHYLIB
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
- @@ -131,7 +131,7 @@ config TIGON3_HWMON
- config BNX2X
- tristate "Broadcom NetXtremeII 10Gb support"
- depends on PCI
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- select FW_LOADER
- select ZLIB_INFLATE
- select LIBCRC32C
- diff --git a/drivers/net/ethernet/cadence/Kconfig b/drivers/net/ethernet/cadence/Kconfig
- index 85858163bac5..a8185e6b3a1f 100644
- --- a/drivers/net/ethernet/cadence/Kconfig
- +++ b/drivers/net/ethernet/cadence/Kconfig
- @@ -22,6 +22,7 @@ if NET_VENDOR_CADENCE
- config MACB
- tristate "Cadence MACB/GEM support"
- depends on HAS_DMA && COMMON_CLK
- + select HAVE_PTP_1588_CLOCK
- select PHYLINK
- help
- The Cadence MACB ethernet interface is found on many Atmel AT32 and
- diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
- index 4875cdae622e..e47ff844454e 100644
- --- a/drivers/net/ethernet/cavium/Kconfig
- +++ b/drivers/net/ethernet/cavium/Kconfig
- @@ -27,7 +27,7 @@ config THUNDER_NIC_PF
- config THUNDER_NIC_VF
- tristate "Thunder Virtual function driver"
- - imply CAVIUM_PTP
- + select HAVE_PTP_1588_CLOCK
- depends on 64BIT && PCI
- help
- This driver supports Thunder's NIC virtual function
- @@ -53,6 +53,7 @@ config THUNDER_NIC_RGX
- config CAVIUM_PTP
- tristate "Cavium PTP coprocessor as PTP clock"
- + default THUNDER_NIC_VF
- depends on 64BIT && PCI
- depends on PTP_1588_CLOCK
- help
- @@ -66,7 +67,7 @@ config LIQUIDIO
- tristate "Cavium LiquidIO support"
- depends on 64BIT && PCI
- depends on PCI
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- select FW_LOADER
- select LIBCRC32C
- select NET_DEVLINK
- @@ -91,7 +92,7 @@ config OCTEON_MGMT_ETHERNET
- config LIQUIDIO_VF
- tristate "Cavium LiquidIO VF support"
- depends on 64BIT && PCI_MSI
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports Cavium LiquidIO Intelligent Server Adapter
- based on CN23XX chips.
- diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
- index a1d53ddf1593..c8324373b8bc 100644
- --- a/drivers/net/ethernet/freescale/Kconfig
- +++ b/drivers/net/ethernet/freescale/Kconfig
- @@ -26,7 +26,7 @@ config FEC
- ARCH_MXC || SOC_IMX28 || COMPILE_TEST)
- default ARCH_MXC || SOC_IMX28 if ARM
- select PHYLIB
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- Say Y here if you want to use the built-in 10/100 Fast ethernet
- controller on some Motorola ColdFire and Freescale i.MX processors.
- diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig
- index 0fa18b00c49b..e91649dd5feb 100644
- --- a/drivers/net/ethernet/freescale/enetc/Kconfig
- +++ b/drivers/net/ethernet/freescale/enetc/Kconfig
- @@ -3,6 +3,7 @@ config FSL_ENETC
- tristate "ENETC PF driver"
- depends on PCI && PCI_MSI
- select FSL_ENETC_MDIO
- + select HAVE_PTP_1588_CLOCK
- select PHYLINK
- select PCS_LYNX
- select DIMLIB
- @@ -16,6 +17,7 @@ config FSL_ENETC
- config FSL_ENETC_VF
- tristate "ENETC VF driver"
- depends on PCI && PCI_MSI
- + select HAVE_PTP_1588_CLOCK
- select PHYLINK
- select DIMLIB
- help
- diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
- index 5aa86318ed3e..1d465da07f90 100644
- --- a/drivers/net/ethernet/intel/Kconfig
- +++ b/drivers/net/ethernet/intel/Kconfig
- @@ -59,7 +59,7 @@ config E1000E
- tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
- depends on PCI && (!SPARC32 || BROKEN)
- select CRC32
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports the PCI-Express Intel(R) PRO/1000 gigabit
- ethernet family of adapters. For PCI or PCI-X e1000 adapters,
- @@ -87,7 +87,7 @@ config E1000E_HWTS
- config IGB
- tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support"
- depends on PCI
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- select I2C
- select I2C_ALGOBIT
- help
- @@ -161,7 +161,7 @@ config IXGBE
- depends on PCI
- select MDIO
- select PHYLIB
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports Intel(R) 10GbE PCI Express family of
- adapters. For more information on how to identify your adapter, go
- @@ -239,7 +239,7 @@ config IXGBEVF_IPSEC
- config I40E
- tristate "Intel(R) Ethernet Controller XL710 Family support"
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- depends on PCI
- help
- This driver supports Intel(R) Ethernet Controller XL710 Family of
- @@ -313,7 +313,7 @@ config FM10K
- tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
- default n
- depends on PCI_MSI
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports Intel(R) FM10000 Ethernet Switch Host
- Interface. For more information on how to identify your adapter,
- diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
- index 400e611ba041..5b1d4992daba 100644
- --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
- +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
- @@ -7,7 +7,7 @@ config MLX4_EN
- tristate "Mellanox Technologies 1/10/40Gbit Ethernet support"
- depends on PCI && NETDEVICES && ETHERNET && INET
- select MLX4_CORE
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports Mellanox Technologies ConnectX Ethernet
- devices.
- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
- index 99f1ec3b2575..f94afa1f12cd 100644
- --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
- +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
- @@ -9,7 +9,7 @@ config MLX5_CORE
- select NET_DEVLINK
- depends on VXLAN || !VXLAN
- depends on MLXFW || !MLXFW
- - depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
- + depends on HAVE_PTP_1588_CLOCK
- depends on PCI_HYPERV_INTERFACE || !PCI_HYPERV_INTERFACE
- default n
- help
- diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
- index 872e9910bb7c..f5666ed15bb7 100644
- --- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig
- +++ b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
- @@ -83,7 +83,7 @@ config MLXSW_SPECTRUM
- select PARMAN
- select OBJAGG
- select MLXFW
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- select NET_PTP_CLASSIFY if PTP_1588_CLOCK
- default m
- help
- diff --git a/drivers/net/ethernet/qlogic/Kconfig b/drivers/net/ethernet/qlogic/Kconfig
- index 4366c7a8de95..f8737d5e691d 100644
- --- a/drivers/net/ethernet/qlogic/Kconfig
- +++ b/drivers/net/ethernet/qlogic/Kconfig
- @@ -98,7 +98,7 @@ config QED_SRIOV
- config QEDE
- tristate "QLogic QED 25/40/100Gb Ethernet NIC"
- depends on QED
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This enables the support for Marvell FastLinQ adapters family,
- ethernet driver.
- diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
- index 5a2a4af31812..ff1f70cbbc0f 100644
- --- a/drivers/net/ethernet/renesas/Kconfig
- +++ b/drivers/net/ethernet/renesas/Kconfig
- @@ -36,7 +36,7 @@ config RAVB
- select MII
- select MDIO_BITBANG
- select PHYLIB
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- Renesas Ethernet AVB device driver.
- This driver supports the following SoCs:
- diff --git a/drivers/net/ethernet/samsung/Kconfig b/drivers/net/ethernet/samsung/Kconfig
- index 0582e110b1c0..a6d404ec4c94 100644
- --- a/drivers/net/ethernet/samsung/Kconfig
- +++ b/drivers/net/ethernet/samsung/Kconfig
- @@ -22,7 +22,7 @@ config SXGBE_ETH
- depends on HAS_IOMEM && HAS_DMA
- select PHYLIB
- select CRC32
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This is the driver for the SXGBE 10G Ethernet IP block found on
- Samsung platforms.
- diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig
- index 5e37c8313725..37558c4b1ca2 100644
- --- a/drivers/net/ethernet/sfc/Kconfig
- +++ b/drivers/net/ethernet/sfc/Kconfig
- @@ -21,7 +21,7 @@ config SFC
- depends on PCI
- select MDIO
- select CRC32
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- help
- This driver supports 10/40-gigabit Ethernet cards based on
- the Solarflare SFC9000-family and SFC9100-family controllers.
- diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
- index 53f14c5a9e02..9fb96c162933 100644
- --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
- +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
- @@ -7,7 +7,7 @@ config STMMAC_ETH
- select PAGE_POOL
- select PHYLINK
- select CRC32
- - imply PTP_1588_CLOCK
- + select HAVE_PTP_1588_CLOCK
- select RESET_CONTROLLER
- help
- This is the driver for the Ethernet IPs built around a
- diff --git a/drivers/net/ethernet/xscale/Kconfig b/drivers/net/ethernet/xscale/Kconfig
- index 7b83a6e5d894..c598fc9821cf 100644
- --- a/drivers/net/ethernet/xscale/Kconfig
- +++ b/drivers/net/ethernet/xscale/Kconfig
- @@ -23,6 +23,7 @@ config IXP4XX_ETH
- depends on ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR
- select PHYLIB
- select NET_PTP_CLASSIFY
- + select HAVE_PTP_1588_CLOCK
- help
- Say Y here if you want to use built-in Ethernet ports
- on IXP4xx processor.
- diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
- index 942f72d8151d..1a428580d9b5 100644
- --- a/drivers/ptp/Kconfig
- +++ b/drivers/ptp/Kconfig
- @@ -5,9 +5,15 @@
- menu "PTP clock support"
- -config PTP_1588_CLOCK
- +config HAVE_PTP_1588_CLOCK
- + tristate
- + help
- + Select this symbol from a driver that can use a PTP clock.
- +
- +config BUILD_PTP_1588_CLOCK
- tristate "PTP clock support"
- depends on NET && POSIX_TIMERS
- + default HAVE_PTP_1588_CLOCK
- select PPS
- select NET_PTP_CLASSIFY
- help
- @@ -26,6 +32,14 @@ config PTP_1588_CLOCK
- To compile this driver as a module, choose M here: the module
- will be called ptp.
- +config PTP_1588_CLOCK
- + tristate
- + default y if HAVE_PTP_1588_CLOCK=y && BUILD_PTP_1588_CLOCK=m
- + default BUILD_PTP_1588_CLOCK
- + help
- + If a built-in driver selects HAVE_PTP_1588_CLOCK, the
- + framework must also be built-in to allow it to be used.
- +
- config PTP_1588_CLOCK_DTE
- tristate "Broadcom DTE as PTP clock"
- depends on PTP_1588_CLOCK
- @@ -89,7 +103,7 @@ config PTP_1588_CLOCK_PCH
- tristate "Intel PCH EG20T as PTP clock"
- depends on X86_32 || COMPILE_TEST
- depends on HAS_IOMEM && NET
- - imply PTP_1588_CLOCK
- + depends on HAVE_PTP_1588_CLOCK
- help
- This driver adds support for using the PCH EG20T as a PTP
- clock. The hardware supports time stamping of PTP packets
- diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
- index d3e8ba5c7125..e08890056fa3 100644
- --- a/include/linux/ptp_clock_kernel.h
- +++ b/include/linux/ptp_clock_kernel.h
- @@ -173,7 +173,7 @@ struct ptp_clock_event {
- };
- };
- -#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
- +#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
- /**
- * ptp_clock_register() - register a PTP hardware clock driver
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement