Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: <intel-wired-lan@osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next 1/3] ice: fix undefined references to ice_is_*() when !CONFIG_PTP_1588_CLOCK
Date: Wed, 20 Sep 2023 16:20:06 -0700	[thread overview]
Message-ID: <3bbaaa09-600f-ed2d-d596-ac994efe1b04@intel.com> (raw)
In-Reply-To: <20230920180745.1607563-2-aleksander.lobakin@intel.com>



On 9/20/2023 11:07 AM, Alexander Lobakin wrote:
> Starting the cited commit, ice_lib.c unconditionally refers to three
> functions compiled only when CONFIG_PTP_1588_CLOCK is set (as they're
> located in ice_ptp_hw.c):
> 
> ERROR: modpost: "ice_is_clock_mux_present_e810t"
> [drivers/net/ethernet/intel/ice/ice.ko] undefined!
> ERROR: modpost: "ice_is_phy_rclk_present"
> [drivers/net/ethernet/intel/ice/ice.ko] undefined!
> ERROR: modpost: "ice_is_cgu_present"
> [drivers/net/ethernet/intel/ice/ice.ko] undefined!
> 
> These three are HW feature tests and it is safe to stub them as
> `return false` when PTP support is disabled.
> 
> Fixes: 8a3a565ff210 ("ice: add admin commands to access cgu configuration")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202309181001.G72eBLpj-lkp@intel.com
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---

I posted a version of these functions in ice_common.c quite some time
ago at which was sent as a series at:

https://lore.kernel.org/netdev/20230918212814.435688-1-anthony.l.nguyen@intel.com/

This version places the functions in ice_common.c and avoids the need
for stubs (plus lets us make another function static).

I posted the fix up to bring us to that method here:

https://lore.kernel.org/intel-wired-lan/20230919233435.518620-1-jacob.e.keller@intel.com/

I would prefer to take my version, as I think its better at the end of
the day than the stubs.

>  drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 25 ++++++++++++++++++++-
>  1 file changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h
> index 6f277e7b06b9..405a72864dc7 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h
> @@ -271,10 +271,33 @@ int ice_read_sma_ctrl_e810t(struct ice_hw *hw, u8 *data);
>  int ice_write_sma_ctrl_e810t(struct ice_hw *hw, u8 data);
>  int ice_read_pca9575_reg_e810t(struct ice_hw *hw, u8 offset, u8 *data);
>  bool ice_is_pca9575_present(struct ice_hw *hw);
> +
> +#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
> +
>  bool ice_is_phy_rclk_present(struct ice_hw *hw);
>  bool ice_is_clock_mux_present_e810t(struct ice_hw *hw);
> -int ice_get_pf_c827_idx(struct ice_hw *hw, u8 *idx);
>  bool ice_is_cgu_present(struct ice_hw *hw);
> +
> +#else /* !CONFIG_PTP_1588_CLOCK */
> +
> +static inline bool ice_is_phy_rclk_present(const struct ice_hw *hw)
> +{
> +	return false;
> +}
> +
> +static inline bool ice_is_clock_mux_present_e810t(const struct ice_hw *hw)
> +{
> +	return false;
> +}
> +
> +static inline bool ice_is_cgu_present(const struct ice_hw *hw)
> +{
> +	return false;
> +}
> +
> +#endif /* !CONFIG_PTP_1588_CLOCK */
> +
> +int ice_get_pf_c827_idx(struct ice_hw *hw, u8 *idx);
>  enum dpll_pin_type ice_cgu_get_pin_type(struct ice_hw *hw, u8 pin, bool input);
>  struct dpll_pin_frequency *
>  ice_cgu_get_pin_freq_supp(struct ice_hw *hw, u8 pin, bool input, u8 *num);
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-09-20 23:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 18:07 [Intel-wired-lan] [PATCH net-next 0/3] net/intel: fix link-time undefined reference errors Alexander Lobakin
2023-09-20 18:07 ` [Intel-wired-lan] [PATCH net-next 1/3] ice: fix undefined references to ice_is_*() when !CONFIG_PTP_1588_CLOCK Alexander Lobakin
2023-09-20 23:20   ` Jacob Keller [this message]
2023-09-20 18:07 ` [Intel-wired-lan] [PATCH net-next 2/3] ice: fix undefined references from DPLL code " Alexander Lobakin
2023-09-20 23:22   ` Jacob Keller
2023-09-21 23:58   ` Vadim Fedorenko
2023-09-22 13:58     ` Alexander Lobakin
2023-09-20 18:07 ` [Intel-wired-lan] [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     ` 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-20 23:24   ` Jacob Keller
2023-09-20 23:31 ` [Intel-wired-lan] [PATCH net-next 0/3] net/intel: fix link-time undefined reference errors Jacob Keller
2023-09-21 12:52   ` Alexander Lobakin
2023-09-21 13:04   ` Alexander Lobakin
2023-09-21  8:52 ` Przemek Kitszel

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=3bbaaa09-600f-ed2d-d596-ac994efe1b04@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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