public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Petr Oros <poros@redhat.com>
Cc: netdev@vger.kernel.org, ivecera@redhat.com,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH iwl-net] ice: fix missing dpll notification for SW pins
Date: Thu, 19 Feb 2026 09:43:12 +0000	[thread overview]
Message-ID: <aZbbMGERNIYn68W4@horms.kernel.org> (raw)
In-Reply-To: <20260218211414.1411163-1-poros@redhat.com>

On Wed, Feb 18, 2026 at 10:14:14PM +0100, Petr Oros wrote:
> ice_dpll_notify_changes() sends dpll_pin_change_ntf() only for the
> direct CGU input pin stored in d->active_input. Software-controlled
> pins (SMA/U.FL) are separate dpll_pin objects that wrap a backing CGU
> input, but they never receive a change notification. As a result,
> userspace consumers such as synce4l that monitor SMA pins via dpll
> netlink never learn when the pin state transitions (e.g. from
> SELECTABLE to CONNECTED), even though 'dpll pin show' reports the
> correct state on demand.
> 
> When the active input changes, also send dpll_pin_change_ntf() for any
> registered SMA/U.FL input pin whose backing CGU input matches the old
> or new active input.
> 
> Fixes: 2dd5d03c77e2 ("ice: redesign dpll sma/u.fl pins control")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_dpll.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
> index c2ad39bfe177db..6f855fe4c78d62 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dpll.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c
> @@ -2470,13 +2470,17 @@ static u64 ice_generate_clock_id(struct ice_pf *pf)
>   */
>  static void ice_dpll_notify_changes(struct ice_dpll *d)
>  {
> +	struct ice_dplls *dplls = &d->pf->dplls;
>  	bool pin_notified = false;
> +	int i;
>  
>  	if (d->prev_dpll_state != d->dpll_state) {
>  		d->prev_dpll_state = d->dpll_state;
>  		dpll_device_change_ntf(d->dpll);
>  	}
>  	if (d->prev_input != d->active_input) {
> +		struct dpll_pin *old = d->prev_input;

nit: For consistency I think you can reduce the scope of i to this block.
     Or even declare it inside for().

> +
>  		if (d->prev_input)
>  			dpll_pin_change_ntf(d->prev_input);
>  		d->prev_input = d->active_input;
> @@ -2484,6 +2488,20 @@ static void ice_dpll_notify_changes(struct ice_dpll *d)
>  			dpll_pin_change_ntf(d->active_input);
>  			pin_notified = true;
>  		}
> +		for (i = 0; i < ICE_DPLL_PIN_SW_NUM; i++) {
> +			if (dplls->sma[i].pin &&
> +			    dplls->sma[i].direction ==
> +			    DPLL_PIN_DIRECTION_INPUT &&
> +			    (dplls->sma[i].input->pin == d->active_input ||
> +			     dplls->sma[i].input->pin == old))
> +				dpll_pin_change_ntf(dplls->sma[i].pin);
> +			if (dplls->ufl[i].pin &&
> +			    dplls->ufl[i].direction ==
> +			    DPLL_PIN_DIRECTION_INPUT &&
> +			    (dplls->ufl[i].input->pin == d->active_input ||
> +			     dplls->ufl[i].input->pin == old))
> +				dpll_pin_change_ntf(dplls->ufl[i].pin);

The condition above is pretty dense. And repeated.
I wonder if a helper would improve readability here.

> +		}
>  	}
>  	if (d->prev_phase_offset != d->phase_offset) {
>  		d->prev_phase_offset = d->phase_offset;
> -- 
> 2.52.0
> 

      reply	other threads:[~2026-02-19  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 21:14 [PATCH iwl-net] ice: fix missing dpll notification for SW pins Petr Oros
2026-02-19  9:43 ` Simon Horman [this message]

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=aZbbMGERNIYn68W4@horms.kernel.org \
    --to=horms@kernel.org \
    --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=intel-wired-lan@lists.osuosl.org \
    --cc=ivecera@redhat.com \
    --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