1 From fba2153a200716c1fec1eafda7356bb347589efb Mon Sep 17 00:00:00 2001
2 From: Randy Dunlap <rdunlap@infradead.org>
3 Date: Thu, 25 Nov 2021 18:33:16 -0800
4 Subject: [PATCH] hv: utils: add PTP_1588_CLOCK to Kconfig to fix build
6 The hyperv utilities use PTP clock interfaces and should depend a
7 a kconfig symbol such that they will be built as a loadable module or
8 builtin so that linker errors do not happen.
10 Prevents these build errors:
12 ld: drivers/hv/hv_util.o: in function `hv_timesync_deinit':
13 hv_util.c:(.text+0x37d): undefined reference to `ptp_clock_unregister'
14 ld: drivers/hv/hv_util.o: in function `hv_timesync_init':
15 hv_util.c:(.text+0x738): undefined reference to `ptp_clock_register'
17 References: https://lore.kernel.org/stable/20220328093115.7486-1-ynezz@true.cz/T/#u
18 Fixes: 3716a49a81ba ("hv_utils: implement Hyper-V PTP source")
19 Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
20 Reported-by: kernel test robot <lkp@intel.com>
21 Cc: Arnd Bergmann <arnd@arndb.de>
22 Cc: "K. Y. Srinivasan" <kys@microsoft.com>
23 Cc: Haiyang Zhang <haiyangz@microsoft.com>
24 Cc: Stephen Hemminger <sthemmin@microsoft.com>
25 Cc: Wei Liu <wei.liu@kernel.org>
26 Cc: Dexuan Cui <decui@microsoft.com>
27 Cc: linux-hyperv@vger.kernel.org
28 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 Reviewed-by: Michael Kelley <mikelley@microsoft.com>
30 Link: https://lore.kernel.org/r/20211126023316.25184-1-rdunlap@infradead.org
31 Signed-off-by: Wei Liu <wei.liu@kernel.org>
32 (cherry picked from commit 1dc2f2b81a6a9895da59f3915760f6c0c3074492)
34 drivers/hv/Kconfig | 1 +
35 1 file changed, 1 insertion(+)
37 --- a/drivers/hv/Kconfig
38 +++ b/drivers/hv/Kconfig
39 @@ -18,6 +18,7 @@ config HYPERV_TIMER
41 tristate "Microsoft Hyper-V Utilities driver"
42 depends on HYPERV && CONNECTOR && NLS
43 + depends on PTP_1588_CLOCK_OPTIONAL
45 Select this option to enable the Hyper-V Utilities.