Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
	przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org,
	arkadiusz.kubalewski@intel.com, alexander.nowlin@intel.com,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] ice: fix DPLL registration on boards without the SMA clock mux
Date: Thu, 03 Dec 2026 21:11:21 +0000	[thread overview]
Message-ID: <179633228142.3146.7257777743538378508@kernel.org> (raw)
In-Reply-To: <20261202211046.3007751-2-poros@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The fix uses ICE_F_SMA_CTRL as proof that the PCA9575 SMA/U.FL
  expander exists, but that flag and the expander lookup come from…
- [Low] The patch hides the U.FL wrapper pins on boards without the clock
  mux (`pin->hidden = !ice_is_feature_supported(pf, ICE_F_SMA_CTRL)` in…

--

ice: fix DPLL registration on boards without the SMA clock mux

This commit keys the software controlled SMA/U.FL pins on ICE_F_SMA_CTRL.
Boards that have a CGU but no PCA9575 clock mux then no longer fail DPLL
registration with -ENXIO. Without the mux, the SMA pins stay fixed inputs
without DIRECTION_CAN_CHANGE, the U.FL pins are hidden, and the SMA control
register initialization is skipped.

> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
> index 5148e419f49a0..4410dbd2b231b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dpll.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c

[ ... ]

> @@ -4889,6 +4899,7 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf)
>  		pin->idx = i;
>  		pin->prop.type = DPLL_PIN_TYPE_EXT;
>  		pin->prop.capabilities = caps;
> +		pin->hidden = !ice_is_feature_supported(pf, ICE_F_SMA_CTRL);

[Severity: Low]

Now that the U.FL pins are hidden, can the notification helpers still send
change notifications for them?

ice_dpll_get_pins() still calls dpll_pin_get() for hidden entries, so
ufl[i].pin is non-NULL. ice_dpll_register_pins() skips them, though:

    if (!pins[i].hidden) {
        ret = dpll_pin_register(dpll, pins[i].pin, ops, &pins[i]);

ice_dpll_sw_pin_notify_peer() checks only the pointer. On a board without
the mux, every SMA state or direction set then notifies the unregistered
U.FL peer:

    if (peer->pin)
        __dpll_pin_change_ntf(peer->pin);

ice_dpll_pin_ntf() has the same problem. ufl[1].input is the same CGU input
that backs SMA2:

    if (dplls->ufl[i].pin && dplls->ufl[i].input &&
        dplls->ufl[i].input->pin == pin)
        dpll_pin_change_ntf(dplls->ufl[i].pin);

So every active input or phase offset change on that CGU input also
notifies U.FL2.

The kernel-doc of ice_dpll_pin_ntf() says it notifies "any registered
SMA/U.FL pin". __dpll_pin_change_ntf() documents its argument as a
"registered pin pointer".

For the unregistered pin, dpll_pin_notify(DPLL_PIN_CHANGED) still runs.
dpll_pin_event_send() returns -ENODEV, so no netlink message goes out and
nothing is visible today.

Should both helpers also check !hidden, as the register and unregister
helpers already do?

ice_dpll_pin_ntf() already notifies the hidden CGU inputs behind the SMA
wrappers, so part of this predates the patch. The U.FL case is new,
though, and the next patch in the series does not change these helpers.

>  		pin->pf = pf;
>  		pin->prop.board_label = ice_dpll_sw_pin_ufl[i];
>  		if (i == ICE_DPLL_PIN_SW_1_IDX) {
> @@ -4918,6 +4929,9 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf)
>  		ice_dpll_phase_range_set(&pin->prop.phase_range, phase_adj_max);
>  	}
>  
> +	if (!ice_is_feature_supported(pf, ICE_F_SMA_CTRL))
> +		return 0;
> +
>  	/* Initialize the SMA control register to a known-good default state.
>  	 * Without this write the PCA9575 GPIO expander retains its power-on
>  	 * default (all outputs high) which makes all SW pins appear inactive.

[Severity: Medium]

Does ICE_F_SMA_CTRL guarantee that ice_read_sma_ctrl() will find the
PCA9575 expander here?

ice_init_feature_support() sets the flag from a CLK_MUX node check. It does
this for all six E810 device IDs, including the BACKPLANE and XXV variants:

    if (ice_is_clock_mux_in_netlist(&pf->hw))
        ice_set_feature_support(pf, ICE_F_SMA_CTRL);

ice_get_pca9575_handle() looks up a different node: GPIO_CTRL at an index
that depends on the device ID. It checks for the PCA9575 part number and
rejects any other device ID outright:

    if (hw->device_id == ICE_DEV_ID_E810C_SFP)
        idx = SW_PCA9575_SFP_TOPO_IDX;
    else if (hw->device_id == ICE_DEV_ID_E810C_QSFP)
        idx = SW_PCA9575_QSFP_TOPO_IDX;
    else
        return -ENXIO;

The netlist could report a clock mux while the expander is missing, is not
a PCA9575, or sits at another index. The device could also be a
BACKPLANE/XXV variant with a CGU. In any of those cases, wouldn't the
-ENXIO still propagate up this chain?

ice_dpll_init_info()
  ice_dpll_init_pins_info(pf, ICE_DPLL_PIN_TYPE_SOFTWARE)
    ice_dpll_init_info_sw_pins()
      ice_read_sma_ctrl()
        ice_get_pca9575_handle() -> -ENXIO

That would abort the whole DPLL registration with "DPLLs init failure
err:-6" again.

This is still true at the end of the series. The follow-up commit "ice:
skip the SW pin description on boards with generic DPLL pins" still sends
generic boards to init_sma_ctrl. A BACKPLANE/XXV board has no static CGU
pin table, so it takes that path. If ICE_F_SMA_CTRL is set, it hits the
same read.

There is some history here. The original SMA support in commit
325b2064d00a ("ice: Implement support for SMA and U.FL on E810-T") cleared
ICE_F_SMA_CTRL when !ice_is_pca9575_present(). ice_ptp_setup_sma_pins_e810t()
also treated SMA read failures as non-fatal.

Could -ENXIO from the expander lookup be treated as "no mux"? Another option
is to probe the expander once when the feature flag is set. Either would
avoid relying on the firmware always reporting both nodes together.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202211046.3007751-1-poros%40redhat.com

  reply	other threads:[~2026-12-03 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 21:10 [PATCH net v2 0/2] ice: DPLL init fixes for E810 timing boards Petr Oros
2026-12-02 21:10 ` [PATCH net v2 1/2] ice: fix DPLL registration on boards without the SMA clock mux Petr Oros
2026-12-03 21:11   ` netdev-bot+sashiko [this message]
2026-12-02 21:10 ` [PATCH net v2 2/2] ice: skip the SW pin description on boards with generic DPLL pins Petr Oros

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=179633228142.3146.7257777743538378508@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alexander.nowlin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --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