From: Simon Horman <horms@kernel.org>
To: Karol Kolacinski <karol.kolacinski@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com
Subject: Re: [PATCH v7 iwl-next 1/6] ice: Remove unncecessary ice_is_e8xx() functions
Date: Fri, 23 Aug 2024 21:15:05 +0100 [thread overview]
Message-ID: <20240823201505.GE2164@kernel.org> (raw)
In-Reply-To: <20240820102402.576985-9-karol.kolacinski@intel.com>
On Tue, Aug 20, 2024 at 12:21:48PM +0200, Karol Kolacinski wrote:
> Remove unnecessary ice_is_e8xx() functions and PHY model. Instead, use
> MAC type where applicable.
>
> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Hi Karol,
Sorry for waiting until v7 until raising this. But I feel that this patch
is doing a bit more than what is set out in patch description. So I'd like
to suggest some combination of splitting the patch and enhancing the patch
description.
...
> diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c
> index f02e8ca55375..dd65b2db9856 100644
> --- a/drivers/net/ethernet/intel/ice/ice_gnss.c
> +++ b/drivers/net/ethernet/intel/ice/ice_gnss.c
> @@ -386,27 +386,22 @@ void ice_gnss_exit(struct ice_pf *pf)
> */
> bool ice_gnss_is_gps_present(struct ice_hw *hw)
> {
> +#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
> + int err;
> + u8 data;
> +
> if (!hw->func_caps.ts_func_info.src_tmr_owned)
> return false;
>
> if (!ice_is_gps_in_netlist(hw))
> return false;
>
> -#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
> - if (ice_is_e810t(hw)) {
> - int err;
> - u8 data;
> -
> - err = ice_read_pca9575_reg(hw, ICE_PCA9575_P0_IN, &data);
> - if (err || !!(data & ICE_P0_GNSS_PRSNT_N))
> - return false;
> - } else {
> + err = ice_read_pca9575_reg(hw, ICE_PCA9575_P0_IN, &data);
> + if (err || !!(data & ICE_P0_GNSS_PRSNT_N))
> return false;
> - }
> -#else
> - if (!ice_is_e810t(hw))
> - return false;
> -#endif /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
>
> return true;
> +#else
> + return false;
> +#endif /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
> }
I understand that the above relates to the patch description in the sense
that it removes calls to ice_is_e810t(), a function that is removed
entirely by this patch. But the above is not a simple substitution of one
check for E810T for another. Indeed, it seems far more complex than that.
I think that warrants an explanation, e.g. why is it ok to always return
false if CONFIG_PTP_1588_CLOCK. Perhaps a separate patch is appropriate for
this change.
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
...
> @@ -2759,7 +2766,7 @@ static void ice_ptp_maybe_trigger_tx_interrupt(struct ice_pf *pf)
> bool trigger_oicr = false;
> unsigned int i;
>
> - if (ice_is_e810(hw))
> + if (!pf->ptp.port.tx.has_ready_bitmap)
> return;
>
> if (!ice_pf_src_tmr_owned(pf))
Likewise, this doesn't really match the patch description.
Sure it is a simple change. And yes, after scanning the code,
I agree that has_ready_bitmap is set other than for E810.
But it is not a check against the MAC type as described in the patch
description.
A separate patch would be nice. Or, if not, an enhanced patch description.
> @@ -2898,14 +2905,12 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf)
> */
> ice_ptp_flush_all_tx_tracker(pf);
>
> - if (!ice_is_e810(hw)) {
> - /* Enable quad interrupts */
> - err = ice_ptp_cfg_phy_interrupt(pf, true, 1);
> - if (err)
> - return err;
> + /* Enable quad interrupts */
> + err = ice_ptp_cfg_phy_interrupt(pf, true, 1);
> + if (err)
> + return err;
>
> - ice_ptp_restart_all_phy(pf);
> - }
> + ice_ptp_restart_all_phy(pf);
>
> /* Re-enable all periodic outputs and external timestamp events */
> ice_ptp_enable_all_perout(pf);
Here too. Why is it ok to unconditionally enable quad interrupts?
...
next prev parent reply other threads:[~2024-08-23 20:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 10:21 [PATCH v7 iwl-next 0/6] ice: Implement PTP support for E830 devices Karol Kolacinski
2024-08-20 10:21 ` [PATCH v7 iwl-next 1/6] ice: Remove unncecessary ice_is_e8xx() functions Karol Kolacinski
2024-08-23 20:15 ` Simon Horman [this message]
2024-08-27 11:32 ` Kolacinski, Karol
2024-08-20 10:21 ` [PATCH v7 iwl-next 2/6] ice: Use FIELD_PREP for timestamp values Karol Kolacinski
2024-08-23 20:16 ` Simon Horman
2024-08-20 10:21 ` [PATCH v7 iwl-next 3/6] ice: Implement PTP support for E830 devices Karol Kolacinski
2024-08-23 20:33 ` Simon Horman
2024-08-20 10:21 ` [PATCH v7 iwl-next 4/6] ice: Process TSYN IRQ in a separate function Karol Kolacinski
2024-08-23 20:32 ` Simon Horman
2024-08-20 10:21 ` [PATCH v7 iwl-next 5/6] ice: Add timestamp ready bitmap for E830 products Karol Kolacinski
2024-08-24 13:32 ` Simon Horman
2024-08-20 10:21 ` [PATCH v7 iwl-next 6/6] ice: combine cross timestamp functions for E82x and E830 Karol Kolacinski
2024-08-24 13:24 ` Simon Horman
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=20240823201505.GE2164@kernel.org \
--to=horms@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=karol.kolacinski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.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;
as well as URLs for NNTP newsgroup(s).