Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bnxt_en: Fix build break on non-x86 platforms

Commit c470195b989fe added .getcrosststamp() interface where
the code uses boot_cpu_has() function which is available only
in x86 platforms. This fails the build on any other platform.

Since the interface is going to be supported only on x86 anyway,
we can simply compile out the entire support on non-x86 platforms.

Cover the .getcrosststamp support under CONFIG_X86

Fixes: c470195b989f ("bnxt_en: Add PTP .getcrosststamp() interface to get device/host times")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601111808.WnBJCuWI-lkp@intel.com
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20260113183422.508851-1-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Pavan Chebbi and committed by
Jakub Kicinski
dc634118 48b0126d

+4
+4
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
··· 882 882 } 883 883 } 884 884 885 + #ifdef CONFIG_X86 885 886 static int bnxt_phc_get_syncdevicetime(ktime_t *device, 886 887 struct system_counterval_t *system, 887 888 void *ctx) ··· 925 924 return get_device_system_crosststamp(bnxt_phc_get_syncdevicetime, 926 925 ptp, NULL, xtstamp); 927 926 } 927 + #endif /* CONFIG_X86 */ 928 928 929 929 static const struct ptp_clock_info bnxt_ptp_caps = { 930 930 .owner = THIS_MODULE, ··· 1139 1137 if (bnxt_ptp_pps_init(bp)) 1140 1138 netdev_err(bp->dev, "1pps not initialized, continuing without 1pps support\n"); 1141 1139 } 1140 + #ifdef CONFIG_X86 1142 1141 if ((bp->fw_cap & BNXT_FW_CAP_PTP_PTM) && pcie_ptm_enabled(bp->pdev) && 1143 1142 boot_cpu_has(X86_FEATURE_ART)) 1144 1143 ptp->ptp_info.getcrosststamp = bnxt_ptp_getcrosststamp; 1144 + #endif /* CONFIG_X86 */ 1145 1145 1146 1146 ptp->ptp_clock = ptp_clock_register(&ptp->ptp_info, &bp->pdev->dev); 1147 1147 if (IS_ERR(ptp->ptp_clock)) {