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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 68129C624C6 for ; Mon, 31 Aug 2026 14:50:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1FA7340573; Mon, 31 Aug 2026 14:50:16 +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 z0-KMe4qNk4h; Mon, 31 Aug 2026 14:50:15 +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-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1788187815; bh=ol6wYj7gQk6RBwoN9O+KTNIGGpMk1D4hjVFmywWKVkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Y/xdXascPgqKOozigPVldcUefle5pg0itcVE7SW1O1rA+5QUkIlu8UimcBUfB0fee Epj1tqqtNQ5/vqqIoA049wTc5HmpMVyLrZjdxV+5lhJpz2LRd2ngokkM7Q9INaRa/p 0k1QO3MvBZQq/EAY0Plg6lndzrpaHh0jcpE8nbR8zJ+xWkbocqIHQ+kgViy/23NYUl Dnu34exAi/tp2qKNmZHVJ9BqKAoVdI4DMKtdIQQs2LvTCcOC2j93c+SBHUmm6K8981 xz0v2ygUt2S0zriOA/aGmGIbuZNPwyGKWMcYkBuXw5RrsGNhVTEEvHf8vLJnr8DSNo 7HtdmjK5F6X5A== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 6791240578; Mon, 31 Aug 2026 14:50:15 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 419962FD for ; Mon, 31 Aug 2026 14:50:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 27BCC40578 for ; Mon, 31 Aug 2026 14:50:12 +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 KyHfZWa4FhgJ for ; Mon, 31 Aug 2026 14:50:10 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=192.198.163.16; helo=mgamail.intel.com; envelope-from=sergey.temerkhanov@intel.com; receiver= Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com 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=Ahv4x4oZ Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by smtp4.osuosl.org (Postfix) with ESMTPS id EC60040573 for ; Mon, 31 Aug 2026 14:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788187810; x=1819723810; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9flqOuqLAwOFhVCFfviEiI+e1fQVhXab9jGjj0nkQ7s=; b=Ahv4x4oZbFLE8FG2p9lw51YlmboDruKqnEZsXyeOJSydfL64Fw0oI/aZ eknXPFLl2XSkLFBVQPDY2rZ14joFgfBcG6dstB3TuSLEkIEWy+TnA/JMg A8zZZlVZBDQQSXBmacfMwm4ILltnMV7j7UE8n97WxviQOw8rS9AFuvS0l 1yJm+8yGVInLtlUfrJ8j6FhconWptErqUUJVZLGAnrHuAGYVEgQ6LTl3l uLIGhUa8b+pNQQRyyeKhHErIfEmZ3Om6idWN3o7fidLzyKhG8ppDEi80b LKjll6vZ9SQv9vqarZaetugHSU/Q5CY5hItd2dmCgWD3/NhtS6Ibf0KLF A==; X-CSE-ConnectionGUID: WPBkvpdHSfqZQi7FZtjoZw== X-CSE-MsgGUID: M2dY+Vr5TbmYi/736zZHFA== X-IronPort-AV: E=McAfee;i="6800,10657,11891"; a="76144528" X-IronPort-AV: E=Sophos;i="6.25,254,1779174000"; d="scan'208";a="76144528" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2026 07:50:10 -0700 X-CSE-ConnectionGUID: 0ct7VCIoQx6jGTW98+iJBQ== X-CSE-MsgGUID: RKLqn/i0Tqev9MSM4osdEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,254,1779174000"; d="scan'208";a="273003700" Received: from gnrd8.igk.intel.com (HELO GNRD8) ([10.123.232.137]) by orviesa005.jf.intel.com with ESMTP; 31 Aug 2026 07:50:09 -0700 From: Sergey Temerkhanov To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org Subject: [PATCH iwl-next v5 2/6] ice: dpll: Rework multiplexed pin notifications Date: Mon, 31 Aug 2026 14:50:01 +0000 Message-ID: <20260831145005.191040-3-sergey.temerkhanov@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260831145005.191040-1-sergey.temerkhanov@intel.com> References: <20260831145005.191040-1-sergey.temerkhanov@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Errors-To: intel-wired-lan-bounces@osuosl.org Use a pointer to the struct ice_dpll_pin to link multiplexed pins. This allows to simplify the selection logic. Signed-off-by: Sergey Temerkhanov Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemyslaw Korba --- drivers/net/ethernet/intel/ice/ice_dpll.c | 60 +++++++++++------------ drivers/net/ethernet/intel/ice/ice_dpll.h | 1 + 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index 9b3584fa43a9..ac1a034b7353 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -564,6 +564,29 @@ ice_dpll_pin_disable(struct ice_hw *hw, struct ice_dpll_pin *pin, return ret; } +/** + * ice_dpll_sw_pin_notify_peer - notify the paired SW pin after a state change + * @changed: the SW pin that was explicitly changed (already notified by dpll core) + * + * SMA and U.FL pins share physical signal paths in pairs (SMA1/U.FL1 and + * SMA2/U.FL2). When one pin's routing changes via the PCA9575 GPIO + * expander, the paired pin's state may also change. Send a change + * notification for the peer pin so userspace consumers monitoring the + * peer via dpll netlink learn about the update. + * + * Context: Called from dpll_pin_ops callbacks after pf->dplls.lock is + * released. Uses __dpll_pin_change_ntf() because dpll_lock is + * still held by the dpll netlink layer. + */ +static void ice_dpll_sw_pin_notify_peer(struct ice_dpll_pin *changed) +{ + struct ice_dpll_pin *peer; + + peer = changed->muxed; + if (peer && peer->pin) + __dpll_pin_change_ntf(peer->pin); +} + /** * ice_dpll_pin_store_state - updates the state of pin in SW bookkeeping * @pin: pointer to a pin @@ -1189,32 +1212,6 @@ ice_dpll_input_state_get(const struct dpll_pin *pin, void *pin_priv, extack, ICE_DPLL_PIN_TYPE_INPUT); } -/** - * ice_dpll_sw_pin_notify_peer - notify the paired SW pin after a state change - * @d: pointer to dplls struct - * @changed: the SW pin that was explicitly changed (already notified by dpll core) - * - * SMA and U.FL pins share physical signal paths in pairs (SMA1/U.FL1 and - * SMA2/U.FL2). When one pin's routing changes via the PCA9575 GPIO - * expander, the paired pin's state may also change. Send a change - * notification for the peer pin so userspace consumers monitoring the - * peer via dpll netlink learn about the update. - * - * Context: Called from dpll_pin_ops callbacks after pf->dplls.lock is - * released. Uses __dpll_pin_change_ntf() because dpll_lock is - * still held by the dpll netlink layer. - */ -static void ice_dpll_sw_pin_notify_peer(struct ice_dplls *d, - struct ice_dpll_pin *changed) -{ - struct ice_dpll_pin *peer; - - peer = (changed >= d->sma && changed < d->sma + ICE_DPLL_PIN_SW_NUM) ? - &d->ufl[changed->idx] : &d->sma[changed->idx]; - if (peer->pin) - __dpll_pin_change_ntf(peer->pin); -} - /** * ice_dpll_sma_direction_set - set direction of SMA pin * @p: pointer to a pin @@ -1276,7 +1273,7 @@ static int ice_dpll_sma_direction_set(struct ice_dpll_pin *p, * backing pin when U.FL becomes inactive because the SMA pin may * still be using it. */ - peer = &d->ufl[p->idx]; + peer = p->muxed; if (peer->active) { struct ice_dpll_pin *target; enum ice_dpll_pin_type type; @@ -1406,7 +1403,7 @@ ice_dpll_ufl_pin_state_set(const struct dpll_pin *pin, void *pin_priv, unlock: mutex_unlock(&pf->dplls.lock); if (!ret) - ice_dpll_sw_pin_notify_peer(&pf->dplls, p); + ice_dpll_sw_pin_notify_peer(p); return ret; } @@ -1526,7 +1523,7 @@ ice_dpll_sma_pin_state_set(const struct dpll_pin *pin, void *pin_priv, unlock: mutex_unlock(&pf->dplls.lock); if (!ret) - ice_dpll_sw_pin_notify_peer(&pf->dplls, sma); + ice_dpll_sw_pin_notify_peer(sma); return ret; } @@ -1723,7 +1720,7 @@ ice_dpll_pin_sma_direction_set(const struct dpll_pin *pin, void *pin_priv, ret = ice_dpll_sma_direction_set(p, direction, extack); mutex_unlock(&pf->dplls.lock); if (!ret) - ice_dpll_sw_pin_notify_peer(&pf->dplls, p); + ice_dpll_sw_pin_notify_peer(p); return ret; } @@ -4909,6 +4906,8 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf) if (pin->input->ref_sync) pin->ref_sync = pin->input->ref_sync - pin_abs_idx; pin->output = &d->outputs[ICE_DPLL_PIN_SW_OUTPUT_ABS(i)]; + pin->muxed = &d->ufl[i]; + ice_dpll_phase_range_set(&pin->prop.phase_range, phase_adj_max); } for (i = 0; i < ICE_DPLL_PIN_SW_NUM; i++) { @@ -4942,6 +4941,7 @@ static int ice_dpll_init_info_sw_pins(struct ice_pf *pf) (DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE | caps); } + pin->muxed = &d->sma[i]; ice_dpll_phase_range_set(&pin->prop.phase_range, phase_adj_max); } diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.h b/drivers/net/ethernet/intel/ice/ice_dpll.h index bce0bea9a664..f7e6680d124c 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.h +++ b/drivers/net/ethernet/intel/ice/ice_dpll.h @@ -76,6 +76,7 @@ struct ice_dpll_pin { s32 phase_adjust; struct ice_dpll_pin *input; struct ice_dpll_pin *output; + struct ice_dpll_pin *muxed; enum dpll_pin_direction direction; s64 phase_offset; u8 status; -- 2.53.0