🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26627

Re: [PATCH net-next 2/4] ice: describe generic DPLL pins from firmware pin classification

#26627
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 00:24
165 lines
14083 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 0

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 patch deletes the `pin_num > ARRAY_SIZE(labels)` (16)
  bound from ice_dpll_init_info_pins_generic()…
- [Medium] In the generic path, two independent sources now decide
  whether an input is a recovered-clock parent.

--

ice: describe generic DPLL pins from firmware pin classification

This commit changes how generic DPLL pins are described. Their names,
types and supported frequencies now come from the classification
returned by firmware in Get CGU Input Config, instead of the shared
numeric labels "0" to "15". Inputs become GNSS-<n>, RCLK-<n>, EXT-<n> or
IN-<n>, outputs become OUT-<n>, and the 16 pin limit in the generic path
is removed.

> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
> index 1c853fd4a6bda..889d0e40b8bf4 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dpll.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c

[ ... ]

> +static int
> +ice_dpll_init_info_pin_generic_input(struct ice_pf *pf, struct ice_dpll_pin *pin)
> +{
> +	u8 type, caps, num;
> +	const char *kind;
> +	int ret;
> +
> +	ret = ice_aq_get_input_pin_cfg(&pf->hw, pin->idx, NULL, &type, &caps,
> +				       NULL, NULL, NULL);
> +	if (ret)
> +		return ret;
> +
> +	if (type & ICE_AQC_GET_CGU_IN_CFG_TYPE_GPS) {
> +		pin->prop.type = DPLL_PIN_TYPE_GNSS;
> +		kind = "GNSS";
> +	} else if (type & ICE_AQC_GET_CGU_IN_CFG_TYPE_PHY) {
> +		pin->prop.type = DPLL_PIN_TYPE_MUX;
> +		kind = "RCLK";
> +	} else if (type & ICE_AQC_GET_CGU_IN_CFG_TYPE_EXTERNAL) {
> +		pin->prop.type = DPLL_PIN_TYPE_EXT;
> +		kind = "EXT";
> +		if (caps & ICE_AQC_GET_CGU_IN_CFG_FLG1_ANYFREQ)
> +			caps |= ICE_AQC_GET_CGU_IN_CFG_FLG1_1PPS_SUPP |
> +				ICE_AQC_GET_CGU_IN_CFG_FLG1_10MHZ_SUPP;
> +	} else {
> +		pin->prop.type = pin->freq == ICE_DPLL_PIN_GEN_RCLK_FREQ ?
> +				 DPLL_PIN_TYPE_MUX : DPLL_PIN_TYPE_EXT;
> +		kind = "IN";
> +	}

[Severity: Medium]

In the generic path, can this classification disagree with the recovered
clock parent indexes that the driver works out separately?

ice_get_cgu_rclk_pin_info() in ice_ptp_hw.c still hardcodes the RCLK
parent inputs based on the device ID. On E810C, for example:

    *base_idx = E810T_CGU_INPUT_C827(phy_idx, ICE_RCLKA_PIN);

Those become pf->dplls.rclk.parent_idx[i] = base_rclk_idx + i.

Later, ice_dpll_init_pin_common() registers the RCLK pin on top of
inputs[parent_idx[i]]:

    ret = dpll_pin_on_pin_register(parent->pin, pin->pin, ops, pin);

dpll_pin_on_pin_register() requires the parent to be a MUX:

    if (WARN_ON(parent->prop.type != DPLL_PIN_TYPE_MUX))
        return -EINVAL;

With this change, the ICE_DPLL_PIN_GEN_RCLK_FREQ rule only applies when
firmware sets no kind bit. Suppose firmware reports GPS or EXTERNAL for an
input at one of the hardcoded RCLK indexes. That input then becomes GNSS
or EXT even if it runs at the RCLK frequency, and before this patch it
would have been MUX.

Would that trigger the WARN_ON and fail ice_dpll_init_rclk_pin()? That
failure would unwind ice_dpll_init_pins() and leave the PF without DPLL
support.

Should the firmware type be checked against rclk.parent_idx[], or should
the known parent indexes always be MUX?

> +	snprintf(pin->label, sizeof(pin->label), "%s-%u", kind, pin->idx);
> +	pin->prop.board_label = pin->label;

[ ... ]

> @@ -4756,12 +4803,9 @@ static int ice_dpll_init_info_pins_generic(struct ice_pf *pf, bool input)
>  		phase_adj_max = pf->dplls.output_phase_adj_max;
>  		pin_type = ICE_DPLL_PIN_TYPE_OUTPUT;
>  	}
> -	if (pin_num > ARRAY_SIZE(labels))
> -		return ret;
>  
>  	for (i = 0; i < pin_num; i++) {

[Severity: Medium]

The commit message says the 16 pin limit "existed only because of the
static label table". Is that accurate?

ice_dpll_pps_update_phase_offsets() uses a fixed size stack array but
loops over the input count reported by firmware:

    struct ice_cgu_input_measure meas[ICE_DPLL_INPUT_REF_NUM];
    ...
    ret = ice_aq_get_cgu_input_pin_measure(&pf->hw, DPLL_TYPE_PPS, meas,
                                           ARRAY_SIZE(meas));
    ...
    for (i = 0; i < pf->dplls.num_inputs; i++) {
        ...
            tmp = meas[i].phase_offset[j];
        ...
            *phase_offset_pins_updated |= (1 << i);

ICE_DPLL_INPUT_REF_NUM is 10. pf->dplls.num_inputs is taken directly from
abilities.num_inputs, which is a u8. Without the cap, the generic path
now accepts up to 255 inputs.

If the PPS phase offset monitor is enabled, can ice_dpll_periodic_work()
read past the end of meas[] here? The stack contents would land in
p->phase_offset, and ice_dpll_phase_offset_get() reports that value to
userspace.

The overread was already possible with 11 to 16 inputs before this
patch, but removing the cap makes it much larger.

For i >= 31, 1 << i is also a signed int shift with undefined behaviour.
Separately, a u32 mask can't represent inputs at index 32 and above.
ice_dpll_pins_notify_mask() does:

    if (phase_offset_ntf_mask & BIT(i))

so those pins would never get notified.

Should the generic path keep an upper bound tied to
ICE_DPLL_INPUT_REF_NUM, or should these users be bounded on their own?

>  		pins[i].idx = i;
> -		pins[i].prop.board_label = labels[i];
>  		ice_dpll_phase_range_set(&pins[i].prop.phase_range,
>  					 phase_adj_max);

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203002248.348492-1-anthony.l.nguyen%40intel.com
Technical Details
Message-ID: <179634387333.3146.378020491996477944@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376932-linux-kernel-netdev=dewy.ru
References: <20261203002248.348492-3-anthony.l.nguyen@intel.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376932-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/4] ice: describe generic DPLL pins from
 firmware pin classification
Date: Fri, 04 Dec 2026 00:24:33 +0000
Organization: Usenet Network
Message-ID: <179634387333.3146.378020491996477944@kernel.org>
References: <20261203002248.348492-3-anthony.l.nguyen@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2638643"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pMjBrH18IkJV4Nuvo1fG65wcpM4= sha256:ng9VhjRV/y+2cfBa4kDxR2/hJ86QynnemBalM3TE0k0=
	sha1:opVY+KDwk/Y5bve6VEsx0JkPt8o= sha256:8CF8526G9VpDv/lrPyMFTg2UMfe6SOMle5jbdhldYyE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 10740117A7E; Fri,  4 Dec 2026 03:24:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.639
X-Spam-Status: No, score=-3.639 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id B9rlXmm5gQi6;
	Fri,  4 Dec 2026 03:24:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376932-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A742E117A7F; Fri,  4 Dec 2026 03:24:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id D2A0725951; Fri,  4 Dec 2026 00:24:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796343875;
	b=kMVPFlET6An8AA8VJGjnQtgkWYDyJsH40IoEFwV2vE2vb0m3lwirppKPGRcBouWpRbbF
	 Yywbhll+WFFFyFgKVd37Qg3JRFTA4tsP5zErRcqOAgHX0pUL4rrVhQxjSYg7nex4TJAEc
	 pOx7ej2phxY/8fNRDzVvpssCSs+lsXHP3Rh9ZcMiUTREo4hsGK++ZVIuOlM6Kh3k6SH8w
	 cgslqdkyr5YpMiAtdfs1VnFhJslVLF2zNH9IRBq62WCqOG29nOcIIsRS35vVD2xe4Tp99
	 92e64sUfgCc1Gimoko5sfAnY9zyAHXsCssvNHEJslaCTEyHOZCOtTi1Y81x3tp6Dncg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796343875;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=WxfSZYFD+a+e4i7WtO1t5jHh4TOqXsCM0mNVt9wNpOs=;
	b=H2kwUP0Dx0O0JiDgKCXOs0kwpSxmL0OkNsTaalFr6GNr9mhXOdy7Ygng3bX8rJiSV3zX
	 MDp6RTJAfzuJfgqxR5QmgMY1oMscF6LkeBO1IfpJsmrNxTz0npCbCIcHp80gIzB8S7Dbu
	 RCcqG233dqtzeigI8ac969nJpyZzbxMBCdUxvEzZWj8nS3H3K3P1WwBq4Hg0cNSOTpN2c
	 22xAFwKykK052PWzeohfuR1qfWeTJQufIGxQe2ujU6yr/mREXlxr8PEYi/DAIoEBNTTkw
	 RWIKzwW//806jhXTLRVlQmZ5/6DgHslX9I/3GKZYEIwPqohEjwiMYlSfr8BIy5G3pzw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Sr//38Ot";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A68DC606A330;
	Fri,  4 Dec 2026 00:24:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Sr//38Ot
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796343874;
	b=LDAqPsORlw/52+jtqm8p+l8yxDRAAsN4VH+cfWF3LRPTl+lBXO3TiYkYRwosF+Yh6yD5
	 4fkJJ0DcDkwYh1eRcknPb1bsA7KF18wCuVC+8zJPbiuPEYdv/s6jDcG/ZZ1GmImrnfwzS
	 3L+Eoa3/Popq4LeXQJawZ2mEOug3GUTM4Cu6SpMmQRqyPPiIqBB+J1EgKQVcQYmDJOb+V
	 Btir14OwZigXRvDAq8gD6hEMyc13Q456V4mSPXq9VLZl+xzseXlqVs//NSOyOeo4ug/e/
	 F5UVEoxNofMmQdh4hlJfa7GjhC7Y6BzWMEGScCnnL2Wy8tw7sJUA6yP0oMeWrW0VIyg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796343874;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=WxfSZYFD+a+e4i7WtO1t5jHh4TOqXsCM0mNVt9wNpOs=;
	b=f1aDxcbolX5toFC7w973RlgqRK/w9oVsdgGf5ox7XHlhwcWZK3nfYBjZjIf+Hy+Ru0pJ
	 PX3tDSn5orLM3+qWVQwNfqxamFdYLA/EoR/jTblHrKkdRJtFKdvC59oRm9WUxA1CfOpiE
	 KgcR2adn0WpuoM8pDjTVKehcfNf6+srvK0GrLfXeciFCR4kwvg4giv3sJEF6VycmaNx+D
	 GDw0daRTmHrowVYnhRZg1NB1gyvnXuaHdLFtNeG39H5zZGYoTED8sshmOUUrHc6xvTCfe
	 L+v8KznKNa9lAEPwiQs4gcDheyEo+32vfym1JDuJC16e5B82SumRGmfnq69KipH6G7w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Sr//38Ot";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6665606A336
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 00:24:34 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2CAE1F000C2;
	Fri,  4 Dec 2026 00:24:33 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796343874;
	bh=WxfSZYFD+a+e4i7WtO1t5jHh4TOqXsCM0mNVt9wNpOs=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Sr//38OtlNm0qjIM0KouN6iL3NKH3mxLwcsTaPFf6JN8+EK8BfmgXYEpIV1gdr7NG
	 WKZifdEbKYZQjWVi7ECO/kSRWqt8iLDF82EvhQZIVKd3aZ4leFYFemiDHoPMGHm47S
	 lmVqc5ot4MrxOsscu9McS1D/trov1abPslcw16JI2/PQlZbo6f08nzPOpc0IEEp0yt
	 v99hS26rDED0sMd7MASEa19opwic8WUG68VNVgYc7WAyp+0Diaz4aOKOnR2bw/kwtO
	 5SsoRylfZY2rYbSU22zJ12mt99YW47SYQYh42uLCArh4aA2t+1iYl+sFo/tUAb5ouh
	 bS2ml+ZtSls+w==
X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, andrew+netdev@lunn.ch, willemb@google.com,
 netdev@vger.kernel.org, marcin.szycik@intel.com,
 arkadiusz.kubalewski@intel.com, poros@redhat.com, david.m.ertman@intel.com,
 przemyslaw.kitszel@intel.com, aleksandr.loktionov@intel.com, joe@dama.to,
 patryk.holda@intel.com
X-In-Reply-To: <20261203002248.348492-3-anthony.l.nguyen@intel.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list