Re: [tip:timers/core] ptp_clock: Allow for it to be optional

From: Arnd Bergmann
Date: Thu Nov 17 2016 - 12:02:02 EST


On Wednesday, November 16, 2016 12:32:03 AM CET tip-bot for Nicolas Pitre wrote:
> Commit-ID: d1cbfd771ce8297fa11e89f315392de6056a2181
> Gitweb: http://git.kernel.org/tip/d1cbfd771ce8297fa11e89f315392de6056a2181
> Author: Nicolas Pitre <nicolas.pitre@xxxxxxxxxx>
> AuthorDate: Fri, 11 Nov 2016 00:10:07 -0500
> Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> CommitDate: Wed, 16 Nov 2016 09:26:34 +0100
>
> ptp_clock: Allow for it to be optional
>
> In order to break the hard dependency between the PTP clock subsystem and
> ethernet drivers capable of being clock providers, this patch provides
> simple PTP stub functions to allow linkage of those drivers into the
> kernel even when the PTP subsystem is configured out. Drivers must be
> ready to accept NULL from ptp_clock_register() in that case.
>
> And to make it possible for PTP to be configured out, the select statement
> in those driver's Kconfig menu entries is converted to the new "imply"
> statement. This way the PTP subsystem may have Kconfig dependencies of
> its own, such as POSIX_TIMERS, without having to make those ethernet
> drivers unavailable if POSIX timers are cconfigured out. And when support
> for POSIX timers is selected again then the default config option for PTP
> clock support will automatically be adjusted accordingly.
>
> The pch_gbe driver is a bit special as it relies on extra code in
> drivers/ptp/ptp_pch.c. Therefore we let the make process descend into
> drivers/ptp/ even if PTP_1588_CLOCK is unselected.
>
> Signed-off-by: Nicolas Pitre <nico@xxxxxxxxxx>
> Acked-by: Richard Cochran <richardcochran@xxxxxxxxx>
> Acked-by: Edward Cree <ecree@xxxxxxxxxxxxxx>
> Acked-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Acked-by: John Stultz <john.stultz@xxxxxxxxxx>
> Reviewed-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
> Cc: Paul Bolle <pebolle@xxxxxxxxxx>
> Cc: linux-kbuild@xxxxxxxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx
> Cc: Michal Marek <mmarek@xxxxxxxx>
> Link: http://lkml.kernel.org/r/1478841010-28605-4-git-send-email-nicolas.pitre@xxxxxxxxxx
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Just for reference to anyone looking for the failure:

drivers/net/ethernet/amd/Kconfig:183: syntax error
drivers/net/ethernet/amd/Kconfig:182: unknown option "imply"
drivers/net/ethernet/adi/Kconfig:62: syntax error
drivers/net/ethernet/adi/Kconfig:61: unknown option "imply"
drivers/net/ethernet/broadcom/Kconfig:114: syntax error
drivers/net/ethernet/broadcom/Kconfig:113: unknown option "imply"
drivers/net/ethernet/broadcom/Kconfig:124: syntax error
drivers/net/ethernet/broadcom/Kconfig:123: unknown option "imply"
drivers/net/ethernet/cavium/Kconfig:57: syntax error
drivers/net/ethernet/cavium/Kconfig:56: unknown option "imply"
drivers/net/ethernet/freescale/Kconfig:29: syntax error
drivers/net/ethernet/freescale/Kconfig:28: unknown option "imply"
drivers/net/ethernet/intel/Kconfig:62: syntax error
drivers/net/ethernet/intel/Kconfig:61: unknown option "imply"
drivers/net/ethernet/intel/Kconfig:87: syntax error
drivers/net/ethernet/intel/Kconfig:86: unknown option "imply"
drivers/net/ethernet/intel/Kconfig:160: syntax error
drivers/net/ethernet/intel/Kconfig:159: unknown option "imply"
drivers/net/ethernet/intel/Kconfig:217: syntax error
drivers/net/ethernet/intel/Kconfig:216: unknown option "imply"
drivers/net/ethernet/intel/Kconfig:268: syntax error
drivers/net/ethernet/intel/Kconfig:267: unknown option "imply"
drivers/net/ethernet/mellanox/mlx4/Kconfig:11: syntax error
drivers/net/ethernet/mellanox/mlx4/Kconfig:10: unknown option "imply"
drivers/net/ethernet/mellanox/mlx5/core/Kconfig:18: syntax error
drivers/net/ethernet/mellanox/mlx5/core/Kconfig:17: unknown option "imply"
drivers/net/ethernet/renesas/Kconfig:41: syntax error
drivers/net/ethernet/renesas/Kconfig:40: unknown option "imply"
drivers/net/ethernet/samsung/Kconfig:25: syntax error
drivers/net/ethernet/samsung/Kconfig:24: unknown option "imply"
drivers/net/ethernet/sfc/Kconfig:9: syntax error
drivers/net/ethernet/sfc/Kconfig:8: unknown option "imply"
drivers/net/ethernet/stmicro/stmmac/Kconfig:8: syntax error
drivers/net/ethernet/stmicro/stmmac/Kconfig:7: unknown option "imply"
drivers/net/ethernet/ti/Kconfig:80: syntax error
drivers/net/ethernet/ti/Kconfig:79: unknown option "imply"
drivers/net/ethernet/tile/Kconfig:13: syntax error
drivers/net/ethernet/tile/Kconfig:12: unknown option "imply"
drivers/ptp/Kconfig:80: syntax error
drivers/ptp/Kconfig:79: unknown option "imply"

It was introduced in linux-next today, but it only happens if you
don't do a 'make clean' or 'make mrproper'. Apparently patch 1
of the series changes kconfig but that change does not trigger
a rebuild of the kconfig binary for me. After removing kconfig
from the object directory, it works again.

I also ran into a problem with CONFIG_TIMERFD enabled but
CONFIG_POSIX_TIMERS turned off. This could be related to some
of my own patches though, haven't tried if that happens
with just your patches applied.

Arnd