From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796245869; b=zdAgtmO4eklF1KpuwfEMCabGGCgzhwuRPeLjYdMOlk3Vc077LQ7w+VbfJzZNFwxxvsq2 VHQcKJgtC+ddM8I9qahmIJYmMfaSMCyV5feu01jvHarOH/dKGoQjxfO6ObHaOEFC4RxFQ hEXp4kvInPLBbe3qGFbL0l32cF44oZ0xNxxKKbxecb3vxE4ikX8s7nMjaQeRYiFL27Dbc I1IarxhJKpiRytoT2f/AJEfcAyTp0NZArbthimRtsDyuvK4s5kwcJUkhB8hoAYZIX3F3e Q9Tot5W9zToicUZeythPuMH2//6jUZMB+gswVWf/4Arxsm/a9qW4Tqk21ZwFzBM5PCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796245869; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=Y4H71I31hu8nthAZRhJXJ4GiQqxTFen/OBpvXPPCnXI=; b=Kgo3mjQQvunq+g3vpuYBrUEiK55nnZ4pI34T6hVGY05+H6BKLhQCP9ZJwxhbUxhqvwFc Z+Ru18AbbD9KKwIx243ETXK1IjAOraD9qjvcya0tVW9GqzOl5hAjqV4fkIhO7lAZs+ubV x23AbF52eowxpQp0/J11Cm+dNVsps4pSDcs5afTZH9Qz5/zxymyBn64i8vz26HyiUiLG9 CdiNKNaQmm6Vpnhh5r7UNnUjtghUKEnv4S0JWFCiDz9s3NETXZgg21TC07S0pdrRHxqYt +C2gpHgvLSg8ux9noV2me9E8WSIIiO6/aqUby/zaBbFIAQRzzpVISVGm2ORbcYEA4hw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dCjXxg1p; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83A19606A688 for ; Wed, 2 Dec 2026 21:11:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 83A19606A688 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dCjXxg1p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796245868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y4H71I31hu8nthAZRhJXJ4GiQqxTFen/OBpvXPPCnXI=; b=dCjXxg1pAo8rNmcToe6FZUqABFsy/pp1WeJi1Sn9VrcASnKNlefeMQwFQ4X9PGfM3Q/pxd vhaTsEQ8OnxkBceABFDfvs4kBRHXesH29vKUe5wNMgxuon39fM5PfW9l0VvmwGtzYIYPod xruECQ+Ai2/JL5N0o9bWwYLN7EG1zeA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-306-rwGY4XZmPnyH2rxGJrQbIw-1; Wed, 2 Dec 2026 21:11:03 +0000 X-MC-Unique: rwGY4XZmPnyH2rxGJrQbIw-1 X-Mimecast-MFC-AGG-ID: rwGY4XZmPnyH2rxGJrQbIw_1796245861 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DB367191AF2B; Wed, 2 Dec 2026 21:11:00 +0000 (UTC) Received: from poros-thinkpadp16vgen1.tpbc.com (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A18CA7ED; Wed, 2 Dec 2026 21:10:57 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: Petr Oros , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Arkadiusz Kubalewski , Alexander Nowlin , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH net v2 2/2] ice: skip the SW pin description on boards with generic DPLL pins Date: Wed, 2 Dec 2026 22:10:45 +0100 Message-ID: <20261202211046.3007751-3-poros@redhat.com> In-Reply-To: <20261202211046.3007751-1-poros@redhat.com> References: <20261202211046.3007751-1-poros@redhat.com> 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 ice_dpll_init_info_sw_pins() describes the SMA and U.FL wrappers by pointing them at fixed positions of the input and output arrays, inputs 4 and 5 and outputs 0 and 1 on an E810-C SFP, and reads the ref-sync partner of the input it picked. The arrays are sized by the pin counts firmware reports. On a board that does not match the Intel reference layout the driver has already fallen back to generic pins, and when such a board reports fewer pins than the reference the reads run past the end of the arrays. The wrappers are never registered on a generic board, but ice_dpll_init_pins() still calls ice_dpll_pin_ref_sync_register() on them, so a stray nonzero partner from the out of bounds read would pair NULL pins. Describe the wrappers only when the static pin table is in use and keep their ref-sync registration under the same condition. The default programming of the PCA9575 clock mux stays on the generic path, a board that has the mux still needs its SMA connectors switched to inputs. Fixes: 2dd5d03c77e2 ("ice: redesign dpll sma/u.fl pins control") Tested-by: Alexander Nowlin Reviewed-by: Arkadiusz Kubalewski Signed-off-by: Petr Oros --- v2: - repost directly to netdev, no functional change - note in the kernel-doc of ice_dpll_init_info_sw_pins() that the SW pin caching only happens for the static pin table v1: https://lore.kernel.org/all/20260917190258.3239282-3-poros@redhat.com/ --- drivers/net/ethernet/intel/ice/ice_dpll.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index 4410dbd2b231b6..791fc95bab5e6d 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -4486,15 +4486,15 @@ static int ice_dpll_init_pins(struct ice_pf *pf, bool cgu) if (ret) goto deinit_sma; count += ICE_DPLL_PIN_SW_NUM; + ret = ice_dpll_pin_ref_sync_register(pf->dplls.sma, + ICE_DPLL_PIN_SW_NUM); + if (ret) + goto deinit_ufl; } ret = ice_dpll_pin_ref_sync_register(pf->dplls.inputs, pf->dplls.num_inputs); if (ret) goto deinit_ufl; - ret = ice_dpll_pin_ref_sync_register(pf->dplls.sma, - ICE_DPLL_PIN_SW_NUM); - if (ret) - goto deinit_ufl; } else { count += pf->dplls.num_outputs + 2 * ICE_DPLL_PIN_SW_NUM; } @@ -4849,7 +4849,9 @@ static int ice_dpll_init_info_rclk_pin(struct ice_pf *pf) * @pf: board private structure * * Init information for software controlled pins, cache them in - * pf->dplls.sma and pf->dplls.ufl. + * pf->dplls.sma and pf->dplls.ufl. The wrappers are only described when + * the board matches the static pin table, a board with generic DPLL pins + * keeps the arrays undescribed and only runs the SMA control setup. * * Return: * * 0 - success @@ -4864,6 +4866,8 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf) int i, ret; u8 data; + if (d->generic) + goto init_sma_ctrl; if (pf->hw.device_id == ICE_DEV_ID_E810C_QSFP) input_idx_offset = ICE_E810_RCLK_PINS_NUM; phase_adj_max = max(d->input_phase_adj_max, d->output_phase_adj_max); @@ -4929,6 +4933,7 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf) ice_dpll_phase_range_set(&pin->prop.phase_range, phase_adj_max); } +init_sma_ctrl: if (!ice_is_feature_supported(pf, ICE_F_SMA_CTRL)) return 0; @@ -4947,7 +4952,7 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf) if (ret) return ret; - ret = ice_dpll_pin_state_update(pf, pin, ICE_DPLL_PIN_TYPE_SOFTWARE, + ret = ice_dpll_pin_state_update(pf, d->sma, ICE_DPLL_PIN_TYPE_SOFTWARE, NULL); if (ret) return ret; -- 2.56.1