From nobody Sat Apr 4 01:41:19 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA153175A74; Sat, 21 Mar 2026 22:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774132228; cv=none; b=Ea/lp0jo4wKOLou/3uIDE1ECNXpICAcGLKneWbDel4Oqwn7vWs1DBORRtxbNsoXgE41K2qQz17qKCDVpLT/rtWzj1FSMahD3oqXqqkBzi4WvW7iUkacp4iN7ecXUyPf52YXVduFfPaJErD5Dz7N4G4I5kQYaqjSjVP63XrRchwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774132228; c=relaxed/simple; bh=L2ePYf8N69aJVra4uQmab183JIOlPslGxH7mK0bIm/U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Ea5eJy2lV9XLHL6GEtv6M8O6XuV7QPSqiWumD+rlbAcuZnbYetmgHig15WFhcuzJyu1nkoGL06jRretPROjqrSiIZrDuz9ZgKMPZZtRiOPH2ErHTDdzQMFwVs2L2edkeJPbyilVDBtxFUUujXzP3A43H0LgN7Sj7FNbenbzy78Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ijSsDwHC; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ijSsDwHC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774132226; x=1805668226; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L2ePYf8N69aJVra4uQmab183JIOlPslGxH7mK0bIm/U=; b=ijSsDwHC47M2FRx+6Z5Suin9h1BQjYYLQKbGy0D82crKe4n/x5ZBvu9W pfCkVLSCtIx1m/NoU1oYYmxMJOJcymLsWouFnzu6o9bOOVPPPID4+pjrC qfQJkeKYigDX2meXPA1CQNmx7dguMPSTgZRid2Ue7qOdiV8eVOomoE1EK 6gMbWNH8J69/bGGTDtUCJQOEFPO5F50t6kjnwlQttPbQC4zPwgyK65G7L 2oNxpYERSq3BnPWoFFc6E8wwm9XiUSmSrDz7k1DdpDd3MWRlZatEWxAja sLlRR+z7oe4nSjgkkq36Q4ef0iWx4JHB6RYOVELkEKFAvWcq8O+45ZLci g==; X-CSE-ConnectionGUID: dgU1dZakSN+RTLHzNpU89A== X-CSE-MsgGUID: +1nlwxbcRnW9q4sL45z5FA== X-IronPort-AV: E=McAfee;i="6800,10657,11736"; a="75150408" X-IronPort-AV: E=Sophos;i="6.23,134,1770624000"; d="scan'208";a="75150408" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2026 15:30:26 -0700 X-CSE-ConnectionGUID: 7wtdpzKKR0uGAsitj/h+Cw== X-CSE-MsgGUID: M85oGeqiTJmlOC66Wyt/ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,134,1770624000"; d="scan'208";a="261543955" Received: from gklab-003-001.igk.intel.com ([10.91.173.48]) by orviesa001.jf.intel.com with ESMTP; 21 Mar 2026 15:30:22 -0700 From: Grzegorz Nitka To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, poros@redhat.com, richardcochran@gmail.com, andrew+netdev@lunn.ch, przemyslaw.kitszel@intel.com, anthony.l.nguyen@intel.com, Prathosh.Satish@microchip.com, ivecera@redhat.com, jiri@resnulli.us, arkadiusz.kubalewski@intel.com, vadim.fedorenko@linux.dev, donald.hunter@gmail.com, horms@kernel.org, pabeni@redhat.com, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, Grzegorz Nitka , Aleksandr Loktionov Subject: [PATCH v2 net-next 3/8] dpll: extend pin notifier and netlink events with notification source ID Date: Sat, 21 Mar 2026 23:26:22 +0100 Message-Id: <20260321222627.1193603-4-grzegorz.nitka@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20260321222627.1193603-1-grzegorz.nitka@intel.com> References: <20260321222627.1193603-1-grzegorz.nitka@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Extend the DPLL pin notification API to include a source identifier indicating where the notification originates. This allows notifier consumers and netlink listeners to distinguish between notifications coming from an associated DPLL instance, a parent pin, or the pin itself. A new field, src_id, is added to struct dpll_pin_notifier_info and is passed through all pin-related notification paths. Callers of dpll_pin_notify() are updated to provide a meaningful source identifier based on their context: - pin registration/unregistration use the DPLL's clock_id, - pin-on-pin operations use the parent pin's clock_id, - pin changes use the pin's own clock_id. This enables richer event routing and more accurate state handling in user space and in-kernel consumers. The current DPLL pin notification infrastructure does not provide any way to identify where a pin-related notification originates. Both the in-kernel notifier chain and the netlink notification path only carry information about the pin itself, not about the component that triggered the event. This becomes problematic on platforms where multiple DPLL devices or drivers share the same physical pin via firmware description (fwnode). In such setups pin creation, deletion, or state changes can be triggered from several independent contexts: - from the DPLL device that owns the pin, - from another DPLL device that re-registers or rebinds the same fwnode-described pin, - or from a pin-on-pin relationship (parent pin registering child pins). Without a source identifier all these notifications look identical to listeners. Drivers cannot reliably determine whether a received event is a result of their own registration/unregistration actions or originated from a different DPLL instance. This leads to several types of problems: * risk of duplicate pin registration when a driver reacts to its own event, * difficulty suppressing notifications that are merely internal bookkeeping side effects, * inability to implement correct pin=E2=80=91multiplexing or cross=E2=80= =91device synchronization logic when pins are shared across fwnode domains. To address this, extend `struct dpll_pin_notifier_info` with a new `src_id` field that identifies the originator of the event. The DPLL core sets this field for all pin notifications: - pin registration/unregistration: the source is the clock_id of the DPLL initiating the operation, - pin-on-pin relationships: the source is the parent pin's clock_id, - pin property/state updates: the source is the pin's own clock_id. Netlink notifications now also carry this additional field. With this information notifier consumers can differentiate true external events from internal ones and ignore the latter when appropriate. As shown later in this series, ICE/E825 devices rely on this to avoid reacting to the events that their own registration logic triggers when a shared-fwnode pin appears. This change only extends the notification metadata and does not alter existing semantics for drivers that do not use the new field. Reviewed-by: Arkadiusz Kubalewski Reviewed-by: Aleksandr Loktionov Signed-off-by: Grzegorz Nitka --- drivers/dpll/dpll_core.c | 14 ++++++++------ drivers/dpll/dpll_core.h | 2 +- drivers/dpll/dpll_netlink.c | 10 +++++----- drivers/dpll/dpll_netlink.h | 4 ++-- include/linux/dpll.h | 1 + 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 55ad03977d6d..c7fcae76c3f5 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -71,7 +71,8 @@ void dpll_device_notify(struct dpll_device *dpll, unsigne= d long action) call_dpll_notifiers(action, &info); } =20 -void dpll_pin_notify(struct dpll_pin *pin, unsigned long action) +void dpll_pin_notify(struct dpll_pin *pin, u64 ntfy_src, + unsigned long action) { struct dpll_pin_notifier_info info =3D { .pin =3D pin, @@ -80,6 +81,7 @@ void dpll_pin_notify(struct dpll_pin *pin, unsigned long = action) .clock_id =3D pin->clock_id, .fwnode =3D pin->fwnode, .prop =3D &pin->prop, + .src_id =3D ntfy_src, }; =20 call_dpll_notifiers(action, &info); @@ -847,7 +849,7 @@ __dpll_pin_register(struct dpll_device *dpll, struct dp= ll_pin *pin, if (ret) goto ref_pin_del; xa_set_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED); - dpll_pin_create_ntf(pin); + dpll_pin_create_ntf(pin, dpll->clock_id); =20 return ret; =20 @@ -946,7 +948,7 @@ void dpll_pin_unregister(struct dpll_device *dpll, stru= ct dpll_pin *pin, return; =20 mutex_lock(&dpll_lock); - dpll_pin_delete_ntf(pin); + dpll_pin_delete_ntf(pin, dpll->clock_id); __dpll_pin_unregister(dpll, pin, ops, priv, NULL); mutex_unlock(&dpll_lock); } @@ -992,7 +994,7 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, s= truct dpll_pin *pin, stop =3D i; goto dpll_unregister; } - dpll_pin_create_ntf(pin); + dpll_pin_create_ntf(pin, parent->clock_id); } mutex_unlock(&dpll_lock); =20 @@ -1003,7 +1005,7 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent,= struct dpll_pin *pin, if (i < stop) { __dpll_pin_unregister(ref->dpll, pin, ops, priv, parent); - dpll_pin_delete_ntf(pin); + dpll_pin_delete_ntf(pin, parent->clock_id); } dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin); unlock: @@ -1029,7 +1031,7 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *pare= nt, struct dpll_pin *pin, unsigned long i; =20 mutex_lock(&dpll_lock); - dpll_pin_delete_ntf(pin); + dpll_pin_delete_ntf(pin, parent->clock_id); dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin); xa_for_each(&pin->dpll_refs, i, ref) __dpll_pin_unregister(ref->dpll, pin, ops, priv, parent); diff --git a/drivers/dpll/dpll_core.h b/drivers/dpll/dpll_core.h index 71ac88ef2017..f684d9d4c4da 100644 --- a/drivers/dpll/dpll_core.h +++ b/drivers/dpll/dpll_core.h @@ -98,6 +98,6 @@ extern struct xarray dpll_pin_xa; extern struct mutex dpll_lock; =20 void dpll_device_notify(struct dpll_device *dpll, unsigned long action); -void dpll_pin_notify(struct dpll_pin *pin, unsigned long action); +void dpll_pin_notify(struct dpll_pin *pin, u64 ntfy_src, unsigned long act= ion); =20 #endif diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c index 83cbd64abf5a..afb778420b93 100644 --- a/drivers/dpll/dpll_netlink.c +++ b/drivers/dpll/dpll_netlink.c @@ -830,21 +830,21 @@ dpll_pin_event_send(enum dpll_cmd event, struct dpll_= pin *pin) return ret; } =20 -int dpll_pin_create_ntf(struct dpll_pin *pin) +int dpll_pin_create_ntf(struct dpll_pin *pin, u64 ntfy_src) { - dpll_pin_notify(pin, DPLL_PIN_CREATED); + dpll_pin_notify(pin, ntfy_src, DPLL_PIN_CREATED); return dpll_pin_event_send(DPLL_CMD_PIN_CREATE_NTF, pin); } =20 -int dpll_pin_delete_ntf(struct dpll_pin *pin) +int dpll_pin_delete_ntf(struct dpll_pin *pin, u64 ntfy_src) { - dpll_pin_notify(pin, DPLL_PIN_DELETED); + dpll_pin_notify(pin, ntfy_src, DPLL_PIN_DELETED); return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin); } =20 int __dpll_pin_change_ntf(struct dpll_pin *pin) { - dpll_pin_notify(pin, DPLL_PIN_CHANGED); + dpll_pin_notify(pin, pin->clock_id, DPLL_PIN_CHANGED); return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin); } =20 diff --git a/drivers/dpll/dpll_netlink.h b/drivers/dpll/dpll_netlink.h index dd28b56d27c5..082c2aea6d1a 100644 --- a/drivers/dpll/dpll_netlink.h +++ b/drivers/dpll/dpll_netlink.h @@ -8,8 +8,8 @@ int dpll_device_create_ntf(struct dpll_device *dpll); =20 int dpll_device_delete_ntf(struct dpll_device *dpll); =20 -int dpll_pin_create_ntf(struct dpll_pin *pin); +int dpll_pin_create_ntf(struct dpll_pin *pin, u64 ntfy_src); =20 -int dpll_pin_delete_ntf(struct dpll_pin *pin); +int dpll_pin_delete_ntf(struct dpll_pin *pin, u64 ntfy_src); =20 int __dpll_pin_change_ntf(struct dpll_pin *pin); diff --git a/include/linux/dpll.h b/include/linux/dpll.h index 2ce295b46b8c..ae4b146d7243 100644 --- a/include/linux/dpll.h +++ b/include/linux/dpll.h @@ -202,6 +202,7 @@ struct dpll_pin_notifier_info { u64 clock_id; const struct fwnode_handle *fwnode; const struct dpll_pin_properties *prop; + u64 src_id; }; =20 #if IS_ENABLED(CONFIG_DPLL) --=20 2.39.3