All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 14:59 ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 14:59 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen, David S. Miller, Jakub Kicinski,
	Jacob Keller
  Cc: Arnd Bergmann, Richard Cochran, Kurt Kanzenbach, Shiraz Saleem,
	Dave Ertman, intel-wired-lan, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The 'imply' keyword does not do what most people think it does, it only
politely asks Kconfig to turn on another symbol, but does not prevent
it from being disabled manually or built as a loadable module when the
user is built-in. In the ICE driver, the latter now causes a link failure:

aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl':
ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config'
ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config'
aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config'
ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config'
aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset':
ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release'
ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release'
aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild':

For the other Intel network drivers, there is no link error when the
drivers are built-in and PTP is a loadable module, because
linux/ptp_clock_kernel.h contains an IS_REACHABLE() check, but this
just changes the compile-time failure to a runtime failure, which is
arguably worse.

Change all the Intel drivers to use the 'depends on PTP_1588_CLOCK ||
!PTP_1588_CLOCK' trick to prevent the broken configuration, as we
already do for several other drivers. To avoid circular dependencies,
this also requires changing the IGB driver back to using the normal
'depends on I2C' instead of 'select I2C'.

This is a recurring problem in many drivers, and we have discussed
it several times befores, without reaching a consensus. I'm providing
a link to the previous email thread for reference, which discusses
some related problems, though I can't find what reasons there were
against the approach with the extra Kconfig dependency.

Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices")
Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw@mail.gmail.com/
Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd@kernel.org/
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Changes in v2:
- include a missing patch hunk
- link to a previous discussion with Richard Cochran
---
 drivers/net/ethernet/intel/Kconfig | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 2aa84bd97287..3ddadc147d45 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -58,8 +58,8 @@ config E1000
 config E1000E
 	tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
 	depends on PCI && (!SPARC32 || BROKEN)
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select CRC32
-	imply 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,8 +87,8 @@ config E1000E_HWTS
 config IGB
 	tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support"
 	depends on PCI
-	imply PTP_1588_CLOCK
-	select I2C
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
+	depends on I2C
 	select I2C_ALGOBIT
 	help
 	  This driver supports Intel(R) 82575/82576 gigabit ethernet family of
@@ -159,9 +159,9 @@ config IXGB
 config IXGBE
 	tristate "Intel(R) 10GbE PCI Express adapters support"
 	depends on PCI
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select MDIO
 	select PHYLIB
-	imply 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
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	depends on PCI
 	select AUXILIARY_BUS
 	help
@@ -295,11 +295,11 @@ config ICE
 	tristate "Intel(R) Ethernet Connection E800 Series Support"
 	default n
 	depends on PCI_MSI
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select AUXILIARY_BUS
 	select DIMLIB
 	select NET_DEVLINK
 	select PLDMFW
-	imply PTP_1588_CLOCK
 	help
 	  This driver supports Intel(R) Ethernet Connection E800 Series of
 	  devices.  For more information on how to identify your adapter, go
@@ -317,7 +317,7 @@ config FM10K
 	tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
 	default n
 	depends on PCI_MSI
-	imply PTP_1588_CLOCK
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	help
 	  This driver supports Intel(R) FM10000 Ethernet Switch Host
 	  Interface.  For more information on how to identify your adapter,
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 14:59 ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 14:59 UTC (permalink / raw)
  To: intel-wired-lan

From: Arnd Bergmann <arnd@arndb.de>

The 'imply' keyword does not do what most people think it does, it only
politely asks Kconfig to turn on another symbol, but does not prevent
it from being disabled manually or built as a loadable module when the
user is built-in. In the ICE driver, the latter now causes a link failure:

aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl':
ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config'
ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config'
aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config'
ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config'
aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset':
ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release'
ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release'
aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild':

For the other Intel network drivers, there is no link error when the
drivers are built-in and PTP is a loadable module, because
linux/ptp_clock_kernel.h contains an IS_REACHABLE() check, but this
just changes the compile-time failure to a runtime failure, which is
arguably worse.

Change all the Intel drivers to use the 'depends on PTP_1588_CLOCK ||
!PTP_1588_CLOCK' trick to prevent the broken configuration, as we
already do for several other drivers. To avoid circular dependencies,
this also requires changing the IGB driver back to using the normal
'depends on I2C' instead of 'select I2C'.

This is a recurring problem in many drivers, and we have discussed
it several times befores, without reaching a consensus. I'm providing
a link to the previous email thread for reference, which discusses
some related problems, though I can't find what reasons there were
against the approach with the extra Kconfig dependency.

Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices")
Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw at mail.gmail.com/
Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd at kernel.org/
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Changes in v2:
- include a missing patch hunk
- link to a previous discussion with Richard Cochran
---
 drivers/net/ethernet/intel/Kconfig | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 2aa84bd97287..3ddadc147d45 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -58,8 +58,8 @@ config E1000
 config E1000E
 	tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
 	depends on PCI && (!SPARC32 || BROKEN)
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select CRC32
-	imply 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,8 +87,8 @@ config E1000E_HWTS
 config IGB
 	tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support"
 	depends on PCI
-	imply PTP_1588_CLOCK
-	select I2C
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
+	depends on I2C
 	select I2C_ALGOBIT
 	help
 	  This driver supports Intel(R) 82575/82576 gigabit ethernet family of
@@ -159,9 +159,9 @@ config IXGB
 config IXGBE
 	tristate "Intel(R) 10GbE PCI Express adapters support"
 	depends on PCI
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select MDIO
 	select PHYLIB
-	imply 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
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	depends on PCI
 	select AUXILIARY_BUS
 	help
@@ -295,11 +295,11 @@ config ICE
 	tristate "Intel(R) Ethernet Connection E800 Series Support"
 	default n
 	depends on PCI_MSI
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	select AUXILIARY_BUS
 	select DIMLIB
 	select NET_DEVLINK
 	select PLDMFW
-	imply PTP_1588_CLOCK
 	help
 	  This driver supports Intel(R) Ethernet Connection E800 Series of
 	  devices.  For more information on how to identify your adapter, go
@@ -317,7 +317,7 @@ config FM10K
 	tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
 	default n
 	depends on PCI_MSI
-	imply PTP_1588_CLOCK
+	depends on PTP_1588_CLOCK || !PTP_1588_CLOCK
 	help
 	  This driver supports Intel(R) FM10000 Ethernet Switch Host
 	  Interface.  For more information on how to identify your adapter,
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 14:59 ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-02 16:49   ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-02 16:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Pitre, Jesse Brandeburg, Tony Nguyen, David S. Miller,
	Jakub Kicinski, Jacob Keller, Arnd Bergmann, Kurt Kanzenbach,
	Shiraz Saleem, Dave Ertman, intel-wired-lan, netdev,
	linux-kernel

On Mon, Aug 02, 2021 at 04:59:33PM +0200, Arnd Bergmann wrote:

> This is a recurring problem in many drivers, and we have discussed
> it several times befores, without reaching a consensus. I'm providing
> a link to the previous email thread for reference, which discusses
> some related problems, though I can't find what reasons there were
> against the approach with the extra Kconfig dependency.

Quoting myself in the thread from 12 Nov 2020:

   This whole "implies" thing turned out to be a colossal PITA.

   I regret the fact that it got merged.  It wasn't my idea.

This whole thing came about because Nicolas Pitre wanted to make PHC
core support into a module and also to be able to remove dynamic posix
clock support for tinification.  It has proved to be a never ending
source of confusion.

Let's restore the core functionality and remove "implies" for good.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 16:49   ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-02 16:49 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 02, 2021 at 04:59:33PM +0200, Arnd Bergmann wrote:

> This is a recurring problem in many drivers, and we have discussed
> it several times befores, without reaching a consensus. I'm providing
> a link to the previous email thread for reference, which discusses
> some related problems, though I can't find what reasons there were
> against the approach with the extra Kconfig dependency.

Quoting myself in the thread from 12 Nov 2020:

   This whole "implies" thing turned out to be a colossal PITA.

   I regret the fact that it got merged.  It wasn't my idea.

This whole thing came about because Nicolas Pitre wanted to make PHC
core support into a module and also to be able to remove dynamic posix
clock support for tinification.  It has proved to be a never ending
source of confusion.

Let's restore the core functionality and remove "implies" for good.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 16:49   ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-02 19:54     ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 19:54 UTC (permalink / raw)
  To: Richard Cochran, Arnd Bergmann
  Cc: Nicolas Pitre, Brandeburg, Jesse, Nguyen, Anthony L,
	David S. Miller, Jakub Kicinski, Arnd Bergmann, Kurt Kanzenbach,
	Saleem, Shiraz, Ertman, David M, intel-wired-lan, netdev,
	linux-kernel

On 8/2/2021 9:49 AM, Richard Cochran wrote:
> On Mon, Aug 02, 2021 at 04:59:33PM +0200, Arnd Bergmann wrote:
> 
>> This is a recurring problem in many drivers, and we have discussed
>> it several times befores, without reaching a consensus. I'm providing
>> a link to the previous email thread for reference, which discusses
>> some related problems, though I can't find what reasons there were
>> against the approach with the extra Kconfig dependency.
> 
> Quoting myself in the thread from 12 Nov 2020:
> 
>    This whole "implies" thing turned out to be a colossal PITA.
> 
>    I regret the fact that it got merged.  It wasn't my idea.
> 
> This whole thing came about because Nicolas Pitre wanted to make PHC
> core support into a module and also to be able to remove dynamic posix
> clock support for tinification.  It has proved to be a never ending
> source of confusion.
> 
> Let's restore the core functionality and remove "implies" for good.
> 
> Thanks,
> Richard
> 

So go back to "select"?

It looks like Arnd proposed in the thread a solution that did a sort of
"please enable this" but still let you disable it.

An alternative (unfortunately per-driver...) solution was to setup the
drivers so that they gracefully fall back to disabling PTP if the PTP
core support is not reachable.. but that obviously requires that drivers
do the right thing, and at least Intel drivers have not tested this
properly.

I'm definitely in favor of removing "implies" entirely. The semantics
are unclear, and the fact that it doesn't handle the case of "i'm
builtin, so my implies can't be modules"...

I don't really like the syntax of the double "depends on A || !A".. I'd
prefer if we had some keyword for this, since it would be more obvious
and not run against the standard logic (A || !A is a tautology!)

Thanks,
Jake


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 19:54     ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 19:54 UTC (permalink / raw)
  To: intel-wired-lan

On 8/2/2021 9:49 AM, Richard Cochran wrote:
> On Mon, Aug 02, 2021 at 04:59:33PM +0200, Arnd Bergmann wrote:
> 
>> This is a recurring problem in many drivers, and we have discussed
>> it several times befores, without reaching a consensus. I'm providing
>> a link to the previous email thread for reference, which discusses
>> some related problems, though I can't find what reasons there were
>> against the approach with the extra Kconfig dependency.
> 
> Quoting myself in the thread from 12 Nov 2020:
> 
>    This whole "implies" thing turned out to be a colossal PITA.
> 
>    I regret the fact that it got merged.  It wasn't my idea.
> 
> This whole thing came about because Nicolas Pitre wanted to make PHC
> core support into a module and also to be able to remove dynamic posix
> clock support for tinification.  It has proved to be a never ending
> source of confusion.
> 
> Let's restore the core functionality and remove "implies" for good.
> 
> Thanks,
> Richard
> 

So go back to "select"?

It looks like Arnd proposed in the thread a solution that did a sort of
"please enable this" but still let you disable it.

An alternative (unfortunately per-driver...) solution was to setup the
drivers so that they gracefully fall back to disabling PTP if the PTP
core support is not reachable.. but that obviously requires that drivers
do the right thing, and at least Intel drivers have not tested this
properly.

I'm definitely in favor of removing "implies" entirely. The semantics
are unclear, and the fact that it doesn't handle the case of "i'm
builtin, so my implies can't be modules"...

I don't really like the syntax of the double "depends on A || !A".. I'd
prefer if we had some keyword for this, since it would be more obvious
and not run against the standard logic (A || !A is a tautology!)

Thanks,
Jake


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 19:54     ` [Intel-wired-lan] " Keller, Jacob E
@ 2021-08-02 20:32       ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 20:32 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, Aug 2, 2021 at 9:54 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
>
> So go back to "select"?
>
> It looks like Arnd proposed in the thread a solution that did a sort of
> "please enable this" but still let you disable it.
>
> An alternative (unfortunately per-driver...) solution was to setup the
> drivers so that they gracefully fall back to disabling PTP if the PTP
> core support is not reachable.. but that obviously requires that drivers
> do the right thing, and at least Intel drivers have not tested this
> properly.
>
> I'm definitely in favor of removing "implies" entirely. The semantics
> are unclear, and the fact that it doesn't handle the case of "i'm
> builtin, so my implies can't be modules"...
>
> I don't really like the syntax of the double "depends on A || !A".. I'd
> prefer if we had some keyword for this, since it would be more obvious
> and not run against the standard logic (A || !A is a tautology!)

I think the main reason we don't have a keyword for it is that nobody
so far has come up with an English word that expresses what it is
supposed to mean.

You can do something like it for a particular symbol though, such as

config MAY_USE_PTP_1588_CLOCK
       def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK

 config E1000E
        tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
        depends on PCI && (!SPARC32 || BROKEN)
+       depends on MAY_USE_PTP_1588_CLOCK
        select CRC32
-       imply PTP_1588_CLOCK


          Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 20:32       ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 20:32 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 2, 2021 at 9:54 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
>
> So go back to "select"?
>
> It looks like Arnd proposed in the thread a solution that did a sort of
> "please enable this" but still let you disable it.
>
> An alternative (unfortunately per-driver...) solution was to setup the
> drivers so that they gracefully fall back to disabling PTP if the PTP
> core support is not reachable.. but that obviously requires that drivers
> do the right thing, and at least Intel drivers have not tested this
> properly.
>
> I'm definitely in favor of removing "implies" entirely. The semantics
> are unclear, and the fact that it doesn't handle the case of "i'm
> builtin, so my implies can't be modules"...
>
> I don't really like the syntax of the double "depends on A || !A".. I'd
> prefer if we had some keyword for this, since it would be more obvious
> and not run against the standard logic (A || !A is a tautology!)

I think the main reason we don't have a keyword for it is that nobody
so far has come up with an English word that expresses what it is
supposed to mean.

You can do something like it for a particular symbol though, such as

config MAY_USE_PTP_1588_CLOCK
       def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK

 config E1000E
        tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
        depends on PCI && (!SPARC32 || BROKEN)
+       depends on MAY_USE_PTP_1588_CLOCK
        select CRC32
-       imply PTP_1588_CLOCK


          Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:32       ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-02 20:46         ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 20:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:32 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 2, 2021 at 9:54 PM Keller, Jacob E <jacob.e.keller@intel.com>
> wrote:
> >
> > So go back to "select"?
> >
> > It looks like Arnd proposed in the thread a solution that did a sort of
> > "please enable this" but still let you disable it.
> >
> > An alternative (unfortunately per-driver...) solution was to setup the
> > drivers so that they gracefully fall back to disabling PTP if the PTP
> > core support is not reachable.. but that obviously requires that drivers
> > do the right thing, and at least Intel drivers have not tested this
> > properly.
> >
> > I'm definitely in favor of removing "implies" entirely. The semantics
> > are unclear, and the fact that it doesn't handle the case of "i'm
> > builtin, so my implies can't be modules"...
> >
> > I don't really like the syntax of the double "depends on A || !A".. I'd
> > prefer if we had some keyword for this, since it would be more obvious
> > and not run against the standard logic (A || !A is a tautology!)
> 
> I think the main reason we don't have a keyword for it is that nobody
> so far has come up with an English word that expresses what it is
> supposed to mean.
> 

Right. I don't have a great example that's a single word either.

> You can do something like it for a particular symbol though, such as
> 
> config MAY_USE_PTP_1588_CLOCK
>        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> 
>  config E1000E
>         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
>         depends on PCI && (!SPARC32 || BROKEN)
> +       depends on MAY_USE_PTP_1588_CLOCK
>         select CRC32
> -       imply PTP_1588_CLOCK

What about "integrates"?

Or.. what if we just changed "implies" to also include the dependencies automatically? i.e. "implies PTP_1588_CLOCK" also means the depends trick which ensures that you can't have it as module if this is built-in.

I.e. we still get the nice "this will turn on automatically in the menu if you enable this" and we enforce that you can't have it as a module since it would be a dependency if it's on"?

> 
> 
>           Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 20:46         ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 20:46 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:32 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-
> kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 2, 2021 at 9:54 PM Keller, Jacob E <jacob.e.keller@intel.com>
> wrote:
> >
> > So go back to "select"?
> >
> > It looks like Arnd proposed in the thread a solution that did a sort of
> > "please enable this" but still let you disable it.
> >
> > An alternative (unfortunately per-driver...) solution was to setup the
> > drivers so that they gracefully fall back to disabling PTP if the PTP
> > core support is not reachable.. but that obviously requires that drivers
> > do the right thing, and at least Intel drivers have not tested this
> > properly.
> >
> > I'm definitely in favor of removing "implies" entirely. The semantics
> > are unclear, and the fact that it doesn't handle the case of "i'm
> > builtin, so my implies can't be modules"...
> >
> > I don't really like the syntax of the double "depends on A || !A".. I'd
> > prefer if we had some keyword for this, since it would be more obvious
> > and not run against the standard logic (A || !A is a tautology!)
> 
> I think the main reason we don't have a keyword for it is that nobody
> so far has come up with an English word that expresses what it is
> supposed to mean.
> 

Right. I don't have a great example that's a single word either.

> You can do something like it for a particular symbol though, such as
> 
> config MAY_USE_PTP_1588_CLOCK
>        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> 
>  config E1000E
>         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
>         depends on PCI && (!SPARC32 || BROKEN)
> +       depends on MAY_USE_PTP_1588_CLOCK
>         select CRC32
> -       imply PTP_1588_CLOCK

What about "integrates"?

Or.. what if we just changed "implies" to also include the dependencies automatically? i.e. "implies PTP_1588_CLOCK" also means the depends trick which ensures that you can't have it as module if this is built-in.

I.e. we still get the nice "this will turn on automatically in the menu if you enable this" and we enforce that you can't have it as a module since it would be a dependency if it's on"?

> 
> 
>           Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:46         ` [Intel-wired-lan] " Keller, Jacob E
@ 2021-08-02 20:59           ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 20:59 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
<jacob.e.keller@intel.com> wrote:

> > You can do something like it for a particular symbol though, such as
> >
> > config MAY_USE_PTP_1588_CLOCK
> >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> >
> >  config E1000E
> >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> >         depends on PCI && (!SPARC32 || BROKEN)
> > +       depends on MAY_USE_PTP_1588_CLOCK
> >         select CRC32
> > -       imply PTP_1588_CLOCK
>
> What about "integrates"?

Maybe, we'd need to look at whether that fits for the other users of the
"A || !A" trick.

> Or.. what if we just changed "implies" to also include the dependencies
> automatically? i.e. "implies PTP_1588_CLOCK" also means the depends
> trick which ensures that you can't have it as module if this is built-in.
>
> I.e. we still get the nice "this will turn on automatically in the menu if you
> enable this" and we enforce that you can't have it as a module since it
> would be a dependency if it's on"?

I don't want to mess with the semantics of the keyword any further.
The original meaning was meant to avoid circular dependencies
by making it a softer version of 'select' that would not try to select
anything that has unmet dependencies. The current version made
it even softer by only having an effect during 'make defconfig'
and 'make oldconfig' but not preventing it from being soft-disabled
any more. Changing it yet again is guarantee to break lots of the
existing users, while probably also bringing back the original problem
of the circular dependencies.

         Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 20:59           ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-02 20:59 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
<jacob.e.keller@intel.com> wrote:

> > You can do something like it for a particular symbol though, such as
> >
> > config MAY_USE_PTP_1588_CLOCK
> >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> >
> >  config E1000E
> >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> >         depends on PCI && (!SPARC32 || BROKEN)
> > +       depends on MAY_USE_PTP_1588_CLOCK
> >         select CRC32
> > -       imply PTP_1588_CLOCK
>
> What about "integrates"?

Maybe, we'd need to look at whether that fits for the other users of the
"A || !A" trick.

> Or.. what if we just changed "implies" to also include the dependencies
> automatically? i.e. "implies PTP_1588_CLOCK" also means the depends
> trick which ensures that you can't have it as module if this is built-in.
>
> I.e. we still get the nice "this will turn on automatically in the menu if you
> enable this" and we enforce that you can't have it as a module since it
> would be a dependency if it's on"?

I don't want to mess with the semantics of the keyword any further.
The original meaning was meant to avoid circular dependencies
by making it a softer version of 'select' that would not try to select
anything that has unmet dependencies. The current version made
it even softer by only having an effect during 'make defconfig'
and 'make oldconfig' but not preventing it from being soft-disabled
any more. Changing it yet again is guarantee to break lots of the
existing users, while probably also bringing back the original problem
of the circular dependencies.

         Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:59           ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-02 21:09             ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 21:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:59 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> I don't want to mess with the semantics of the keyword any further.
> The original meaning was meant to avoid circular dependencies
> by making it a softer version of 'select' that would not try to select
> anything that has unmet dependencies. The current version made
> it even softer by only having an effect during 'make defconfig'
> and 'make oldconfig' but not preventing it from being soft-disabled
> any more. Changing it yet again is guarantee to break lots of the
> existing users, while probably also bringing back the original problem
> of the circular dependencies.
> 
>          Arnd

Yea ok that makes sense. Better to use a new keyword if we do at all.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 21:09             ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 21:09 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:59 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-
> kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> I don't want to mess with the semantics of the keyword any further.
> The original meaning was meant to avoid circular dependencies
> by making it a softer version of 'select' that would not try to select
> anything that has unmet dependencies. The current version made
> it even softer by only having an effect during 'make defconfig'
> and 'make oldconfig' but not preventing it from being soft-disabled
> any more. Changing it yet again is guarantee to break lots of the
> existing users, while probably also bringing back the original problem
> of the circular dependencies.
> 
>          Arnd

Yea ok that makes sense. Better to use a new keyword if we do at all.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:59           ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-02 21:10             ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 21:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:59 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
> <jacob.e.keller@intel.com> wrote:
> 
> > > You can do something like it for a particular symbol though, such as
> > >
> > > config MAY_USE_PTP_1588_CLOCK
> > >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> > >
> > >  config E1000E
> > >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> > >         depends on PCI && (!SPARC32 || BROKEN)
> > > +       depends on MAY_USE_PTP_1588_CLOCK
> > >         select CRC32
> > > -       imply PTP_1588_CLOCK
> >
> > What about "integrates"?
> 
> Maybe, we'd need to look at whether that fits for the other users of the
> "A || !A" trick.
> 

Sure.  I just know from reading it other places it really causes a "huh?" reaction.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 21:10             ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 21:10 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 02, 2021 1:59 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nicolas.pitre@linaro.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-
> kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
> <jacob.e.keller@intel.com> wrote:
> 
> > > You can do something like it for a particular symbol though, such as
> > >
> > > config MAY_USE_PTP_1588_CLOCK
> > >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> > >
> > >  config E1000E
> > >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> > >         depends on PCI && (!SPARC32 || BROKEN)
> > > +       depends on MAY_USE_PTP_1588_CLOCK
> > >         select CRC32
> > > -       imply PTP_1588_CLOCK
> >
> > What about "integrates"?
> 
> Maybe, we'd need to look at whether that fits for the other users of the
> "A || !A" trick.
> 

Sure.  I just know from reading it other places it really causes a "huh?" reaction.

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:59           ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-02 21:22             ` Nicolas Pitre
  -1 siblings, 0 replies; 46+ messages in thread
From: Nicolas Pitre @ 2021-08-02 21:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Keller, Jacob E, Richard Cochran, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, 2 Aug 2021, Arnd Bergmann wrote:

> On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
> <jacob.e.keller@intel.com> wrote:
> 
> > > You can do something like it for a particular symbol though, such as
> > >
> > > config MAY_USE_PTP_1588_CLOCK
> > >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> > >
> > >  config E1000E
> > >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> > >         depends on PCI && (!SPARC32 || BROKEN)
> > > +       depends on MAY_USE_PTP_1588_CLOCK
> > >         select CRC32
> > > -       imply PTP_1588_CLOCK
> >
> > What about "integrates"?
> 
> Maybe, we'd need to look at whether that fits for the other users of the
> "A || !A" trick.

I implemented "conditional dependencies" at the time, which is syntactic 
sugar to express the above as:

	depends on A if A != n

	depends on A if A

etc.

http://lkml.iu.edu/hypermail/linux/kernel/2004.2/09783.html

But Masahiro shut it down.


Nicolas

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 21:22             ` Nicolas Pitre
  0 siblings, 0 replies; 46+ messages in thread
From: Nicolas Pitre @ 2021-08-02 21:22 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, 2 Aug 2021, Arnd Bergmann wrote:

> On Mon, Aug 2, 2021 at 10:46 PM Keller, Jacob E
> <jacob.e.keller@intel.com> wrote:
> 
> > > You can do something like it for a particular symbol though, such as
> > >
> > > config MAY_USE_PTP_1588_CLOCK
> > >        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
> > >
> > >  config E1000E
> > >         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
> > >         depends on PCI && (!SPARC32 || BROKEN)
> > > +       depends on MAY_USE_PTP_1588_CLOCK
> > >         select CRC32
> > > -       imply PTP_1588_CLOCK
> >
> > What about "integrates"?
> 
> Maybe, we'd need to look at whether that fits for the other users of the
> "A || !A" trick.

I implemented "conditional dependencies" at the time, which is syntactic 
sugar to express the above as:

	depends on A if A != n

	depends on A if A

etc.

http://lkml.iu.edu/hypermail/linux/kernel/2004.2/09783.html

But Masahiro shut it down.


Nicolas

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 19:54     ` [Intel-wired-lan] " Keller, Jacob E
@ 2021-08-02 23:09       ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-02 23:09 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Arnd Bergmann, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> So go back to "select"?

Why not keep it simple?

PTP core:
   Boolean PTP_1588_CLOCK

drivers:
   depends on PTP_1588_CLOCK

Also, make Posix timers always part of the core.  Tinification is a
lost cause.

Thanks,
Richard


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 23:09       ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-02 23:09 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> So go back to "select"?

Why not keep it simple?

PTP core:
   Boolean PTP_1588_CLOCK

drivers:
   depends on PTP_1588_CLOCK

Also, make Posix timers always part of the core.  Tinification is a
lost cause.

Thanks,
Richard


^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 23:09       ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-02 23:45         ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 23:45 UTC (permalink / raw)
  To: Richard Cochran
  Cc: Arnd Bergmann, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Monday, August 02, 2021 4:09 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Arnd Bergmann <arnd@kernel.org>; Nicolas Pitre <nicolas.pitre@linaro.org>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> > So go back to "select"?
> 
> Why not keep it simple?
> 
> PTP core:
>    Boolean PTP_1588_CLOCK
> 
> drivers:
>    depends on PTP_1588_CLOCK
> 
> Also, make Posix timers always part of the core.  Tinification is a
> lost cause.
> 
> Thanks,
> Richard

Ok, so basically: if any driver that needs PTP core is on, PTP core is on, with no way to disable it.

Thanks,
Jake


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-02 23:45         ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-02 23:45 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Monday, August 02, 2021 4:09 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Arnd Bergmann <arnd@kernel.org>; Nicolas Pitre <nicolas.pitre@linaro.org>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan at lists.osuosl.org;
> netdev at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> > So go back to "select"?
> 
> Why not keep it simple?
> 
> PTP core:
>    Boolean PTP_1588_CLOCK
> 
> drivers:
>    depends on PTP_1588_CLOCK
> 
> Also, make Posix timers always part of the core.  Tinification is a
> lost cause.
> 
> Thanks,
> Richard

Ok, so basically: if any driver that needs PTP core is on, PTP core is on, with no way to disable it.

Thanks,
Jake


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 23:45         ` [Intel-wired-lan] " Keller, Jacob E
@ 2021-08-03  0:03           ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03  0:03 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Nicolas Pitre, Arnd Bergmann, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, Aug 02, 2021 at 11:45:09PM +0000, Keller, Jacob E wrote:
> Ok, so basically: if any driver that needs PTP core is on, PTP core is on, with no way to disable it.

Right.  Some MAC drivers keep the PTP stuff under a second Kconfig option.

IIRC, we (davem and netdev) decided not to do that going forwards.  If
a MAC has PTP features, then users will sure want it enabled.

So, let the MACs use "depends" or "select" PTP core.  I guess that
"select" is more user friendly.

And Posix timers: never disable this.  After all, who wants an
embedded system without timer_create()?  Seriously?

Thanks,
Richard



^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03  0:03           ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03  0:03 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 02, 2021 at 11:45:09PM +0000, Keller, Jacob E wrote:
> Ok, so basically: if any driver that needs PTP core is on, PTP core is on, with no way to disable it.

Right.  Some MAC drivers keep the PTP stuff under a second Kconfig option.

IIRC, we (davem and netdev) decided not to do that going forwards.  If
a MAC has PTP features, then users will sure want it enabled.

So, let the MACs use "depends" or "select" PTP core.  I guess that
"select" is more user friendly.

And Posix timers: never disable this.  After all, who wants an
embedded system without timer_create()?  Seriously?

Thanks,
Richard



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 23:09       ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-03  6:59         ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03  6:59 UTC (permalink / raw)
  To: Richard Cochran
  Cc: Keller, Jacob E, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Tue, Aug 3, 2021 at 1:09 AM Richard Cochran <richardcochran@gmail.com> wrote:
>
> On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> > So go back to "select"?
>
> Why not keep it simple?
>
> PTP core:
>    Boolean PTP_1588_CLOCK
>
> drivers:
>    depends on PTP_1588_CLOCK
>
> Also, make Posix timers always part of the core.  Tinification is a
> lost cause.

It may well be a lost cause, but a build fix is not the time to nail down
that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
symbol) is only two extra lines and leaves everything else working for the
moment. I would suggest we merge that first and then raise the question
about whether to give up on tinyfication on the summit list, there are a few
other things that have come up that would also benefit from trying less hard,
but if we overdo this, we can get to the point of hurting even systems that are
otherwise still well supported (64MB MIPS/ARMv5 SoCs, small boot partitions,
etc.).

        Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03  6:59         ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03  6:59 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 3, 2021 at 1:09 AM Richard Cochran <richardcochran@gmail.com> wrote:
>
> On Mon, Aug 02, 2021 at 07:54:20PM +0000, Keller, Jacob E wrote:
> > So go back to "select"?
>
> Why not keep it simple?
>
> PTP core:
>    Boolean PTP_1588_CLOCK
>
> drivers:
>    depends on PTP_1588_CLOCK
>
> Also, make Posix timers always part of the core.  Tinification is a
> lost cause.

It may well be a lost cause, but a build fix is not the time to nail down
that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
symbol) is only two extra lines and leaves everything else working for the
moment. I would suggest we merge that first and then raise the question
about whether to give up on tinyfication on the summit list, there are a few
other things that have come up that would also benefit from trying less hard,
but if we overdo this, we can get to the point of hurting even systems that are
otherwise still well supported (64MB MIPS/ARMv5 SoCs, small boot partitions,
etc.).

        Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03  6:59         ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-03 15:55           ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 15:55 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Keller, Jacob E, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> It may well be a lost cause, but a build fix is not the time to nail down
> that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> symbol) is only two extra lines and leaves everything else working for the
> moment.

Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
imply and MAY_USE.

Can't we fix this once and for all?

Seriously, "imply" has been nothing but a major PITA since day one,
and all to save 22 kb.  I can't think of another subsystem which
tolerates so much pain for so little gain.

Thanks,
Richard


> I would suggest we merge that first and then raise the question
> about whether to give up on tinyfication on the summit list, there are a few
> other things that have come up that would also benefit from trying less hard,
> but if we overdo this, we can get to the point of hurting even systems that are
> otherwise still well supported (64MB MIPS/ARMv5 SoCs, small boot partitions,
> etc.).
> 
>         Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 15:55           ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 15:55 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> It may well be a lost cause, but a build fix is not the time to nail down
> that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> symbol) is only two extra lines and leaves everything else working for the
> moment.

Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
imply and MAY_USE.

Can't we fix this once and for all?

Seriously, "imply" has been nothing but a major PITA since day one,
and all to save 22 kb.  I can't think of another subsystem which
tolerates so much pain for so little gain.

Thanks,
Richard


> I would suggest we merge that first and then raise the question
> about whether to give up on tinyfication on the summit list, there are a few
> other things that have come up that would also benefit from trying less hard,
> but if we overdo this, we can get to the point of hurting even systems that are
> otherwise still well supported (64MB MIPS/ARMv5 SoCs, small boot partitions,
> etc.).
> 
>         Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 15:55           ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-03 16:14             ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 16:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Pitre, Keller, Jacob E, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > It may well be a lost cause, but a build fix is not the time to nail down
> > that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> > symbol) is only two extra lines and leaves everything else working for the
> > moment.
> 
> Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> imply and MAY_USE.
> 
> Can't we fix this once and for all?
> 
> Seriously, "imply" has been nothing but a major PITA since day one,
> and all to save 22 kb.  I can't think of another subsystem which
> tolerates so much pain for so little gain.

Here is what I want to have, in accordance with the KISS principle:

config PTP_1588_CLOCK
	bool "PTP clock support"
	select NET
	select POSIX_TIMERS
	select PPS
	select NET_PTP_CLASSIFY

# driver variant 1:

config ACME_MAC
	select PTP_1588_CLOCK

# driver variant 2:

config ACME_MAC

config ACME_MAC_PTP
	depends on ACME_MAC
	select PTP_1588_CLOCK

Hm?	

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 16:14             ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 16:14 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > It may well be a lost cause, but a build fix is not the time to nail down
> > that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> > symbol) is only two extra lines and leaves everything else working for the
> > moment.
> 
> Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> imply and MAY_USE.
> 
> Can't we fix this once and for all?
> 
> Seriously, "imply" has been nothing but a major PITA since day one,
> and all to save 22 kb.  I can't think of another subsystem which
> tolerates so much pain for so little gain.

Here is what I want to have, in accordance with the KISS principle:

config PTP_1588_CLOCK
	bool "PTP clock support"
	select NET
	select POSIX_TIMERS
	select PPS
	select NET_PTP_CLASSIFY

# driver variant 1:

config ACME_MAC
	select PTP_1588_CLOCK

# driver variant 2:

config ACME_MAC

config ACME_MAC_PTP
	depends on ACME_MAC
	select PTP_1588_CLOCK

Hm?	

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 16:14             ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-03 17:00               ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 17:00 UTC (permalink / raw)
  To: Richard Cochran
  Cc: Nicolas Pitre, Keller, Jacob E, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:
> On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> > On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > > It may well be a lost cause, but a build fix is not the time to nail down
> > > that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> > > symbol) is only two extra lines and leaves everything else working for the
> > > moment.
> >
> > Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> > imply and MAY_USE.

I'm all in favor of removing imply elsewhere as well, but that needs much
broader consensus than removing it from PTP_1588_CLOCK.

It has already crept into cryto/ and sound/soc/codecs/, and at least in
the latter case it does seem to even make sense, so they are less
likely to remove it.

> > Can't we fix this once and for all?
> >
> > Seriously, "imply" has been nothing but a major PITA since day one,
> > and all to save 22 kb.  I can't think of another subsystem which
> > tolerates so much pain for so little gain.
>
> Here is what I want to have, in accordance with the KISS principle:
>
> config PTP_1588_CLOCK
>         bool "PTP clock support"
>         select NET
>         select POSIX_TIMERS
>         select PPS
>         select NET_PTP_CLASSIFY
>
> # driver variant 1:
>
> config ACME_MAC
>         select PTP_1588_CLOCK
>
> # driver variant 2:
>
> config ACME_MAC
>
> config ACME_MAC_PTP
>         depends on ACME_MAC
>         select PTP_1588_CLOCK
>
> Hm?

Selecting a subsystem (NET, POSIX_TIMES, PPS, NET_PTP_CLASSIFY)
from a device driver is the nightmare that 'imply' was meant to solve (but did
not): this causes dependency loops, and unintended behavior where you
end up accidentally enabling a lot more drivers than you actually need
(when other symbols depend on the selected ones, and default to y).

If you turn all those 'select' lines into 'depends on', this will work, but it's
not actually much different from what I'm suggesting. Maybe we can do it
in two steps: first fix the build failure by replacing all the 'imply'
statements
with the correct dependencies, and then you send a patch on top that
turns PPS and PTP_1588_CLOCK into bool options.

     Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 17:00               ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 17:00 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:
> On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> > On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > > It may well be a lost cause, but a build fix is not the time to nail down
> > > that decision. The fix I proposed (with the added MAY_USE_PTP_1588_CLOCK
> > > symbol) is only two extra lines and leaves everything else working for the
> > > moment.
> >
> > Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> > imply and MAY_USE.

I'm all in favor of removing imply elsewhere as well, but that needs much
broader consensus than removing it from PTP_1588_CLOCK.

It has already crept into cryto/ and sound/soc/codecs/, and at least in
the latter case it does seem to even make sense, so they are less
likely to remove it.

> > Can't we fix this once and for all?
> >
> > Seriously, "imply" has been nothing but a major PITA since day one,
> > and all to save 22 kb.  I can't think of another subsystem which
> > tolerates so much pain for so little gain.
>
> Here is what I want to have, in accordance with the KISS principle:
>
> config PTP_1588_CLOCK
>         bool "PTP clock support"
>         select NET
>         select POSIX_TIMERS
>         select PPS
>         select NET_PTP_CLASSIFY
>
> # driver variant 1:
>
> config ACME_MAC
>         select PTP_1588_CLOCK
>
> # driver variant 2:
>
> config ACME_MAC
>
> config ACME_MAC_PTP
>         depends on ACME_MAC
>         select PTP_1588_CLOCK
>
> Hm?

Selecting a subsystem (NET, POSIX_TIMES, PPS, NET_PTP_CLASSIFY)
from a device driver is the nightmare that 'imply' was meant to solve (but did
not): this causes dependency loops, and unintended behavior where you
end up accidentally enabling a lot more drivers than you actually need
(when other symbols depend on the selected ones, and default to y).

If you turn all those 'select' lines into 'depends on', this will work, but it's
not actually much different from what I'm suggesting. Maybe we can do it
in two steps: first fix the build failure by replacing all the 'imply'
statements
with the correct dependencies, and then you send a patch on top that
turns PPS and PTP_1588_CLOCK into bool options.

     Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 17:00               ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-03 17:18                 ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-03 17:18 UTC (permalink / raw)
  To: Arnd Bergmann, Richard Cochran
  Cc: Nicolas Pitre, Brandeburg, Jesse, Nguyen, Anthony L,
	David S. Miller, Jakub Kicinski, Arnd Bergmann, Kurt Kanzenbach,
	Saleem, Shiraz, Ertman, David M, intel-wired-lan, netdev,
	linux-kernel



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, August 03, 2021 10:01 AM
> To: Richard Cochran <richardcochran@gmail.com>
> Cc: Nicolas Pitre <nico@fluxnic.net>; Keller, Jacob E <jacob.e.keller@intel.com>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com>
> wrote:
> > On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> > > On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > > > It may well be a lost cause, but a build fix is not the time to nail down
> > > > that decision. The fix I proposed (with the added
> MAY_USE_PTP_1588_CLOCK
> > > > symbol) is only two extra lines and leaves everything else working for the
> > > > moment.
> > >
> > > Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> > > imply and MAY_USE.
> 
> I'm all in favor of removing imply elsewhere as well, but that needs much
> broader consensus than removing it from PTP_1588_CLOCK.
> 
> It has already crept into cryto/ and sound/soc/codecs/, and at least in
> the latter case it does seem to even make sense, so they are less
> likely to remove it.
> 
> > > Can't we fix this once and for all?
> > >
> > > Seriously, "imply" has been nothing but a major PITA since day one,
> > > and all to save 22 kb.  I can't think of another subsystem which
> > > tolerates so much pain for so little gain.
> >
> > Here is what I want to have, in accordance with the KISS principle:
> >
> > config PTP_1588_CLOCK
> >         bool "PTP clock support"
> >         select NET
> >         select POSIX_TIMERS
> >         select PPS
> >         select NET_PTP_CLASSIFY
> >
> > # driver variant 1:
> >
> > config ACME_MAC
> >         select PTP_1588_CLOCK
> >
> > # driver variant 2:
> >
> > config ACME_MAC
> >
> > config ACME_MAC_PTP
> >         depends on ACME_MAC
> >         select PTP_1588_CLOCK
> >
> > Hm?
> 
> Selecting a subsystem (NET, POSIX_TIMES, PPS, NET_PTP_CLASSIFY)
> from a device driver is the nightmare that 'imply' was meant to solve (but did
> not): this causes dependency loops, and unintended behavior where you
> end up accidentally enabling a lot more drivers than you actually need
> (when other symbols depend on the selected ones, and default to y).
> 
> If you turn all those 'select' lines into 'depends on', this will work, but it's
> not actually much different from what I'm suggesting. Maybe we can do it
> in two steps: first fix the build failure by replacing all the 'imply'
> statements
> with the correct dependencies, and then you send a patch on top that
> turns PPS and PTP_1588_CLOCK into bool options.
> 
>      Arnd

There is an alternative solution to fixing the imply keyword:

Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.

This would make it work correctly for users who want tinification, *and* it would make there be no strong dependency between anything, while still allowing optionally defaulting to yes.

That being said, I don't think saving 22kb is worth the chance to get things wrong (as we've seen).

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 17:18                 ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-03 17:18 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, August 03, 2021 10:01 AM
> To: Richard Cochran <richardcochran@gmail.com>
> Cc: Nicolas Pitre <nico@fluxnic.net>; Keller, Jacob E <jacob.e.keller@intel.com>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan at lists.osuosl.org;
> netdev at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com>
> wrote:
> > On Tue, Aug 03, 2021 at 08:55:56AM -0700, Richard Cochran wrote:
> > > On Tue, Aug 03, 2021 at 08:59:02AM +0200, Arnd Bergmann wrote:
> > > > It may well be a lost cause, but a build fix is not the time to nail down
> > > > that decision. The fix I proposed (with the added
> MAY_USE_PTP_1588_CLOCK
> > > > symbol) is only two extra lines and leaves everything else working for the
> > > > moment.
> > >
> > > Well, then we'll have TWO ugly and incomprehensible Kconfig hacks,
> > > imply and MAY_USE.
> 
> I'm all in favor of removing imply elsewhere as well, but that needs much
> broader consensus than removing it from PTP_1588_CLOCK.
> 
> It has already crept into cryto/ and sound/soc/codecs/, and at least in
> the latter case it does seem to even make sense, so they are less
> likely to remove it.
> 
> > > Can't we fix this once and for all?
> > >
> > > Seriously, "imply" has been nothing but a major PITA since day one,
> > > and all to save 22 kb.  I can't think of another subsystem which
> > > tolerates so much pain for so little gain.
> >
> > Here is what I want to have, in accordance with the KISS principle:
> >
> > config PTP_1588_CLOCK
> >         bool "PTP clock support"
> >         select NET
> >         select POSIX_TIMERS
> >         select PPS
> >         select NET_PTP_CLASSIFY
> >
> > # driver variant 1:
> >
> > config ACME_MAC
> >         select PTP_1588_CLOCK
> >
> > # driver variant 2:
> >
> > config ACME_MAC
> >
> > config ACME_MAC_PTP
> >         depends on ACME_MAC
> >         select PTP_1588_CLOCK
> >
> > Hm?
> 
> Selecting a subsystem (NET, POSIX_TIMES, PPS, NET_PTP_CLASSIFY)
> from a device driver is the nightmare that 'imply' was meant to solve (but did
> not): this causes dependency loops, and unintended behavior where you
> end up accidentally enabling a lot more drivers than you actually need
> (when other symbols depend on the selected ones, and default to y).
> 
> If you turn all those 'select' lines into 'depends on', this will work, but it's
> not actually much different from what I'm suggesting. Maybe we can do it
> in two steps: first fix the build failure by replacing all the 'imply'
> statements
> with the correct dependencies, and then you send a patch on top that
> turns PPS and PTP_1588_CLOCK into bool options.
> 
>      Arnd

There is an alternative solution to fixing the imply keyword:

Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.

This would make it work correctly for users who want tinification, *and* it would make there be no strong dependency between anything, while still allowing optionally defaulting to yes.

That being said, I don't think saving 22kb is worth the chance to get things wrong (as we've seen).

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 17:18                 ` [Intel-wired-lan] " Keller, Jacob E
@ 2021-08-03 18:27                   ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 18:27 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:

> There is an alternative solution to fixing the imply keyword:
>
> Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.

I would consider IS_REACHABLE() part of the problem, not the solution, it makes
things magically build, but then surprises users at runtime when they do not get
the intended behavior.

      Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 18:27                   ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 18:27 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:

> There is an alternative solution to fixing the imply keyword:
>
> Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.

I would consider IS_REACHABLE() part of the problem, not the solution, it makes
things magically build, but then surprises users at runtime when they do not get
the intended behavior.

      Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-02 20:32       ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-03 20:29         ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 20:29 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel

On Mon, Aug 2, 2021 at 10:32 PM Arnd Bergmann <arnd@kernel.org> wrote:

> config MAY_USE_PTP_1588_CLOCK
>        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
>
>  config E1000E
>         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
>         depends on PCI && (!SPARC32 || BROKEN)
> +       depends on MAY_USE_PTP_1588_CLOCK
>         select CRC32
> -       imply PTP_1588_CLOCK

I've written up the patch to do this all over the kernel now, and started an
overnight randconfig build session with this applied:

https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=ptp-1588-optional&id=3f69b7366cfd4b2c048c76be5299b38066933ee1

       Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 20:29         ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-03 20:29 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, Aug 2, 2021 at 10:32 PM Arnd Bergmann <arnd@kernel.org> wrote:

> config MAY_USE_PTP_1588_CLOCK
>        def_tristate PTP_1588_CLOCK || !PTP_1588_CLOCK
>
>  config E1000E
>         tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
>         depends on PCI && (!SPARC32 || BROKEN)
> +       depends on MAY_USE_PTP_1588_CLOCK
>         select CRC32
> -       imply PTP_1588_CLOCK

I've written up the patch to do this all over the kernel now, and started an
overnight randconfig build session with this applied:

https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?h=ptp-1588-optional&id=3f69b7366cfd4b2c048c76be5299b38066933ee1

       Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 17:00               ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-03 20:54                 ` Richard Cochran
  -1 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 20:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Pitre, Keller, Jacob E, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel


On Tue, Aug 03, 2021 at 07:00:49PM +0200, Arnd Bergmann wrote:

> If you turn all those 'select' lines into 'depends on', this will work, but it's
> not actually much different from what I'm suggesting.

"depends" instead of "select" works for me.  I just want it simple and clear.

> Maybe we can do it
> in two steps: first fix the build failure by replacing all the 'imply'
> statements
> with the correct dependencies, and then you send a patch on top that
> turns PPS and PTP_1588_CLOCK into bool options.

Sounds good.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 20:54                 ` Richard Cochran
  0 siblings, 0 replies; 46+ messages in thread
From: Richard Cochran @ 2021-08-03 20:54 UTC (permalink / raw)
  To: intel-wired-lan


On Tue, Aug 03, 2021 at 07:00:49PM +0200, Arnd Bergmann wrote:

> If you turn all those 'select' lines into 'depends on', this will work, but it's
> not actually much different from what I'm suggesting.

"depends" instead of "select" works for me.  I just want it simple and clear.

> Maybe we can do it
> in two steps: first fix the build failure by replacing all the 'imply'
> statements
> with the correct dependencies, and then you send a patch on top that
> turns PPS and PTP_1588_CLOCK into bool options.

Sounds good.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 18:27                   ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-03 23:25                     ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-03 23:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, August 03, 2021 11:27 AM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nico@fluxnic.net>; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen,
> Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran
> <richardcochran@gmail.com> wrote:
> 
> > There is an alternative solution to fixing the imply keyword:
> >
> > Make the drivers use it properly by *actually* conditionally enabling the feature
> only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of
> IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently
> does nothing but returns 0 to tell the rest of the driver things are fine.
> 
> I would consider IS_REACHABLE() part of the problem, not the solution, it makes
> things magically build, but then surprises users at runtime when they do not get
> the intended behavior.
> 
>       Arnd

Fair enough. I am also fine with just "depends". We can make most of the drivers simply always enable it, and if a specific driver is used in some embedded setup that has requirements on minimizing things that driver can be setup to use a 2nd config symbol, and all of the other drivers that aren't used can be disabled (as that minimizer is probably already doing!)

I think we've found the best route to go then!

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-03 23:25                     ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-03 23:25 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, August 03, 2021 11:27 AM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>; Nicolas Pitre
> <nico@fluxnic.net>; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen,
> Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Arnd Bergmann
> <arnd@arndb.de>; Kurt Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Ertman, David M <david.m.ertman@intel.com>;
> intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux-
> kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran
> <richardcochran@gmail.com> wrote:
> 
> > There is an alternative solution to fixing the imply keyword:
> >
> > Make the drivers use it properly by *actually* conditionally enabling the feature
> only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of
> IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently
> does nothing but returns 0 to tell the rest of the driver things are fine.
> 
> I would consider IS_REACHABLE() part of the problem, not the solution, it makes
> things magically build, but then surprises users at runtime when they do not get
> the intended behavior.
> 
>       Arnd

Fair enough. I am also fine with just "depends". We can make most of the drivers simply always enable it, and if a specific driver is used in some embedded setup that has requirements on minimizing things that driver can be setup to use a 2nd config symbol, and all of the other drivers that aren't used can be disabled (as that minimizer is probably already doing!)

I think we've found the best route to go then!

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 18:27                   ` [Intel-wired-lan] " Arnd Bergmann
@ 2021-08-04 11:18                     ` Arnd Bergmann
  -1 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-04 11:18 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Richard Cochran, Nicolas Pitre, Brandeburg, Jesse, Nguyen,
	Anthony L, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Kurt Kanzenbach, Saleem, Shiraz, Ertman, David M,
	intel-wired-lan, netdev, linux-kernel, Yangbo Lu

On Tue, Aug 3, 2021 at 8:27 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:
>
> > There is an alternative solution to fixing the imply keyword:
> >
> > Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.
>
> I would consider IS_REACHABLE() part of the problem, not the solution, it makes
> things magically build, but then surprises users at runtime when they do not get
> the intended behavior.

Case in point: two patches from Yangbo Lu that call into the ptp core
from built-in
network code look like they could never have worked with CONFIG_PTP_1588_CLOCK,
but did not cause a link failure because of the IS_REACHABLE() check, see
commit d7c088265588 ("net: socket: support hardware timestamp conversion to
PHC bound") and c156174a6707 ("ethtool: add a new command for getting PHC
virtual clocks").

I found that by testing my patch that turns the IS_REACHABLE() back into
IS_ENABLED() and got

aarch64-linux-ld: net/socket.o: in function `__sock_recv_timestamp':
socket.c:(.text+0x1f20): undefined reference to `ptp_convert_timestamp'
aarch64-linux-ld: net/ethtool/common.o: in function `ethtool_get_phc_vclocks':
common.c:(.text+0x35c): undefined reference to `ptp_get_vclocks_index'

I added a workaround to my patch now to keep it working as before, but this
needs to be fixed properly. The easiest way would be to no longer support
modular PTP at all as Richard would like to do anyway, but I have not
attempted other fixes.

       Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-04 11:18                     ` Arnd Bergmann
  0 siblings, 0 replies; 46+ messages in thread
From: Arnd Bergmann @ 2021-08-04 11:18 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Aug 3, 2021 at 8:27 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E <jacob.e.keller@intel.com> wrote:
> > > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran <richardcochran@gmail.com> wrote:
>
> > There is an alternative solution to fixing the imply keyword:
> >
> > Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine.
>
> I would consider IS_REACHABLE() part of the problem, not the solution, it makes
> things magically build, but then surprises users at runtime when they do not get
> the intended behavior.

Case in point: two patches from Yangbo Lu that call into the ptp core
from built-in
network code look like they could never have worked with CONFIG_PTP_1588_CLOCK,
but did not cause a link failure because of the IS_REACHABLE() check, see
commit d7c088265588 ("net: socket: support hardware timestamp conversion to
PHC bound") and c156174a6707 ("ethtool: add a new command for getting PHC
virtual clocks").

I found that by testing my patch that turns the IS_REACHABLE() back into
IS_ENABLED() and got

aarch64-linux-ld: net/socket.o: in function `__sock_recv_timestamp':
socket.c:(.text+0x1f20): undefined reference to `ptp_convert_timestamp'
aarch64-linux-ld: net/ethtool/common.o: in function `ethtool_get_phc_vclocks':
common.c:(.text+0x35c): undefined reference to `ptp_get_vclocks_index'

I added a workaround to my patch now to keep it working as before, but this
needs to be fixed properly. The easiest way would be to no longer support
modular PTP at all as Richard would like to do anyway, but I have not
attempted other fixes.

       Arnd

^ permalink raw reply	[flat|nested] 46+ messages in thread

* RE: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
  2021-08-03 20:54                 ` [Intel-wired-lan] " Richard Cochran
@ 2021-08-04 20:53                   ` Keller, Jacob E
  -1 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-04 20:53 UTC (permalink / raw)
  To: Richard Cochran, Arnd Bergmann
  Cc: Nicolas Pitre, Brandeburg, Jesse, Nguyen, Anthony L,
	David S. Miller, Jakub Kicinski, Arnd Bergmann, Kurt Kanzenbach,
	Saleem, Shiraz, Ertman, David M, intel-wired-lan, netdev,
	linux-kernel



> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Tuesday, August 03, 2021 1:55 PM
> To: Arnd Bergmann <arnd@kernel.org>
> Cc: Nicolas Pitre <nico@fluxnic.net>; Keller, Jacob E <jacob.e.keller@intel.com>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> 
> On Tue, Aug 03, 2021 at 07:00:49PM +0200, Arnd Bergmann wrote:
> 
> > If you turn all those 'select' lines into 'depends on', this will work, but it's
> > not actually much different from what I'm suggesting.
> 
> "depends" instead of "select" works for me.  I just want it simple and clear.
> 
> > Maybe we can do it
> > in two steps: first fix the build failure by replacing all the 'imply'
> > statements
> > with the correct dependencies, and then you send a patch on top that
> > turns PPS and PTP_1588_CLOCK into bool options.
> 
> Sounds good.
> 
> Thanks,
> Richard

Works for me too.

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-wired-lan] [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies
@ 2021-08-04 20:53                   ` Keller, Jacob E
  0 siblings, 0 replies; 46+ messages in thread
From: Keller, Jacob E @ 2021-08-04 20:53 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Tuesday, August 03, 2021 1:55 PM
> To: Arnd Bergmann <arnd@kernel.org>
> Cc: Nicolas Pitre <nico@fluxnic.net>; Keller, Jacob E <jacob.e.keller@intel.com>;
> Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Arnd Bergmann <arnd@arndb.de>; Kurt
> Kanzenbach <kurt@linutronix.de>; Saleem, Shiraz <shiraz.saleem@intel.com>;
> Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan at lists.osuosl.org;
> netdev at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK
> dependencies
> 
> 
> On Tue, Aug 03, 2021 at 07:00:49PM +0200, Arnd Bergmann wrote:
> 
> > If you turn all those 'select' lines into 'depends on', this will work, but it's
> > not actually much different from what I'm suggesting.
> 
> "depends" instead of "select" works for me.  I just want it simple and clear.
> 
> > Maybe we can do it
> > in two steps: first fix the build failure by replacing all the 'imply'
> > statements
> > with the correct dependencies, and then you send a patch on top that
> > turns PPS and PTP_1588_CLOCK into bool options.
> 
> Sounds good.
> 
> Thanks,
> Richard

Works for me too.

Thanks,
Jake

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2021-08-04 20:53 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 14:59 [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies Arnd Bergmann
2021-08-02 14:59 ` [Intel-wired-lan] " Arnd Bergmann
2021-08-02 16:49 ` Richard Cochran
2021-08-02 16:49   ` [Intel-wired-lan] " Richard Cochran
2021-08-02 19:54   ` Keller, Jacob E
2021-08-02 19:54     ` [Intel-wired-lan] " Keller, Jacob E
2021-08-02 20:32     ` Arnd Bergmann
2021-08-02 20:32       ` [Intel-wired-lan] " Arnd Bergmann
2021-08-02 20:46       ` Keller, Jacob E
2021-08-02 20:46         ` [Intel-wired-lan] " Keller, Jacob E
2021-08-02 20:59         ` Arnd Bergmann
2021-08-02 20:59           ` [Intel-wired-lan] " Arnd Bergmann
2021-08-02 21:09           ` Keller, Jacob E
2021-08-02 21:09             ` [Intel-wired-lan] " Keller, Jacob E
2021-08-02 21:10           ` Keller, Jacob E
2021-08-02 21:10             ` [Intel-wired-lan] " Keller, Jacob E
2021-08-02 21:22           ` Nicolas Pitre
2021-08-02 21:22             ` [Intel-wired-lan] " Nicolas Pitre
2021-08-03 20:29       ` Arnd Bergmann
2021-08-03 20:29         ` [Intel-wired-lan] " Arnd Bergmann
2021-08-02 23:09     ` Richard Cochran
2021-08-02 23:09       ` [Intel-wired-lan] " Richard Cochran
2021-08-02 23:45       ` Keller, Jacob E
2021-08-02 23:45         ` [Intel-wired-lan] " Keller, Jacob E
2021-08-03  0:03         ` Richard Cochran
2021-08-03  0:03           ` [Intel-wired-lan] " Richard Cochran
2021-08-03  6:59       ` Arnd Bergmann
2021-08-03  6:59         ` [Intel-wired-lan] " Arnd Bergmann
2021-08-03 15:55         ` Richard Cochran
2021-08-03 15:55           ` [Intel-wired-lan] " Richard Cochran
2021-08-03 16:14           ` Richard Cochran
2021-08-03 16:14             ` [Intel-wired-lan] " Richard Cochran
2021-08-03 17:00             ` Arnd Bergmann
2021-08-03 17:00               ` [Intel-wired-lan] " Arnd Bergmann
2021-08-03 17:18               ` Keller, Jacob E
2021-08-03 17:18                 ` [Intel-wired-lan] " Keller, Jacob E
2021-08-03 18:27                 ` Arnd Bergmann
2021-08-03 18:27                   ` [Intel-wired-lan] " Arnd Bergmann
2021-08-03 23:25                   ` Keller, Jacob E
2021-08-03 23:25                     ` [Intel-wired-lan] " Keller, Jacob E
2021-08-04 11:18                   ` Arnd Bergmann
2021-08-04 11:18                     ` [Intel-wired-lan] " Arnd Bergmann
2021-08-03 20:54               ` Richard Cochran
2021-08-03 20:54                 ` [Intel-wired-lan] " Richard Cochran
2021-08-04 20:53                 ` Keller, Jacob E
2021-08-04 20:53                   ` [Intel-wired-lan] " Keller, Jacob E

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.