From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Richard Cochran <richardcochran@gmail.com>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Michal Michalik <michal.michalik@intel.com>,
Milena Olech <milena.olech@intel.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: [PATCH net-next 2/3] ice: fix undefined references from DPLL code when !CONFIG_PTP_1588_CLOCK
Date: Wed, 20 Sep 2023 20:07:44 +0200 [thread overview]
Message-ID: <20230920180745.1607563-3-aleksander.lobakin@intel.com> (raw)
In-Reply-To: <20230920180745.1607563-1-aleksander.lobakin@intel.com>
DPLL code in ice unconditionally calls several PTP functions which are
only built when CONFIG_PTP_1588_CLOCK is set. This throws a good bunch
of link errors:
ERROR: modpost: "ice_cgu_get_pin_name"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
ERROR: modpost: "ice_get_cgu_state"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
OR: modpost: "ice_is_cgu_present"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
ERROR: modpost: "ice_get_cgu_rclk_pin_info"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
ERROR: modpost: "ice_cgu_get_pin_type"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
ERROR: modpost: "ice_cgu_get_pin_freq_supp"
[drivers/net/ethernet/intel/ice/ice.ko] undefined!
ice_dpll_{,de}init() can be only called at runtime when the
corresponding feature flags are set, which is not the case when PTP
support is not compiled. However, the linker has no clue about this.
Compile DPLL code only when CONFIG_PTP_1588_CLOCK is enabled and guard
the mentioned init/deinit function calls, so that ice_dpll.o is only
referred when it gets compiled.
Note that ideally ice_is_feature_supported() needs to check for
compile-time flags first to be able to handle this without any
additional call guards, and we may want to do that in the future.
Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309191214.TaYEct4H-lkp@intel.com
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
drivers/net/ethernet/intel/ice/Makefile | 5 ++---
drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/Makefile b/drivers/net/ethernet/intel/ice/Makefile
index 00806ddf5bf0..16f96d5210d8 100644
--- a/drivers/net/ethernet/intel/ice/Makefile
+++ b/drivers/net/ethernet/intel/ice/Makefile
@@ -34,8 +34,7 @@ ice-y := ice_main.o \
ice_lag.o \
ice_ethtool.o \
ice_repr.o \
- ice_tc_lib.o \
- ice_dpll.o
+ ice_tc_lib.o
ice-$(CONFIG_PCI_IOV) += \
ice_sriov.o \
ice_virtchnl.o \
@@ -44,7 +43,7 @@ ice-$(CONFIG_PCI_IOV) += \
ice_vf_mbx.o \
ice_vf_vsi_vlan_ops.o \
ice_vf_lib.o
-ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o
+ice-$(CONFIG_PTP_1588_CLOCK) += ice_dpll.o ice_ptp.o ice_ptp_hw.o
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index e22f41fea8db..9b48918dcdb7 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4665,8 +4665,9 @@ static void ice_init_features(struct ice_pf *pf)
if (ice_is_feature_supported(pf, ICE_F_GNSS))
ice_gnss_init(pf);
- if (ice_is_feature_supported(pf, ICE_F_CGU) ||
- ice_is_feature_supported(pf, ICE_F_PHY_RCLK))
+ if (IS_ENABLED(CONFIG_PTP_1588_CLOCK) &&
+ (ice_is_feature_supported(pf, ICE_F_CGU) ||
+ ice_is_feature_supported(pf, ICE_F_PHY_RCLK)))
ice_dpll_init(pf);
/* Note: Flow director init failure is non-fatal to load */
@@ -4695,7 +4696,8 @@ static void ice_deinit_features(struct ice_pf *pf)
ice_gnss_exit(pf);
if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags))
ice_ptp_release(pf);
- if (test_bit(ICE_FLAG_DPLL, pf->flags))
+ if (IS_ENABLED(CONFIG_PTP_1588_CLOCK) &&
+ test_bit(ICE_FLAG_DPLL, pf->flags))
ice_dpll_deinit(pf);
}
--
2.41.0
next prev parent reply other threads:[~2023-09-20 18:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 18:07 [PATCH net-next 0/3] net/intel: fix link-time undefined reference errors Alexander Lobakin
2023-09-20 18:07 ` [PATCH net-next 1/3] ice: fix undefined references to ice_is_*() when !CONFIG_PTP_1588_CLOCK Alexander Lobakin
2023-09-20 18:07 ` Alexander Lobakin [this message]
2023-09-21 23:58 ` [PATCH net-next 2/3] ice: fix undefined references from DPLL code " Vadim Fedorenko
2023-09-22 13:58 ` Alexander Lobakin
2023-09-20 18:07 ` [PATCH net-next 3/3] idpf: fix undefined reference to tcp_gro_complete() when !CONFIG_INET Alexander Lobakin
2023-09-20 21:30 ` Randy Dunlap
2023-09-21 0:04 ` [Intel-wired-lan] " Jacob Keller
2023-09-21 1:30 ` Randy Dunlap
2023-10-12 15:47 ` Randy Dunlap
2023-10-12 16:13 ` Alexander Lobakin
2023-10-12 18:34 ` Keller, Jacob E
2023-10-12 23:31 ` Jakub Kicinski
2023-10-13 17:16 ` Jacob Keller
2023-09-21 8:52 ` [Intel-wired-lan] [PATCH net-next 0/3] net/intel: fix link-time undefined reference errors Przemek Kitszel
[not found] ` <f05c2a5b-d434-5edc-828f-4b87049d01fe@intel.com>
2023-09-21 13:04 ` Alexander Lobakin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230920180745.1607563-3-aleksander.lobakin@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=michal.michalik@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®