From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Fri, 4 Dec 2026 00:24:34 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2CAE1F000C2; Fri, 4 Dec 2026 00:24:33 +0000 (UTC) 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== Subject: Re: [PATCH net-next 2/4] ice: describe generic DPLL pins from firmware pin classification From: netdev-bot+sashiko@kernel.org To: anthony.l.nguyen@intel.com 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 Date: Fri, 04 Dec 2026 00:24:33 +0000 Message-ID: <179634387333.3146.378020491996477944@kernel.org> In-Reply-To: <20261203002248.348492-3-anthony.l.nguyen@intel.com> References: <20261203002248.348492-3-anthony.l.nguyen@intel.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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-, RCLK-, EXT- or IN-, outputs become OUT-, 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