From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEF7CFF8875 for ; Thu, 30 Apr 2026 09:47:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 916AF844F1; Thu, 30 Apr 2026 09:47:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VjMPyQydgNB2; Thu, 30 Apr 2026 09:47:29 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E6E6884914 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1777542449; bh=T0lroxqibqVIDR5dx5fXr+4LriwR2JQ1P1pn9qyHwWE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=u6U5A18sLzftooX2fRHIj5C4UphgbjnWEZdezSa4pAI5+5q8SX8LszgCbpo5133r/ +kqrHAJ9cPrqQ/3Qx+pRSytQ9BEthrgMsrY+xF2pRlmvaPANNL44utASvyQgMD/Nv6 EDIZsNoVtl4yWFzhlsudY1FKpzaQuozHtmFa5gArVsyyxzj2AeaIOjlI86OnUr5Me1 56U2GoRyvehMa2UVxgiW3Tj2kNDe7MVLQAPoJxmTJNcp0UomGUYcmMo2Uxt9dvu9sH 21sZMcRpIpjL06s3KTwyxicZywt1arXwYxWVkPPOlzm7RU/5c9oLQqjwdMC/A4guF4 DaPoAM9CB3VIQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id E6E6884914; Thu, 30 Apr 2026 09:47:28 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id D7CF718F for ; Thu, 30 Apr 2026 09:47:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D616D427A4 for ; Thu, 30 Apr 2026 09:47:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id fP_TQhnTvtIb for ; Thu, 30 Apr 2026 09:47:24 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.12; helo=mgamail.intel.com; envelope-from=grzegorz.nitka@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 747C842798 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 747C842798 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by smtp4.osuosl.org (Postfix) with ESMTPS id 747C842798 for ; Thu, 30 Apr 2026 09:47:24 +0000 (UTC) X-CSE-ConnectionGUID: kc+nOfb9RP6LYZefgfVOqA== X-CSE-MsgGUID: slgBqKDyS1ebqYGJF1uW+w== X-IronPort-AV: E=McAfee;i="6800,10657,11771"; a="82342699" X-IronPort-AV: E=Sophos;i="6.23,207,1770624000"; d="scan'208";a="82342699" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2026 02:47:24 -0700 X-CSE-ConnectionGUID: fdVSJ9LsSl6nb095bg4L2A== X-CSE-MsgGUID: CxRC8KYgQEWGCYzXb+WMVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,207,1770624000"; d="scan'208";a="272649897" Received: from gklab-003-001.igk.intel.com ([10.91.173.48]) by orviesa001.jf.intel.com with ESMTP; 30 Apr 2026 02:47:19 -0700 From: Grzegorz Nitka To: netdev@vger.kernel.org Date: Thu, 30 Apr 2026 11:42:37 +0200 Message-Id: <20260430094238.987976-8-grzegorz.nitka@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20260430094238.987976-1-grzegorz.nitka@intel.com> References: <20260430094238.987976-1-grzegorz.nitka@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777542445; x=1809078445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DQswqga0Bxpqo95+6epgiwE43Noct2acAWb4SWg6Tes=; b=Pagzt0ZGZliIklm0P1ZOBuPvG/hjes6wujmBcRzHTAQJ2v1O/1Got7Wi uCefeiuOirNBGJqqzhOwcAQ85ooAv4XWvZO0Y2HzQQ75apZNg1g34dGZ8 MQJgHALYxK/bnYdYnHckkyLPMKo9lhfgoHSELrfSqV01wnEliEr6kiB3S HcVDSf4Uu04gUKXmhmxjaHB9WDkqQIpZq45C7lNKrrr051W34yT2f0/nz apZh88rbgBk8tLq2FUKrsdQxk2K95tcoQiKf0R6J2kzEwmq1XM0XQ4S8H Pbkc7f+LkjqhueokS6iTcsA3ICjyKRZ0kgDnTye2UmwNSirz34jJ2cHiX w==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Pagzt0ZG Subject: [Intel-wired-lan] [PATCH v7 net-next 7/8] ice: add Tx reference clock index handling to AN restart command X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ivecera@redhat.com, vadim.fedorenko@linux.dev, kuba@kernel.org, jiri@resnulli.us, edumazet@google.com, przemyslaw.kitszel@intel.com, richardcochran@gmail.com, donald.hunter@gmail.com, linux-kernel@vger.kernel.org, arkadiusz.kubalewski@intel.com, andrew+netdev@lunn.ch, intel-wired-lan@lists.osuosl.org, horms@kernel.org, Prathosh.Satish@microchip.com, anthony.l.nguyen@intel.com, pabeni@redhat.com, davem@davemloft.net Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Extend the Restart Auto-Negotiation (AN) AdminQ command with a new parameter allowing software to specify the Tx reference clock index to be used during link restart. This patch: - adds REFCLK field definitions to ice_aqc_restart_an - updates ice_aq_set_link_restart_an() to take a new refclk parameter and properly encode it into the command - keeps legacy behavior by passing REFCLK_NOCHANGE where appropriate This prepares the driver for configurations requiring dynamic selection of the Tx reference clock as part of the AN flow. Reviewed-by: Arkadiusz Kubalewski Signed-off-by: Grzegorz Nitka --- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 ++ drivers/net/ethernet/intel/ice/ice_common.c | 5 ++++- drivers/net/ethernet/intel/ice/ice_common.h | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h index 3cbb1b0582e3..42878abac9eb 100644 --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -1169,6 +1169,8 @@ struct ice_aqc_restart_an { u8 cmd_flags; #define ICE_AQC_RESTART_AN_LINK_RESTART BIT(1) #define ICE_AQC_RESTART_AN_LINK_ENABLE BIT(2) +#define ICE_AQC_RESTART_AN_REFCLK_M GENMASK(4, 3) +#define ICE_AQC_RESTART_AN_REFCLK_NOCHANGE 0 u8 reserved2[13]; }; diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index ce11fea122d0..de88aec9137c 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -4126,12 +4126,13 @@ int ice_get_link_status(struct ice_port_info *pi, bool *link_up) * @pi: pointer to the port information structure * @ena_link: if true: enable link, if false: disable link * @cd: pointer to command details structure or NULL + * @refclk: the new TX reference clock, 0 if no change * * Sets up the link and restarts the Auto-Negotiation over the link. */ int ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, - struct ice_sq_cd *cd) + struct ice_sq_cd *cd, u8 refclk) { struct ice_aqc_restart_an *cmd; struct libie_aq_desc desc; @@ -4147,6 +4148,8 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, else cmd->cmd_flags &= ~ICE_AQC_RESTART_AN_LINK_ENABLE; + cmd->cmd_flags |= FIELD_PREP(ICE_AQC_RESTART_AN_REFCLK_M, refclk); + return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); } diff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h index e700ac0dc347..9f5344212195 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.h +++ b/drivers/net/ethernet/intel/ice/ice_common.h @@ -215,7 +215,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, enum ice_fec_mode fec); int ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, - struct ice_sq_cd *cd); + struct ice_sq_cd *cd, u8 refclk); int ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd); int diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 837b71b7b2b7..8cdc4fda89e9 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -3769,7 +3769,8 @@ int ice_set_link(struct ice_vsi *vsi, bool ena) if (vsi->type != ICE_VSI_PF) return -EINVAL; - status = ice_aq_set_link_restart_an(pi, ena, NULL); + status = ice_aq_set_link_restart_an(pi, ena, NULL, + ICE_AQC_RESTART_AN_REFCLK_NOCHANGE); /* if link is owned by manageability, FW will return LIBIE_AQ_RC_EMODE. * this is not a fatal error, so print a warning message and return -- 2.39.3