From: Ivan Vecera <ivecera@redhat.com>
To: netdev@vger.kernel.org
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Richard Cochran <richardcochran@gmail.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
intel-wired-lan@lists.osuosl.org, Min Li <min.li@microchip.com>,
Grzegorz Nitka <grzegorz.nitka@intel.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>, Petr Oros <poros@redhat.com>
Subject: [PATCH RFC net-next 16/19] dpll: drop the in-kernel notifier chain
Date: Thu, 26 Nov 2026 21:32:28 +0100 [thread overview]
Message-ID: <20261126203231.934632-17-ivecera@redhat.com> (raw)
In-Reply-To: <20261126203231.934632-1-ivecera@redhat.com>
The only user of the notifier chain from commit 2be467588d6b ("dpll: Add
notifier chain for dpll events") was ice on E825. The driver waited
there for the zl3073x pins it registered its own pins with. It now links
its own pins with them instead.
Drop the chain. The KUnit tests counted the change notifications of
linked pins through it. Count them with a static stub of
__dpll_pin_change_ntf() instead.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/dpll/Kconfig | 4 +--
drivers/dpll/dpll_core.c | 43 ---------------------------------
drivers/dpll/dpll_core.h | 2 --
drivers/dpll/dpll_netlink.c | 5 ++--
drivers/dpll/tests/dpll_kunit.c | 31 +++++++++---------------
include/linux/dpll.h | 18 --------------
6 files changed, 15 insertions(+), 88 deletions(-)
diff --git a/drivers/dpll/Kconfig b/drivers/dpll/Kconfig
index 6f1ffc3a6e7717..d57696652d450a 100644
--- a/drivers/dpll/Kconfig
+++ b/drivers/dpll/Kconfig
@@ -34,8 +34,8 @@ config DPLL_KUNIT_TEST
while the pins at both ends are registered.
The mock devices and pins are registered with the DPLL subsystem,
- so user space sees them and their notifications while the tests
- run.
+ so user space sees them and their create and delete notifications
+ while the tests run.
If unsure, say N.
diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
index 9b48d289ec7330..e199342652d163 100644
--- a/drivers/dpll/dpll_core.c
+++ b/drivers/dpll/dpll_core.c
@@ -27,7 +27,6 @@ EXPORT_SYMBOL_IF_KUNIT(dpll_lock);
DEFINE_XARRAY_FLAGS(dpll_device_xa, XA_FLAGS_ALLOC);
DEFINE_XARRAY_FLAGS(dpll_pin_xa, XA_FLAGS_ALLOC);
-static RAW_NOTIFIER_HEAD(dpll_notifier_chain);
static DEFINE_IDA(dpll_pin_idx_ida);
static u32 dpll_device_xa_id;
@@ -55,26 +54,6 @@ struct dpll_pin_registration {
dpll_tracker tracker;
};
-static int call_dpll_notifiers(unsigned long action, void *info)
-{
- lockdep_assert_held(&dpll_lock);
- return raw_notifier_call_chain(&dpll_notifier_chain, action, info);
-}
-
-void dpll_pin_notify(struct dpll_pin *pin, unsigned long action)
-{
- struct dpll_pin_notifier_info info = {
- .pin = pin,
- .id = pin->id,
- .idx = pin->pin_idx,
- .clock_id = pin->clock_id,
- .fwnode = pin->fwnode,
- .prop = &pin->prop,
- };
-
- call_dpll_notifiers(action, &info);
-}
-
static void dpll_device_tracker_alloc(struct dpll_device *dpll,
dpll_tracker *tracker)
{
@@ -704,28 +683,6 @@ void dpll_netdev_pin_clear(struct net_device *dev)
}
EXPORT_SYMBOL(dpll_netdev_pin_clear);
-int register_dpll_notifier(struct notifier_block *nb)
-{
- int ret;
-
- mutex_lock(&dpll_lock);
- ret = raw_notifier_chain_register(&dpll_notifier_chain, nb);
- mutex_unlock(&dpll_lock);
- return ret;
-}
-EXPORT_SYMBOL_GPL(register_dpll_notifier);
-
-int unregister_dpll_notifier(struct notifier_block *nb)
-{
- int ret;
-
- mutex_lock(&dpll_lock);
- ret = raw_notifier_chain_unregister(&dpll_notifier_chain, nb);
- mutex_unlock(&dpll_lock);
- return ret;
-}
-EXPORT_SYMBOL_GPL(unregister_dpll_notifier);
-
/**
* dpll_pin_get - find existing or create new dpll pin
* @clock_id: clock_id of creator
diff --git a/drivers/dpll/dpll_core.h b/drivers/dpll/dpll_core.h
index 3b7e0af7f7ee6f..6e10aadd2123d9 100644
--- a/drivers/dpll/dpll_core.h
+++ b/drivers/dpll/dpll_core.h
@@ -111,6 +111,4 @@ extern struct xarray dpll_device_xa;
extern struct xarray dpll_pin_xa;
extern struct mutex dpll_lock;
-void dpll_pin_notify(struct dpll_pin *pin, unsigned long action);
-
#endif
diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
index 372de086a7eb3d..6a46130fc687eb 100644
--- a/drivers/dpll/dpll_netlink.c
+++ b/drivers/dpll/dpll_netlink.c
@@ -6,6 +6,7 @@
* Copyright (c) 2023 Intel and affiliates
*
*/
+#include <kunit/static_stub.h>
#include <kunit/visibility.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -968,13 +969,11 @@ dpll_pin_event_send(enum dpll_cmd event, struct dpll_pin *pin)
int dpll_pin_create_ntf(struct dpll_pin *pin)
{
- dpll_pin_notify(pin, DPLL_PIN_CREATED);
return dpll_pin_event_send(DPLL_CMD_PIN_CREATE_NTF, pin);
}
int dpll_pin_delete_ntf(struct dpll_pin *pin)
{
- dpll_pin_notify(pin, DPLL_PIN_DELETED);
return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin);
}
@@ -988,8 +987,8 @@ int dpll_pin_delete_ntf(struct dpll_pin *pin)
*/
int __dpll_pin_change_ntf(struct dpll_pin *pin)
{
+ KUNIT_STATIC_STUB_REDIRECT(__dpll_pin_change_ntf, pin);
lockdep_assert_held(&dpll_lock);
- dpll_pin_notify(pin, DPLL_PIN_CHANGED);
return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin);
}
EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf);
diff --git a/drivers/dpll/tests/dpll_kunit.c b/drivers/dpll/tests/dpll_kunit.c
index 7fb50fe0eea9a5..1804e5836f7db2 100644
--- a/drivers/dpll/tests/dpll_kunit.c
+++ b/drivers/dpll/tests/dpll_kunit.c
@@ -12,9 +12,9 @@
*/
#include <kunit/fwnode.h>
+#include <kunit/static_stub.h>
#include <kunit/test.h>
#include <linux/dpll.h>
-#include <linux/notifier.h>
#include <net/netlink.h>
#include "../dpll_core.h"
@@ -35,15 +35,13 @@ struct dt_dev {
struct dt_pin {
struct dpll_pin *pin;
dpll_tracker tracker;
- int changes; /* DPLL_PIN_CHANGED notifications */
+ int changes; /* change notifications */
};
struct dt_ctx {
struct dt_dev a0, a1, b0;
struct dt_pin p, u, c;
struct fwnode_handle *fwnode;
- struct notifier_block nb;
- bool nb_registered;
bool p_a0, p_a1, u_a0, c_b0; /* registrations */
};
@@ -95,22 +93,19 @@ static const struct dpll_pin_properties dt_pin_prop = {
.type = DPLL_PIN_TYPE_EXT,
};
-static int dt_notify(struct notifier_block *nb, unsigned long action,
- void *data)
+/* Stub of __dpll_pin_change_ntf() that counts the notifications */
+static int dt_pin_change_ntf(struct dpll_pin *pin)
{
- struct dt_ctx *ctx = container_of(nb, struct dt_ctx, nb);
- struct dpll_pin_notifier_info *info = data;
+ struct dt_ctx *ctx = kunit_get_current_test()->priv;
- if (action != DPLL_PIN_CHANGED)
- return NOTIFY_DONE;
- if (info->pin == ctx->p.pin)
+ if (pin == ctx->p.pin)
ctx->p.changes++;
- else if (info->pin == ctx->u.pin)
+ else if (pin == ctx->u.pin)
ctx->u.changes++;
- else if (info->pin == ctx->c.pin)
+ else if (pin == ctx->c.pin)
ctx->c.changes++;
- return NOTIFY_OK;
+ return 0;
}
static void dt_dev_init(struct kunit *test, struct dt_dev *dev, u64 clock_id,
@@ -235,10 +230,8 @@ static int dt_init(struct kunit *test)
ret = dpll_pin_link_add(ctx->c.pin, ctx->fwnode);
KUNIT_ASSERT_EQ(test, ret, 0);
- ctx->nb.notifier_call = dt_notify;
- ret = register_dpll_notifier(&ctx->nb);
- KUNIT_ASSERT_EQ(test, ret, 0);
- ctx->nb_registered = true;
+ kunit_activate_static_stub(test, __dpll_pin_change_ntf,
+ dt_pin_change_ntf);
return 0;
}
@@ -249,8 +242,6 @@ static void dt_exit(struct kunit *test)
if (!ctx)
return;
- if (ctx->nb_registered)
- unregister_dpll_notifier(&ctx->nb);
dt_unreg(&ctx->a0, &ctx->p, &ctx->p_a0);
dt_unreg(&ctx->a1, &ctx->p, &ctx->p_a1);
dt_unreg(&ctx->a0, &ctx->u, &ctx->u_a0);
diff --git a/include/linux/dpll.h b/include/linux/dpll.h
index 9eccfe41240418..1e5b940a245a7d 100644
--- a/include/linux/dpll.h
+++ b/include/linux/dpll.h
@@ -11,7 +11,6 @@
#include <linux/device.h>
#include <linux/netlink.h>
#include <linux/netdevice.h>
-#include <linux/notifier.h>
#include <linux/rtnetlink.h>
#include <net/netlink.h>
@@ -211,19 +210,6 @@ typedef struct ref_tracker *dpll_tracker;
typedef struct {} dpll_tracker;
#endif
-#define DPLL_PIN_CREATED 4
-#define DPLL_PIN_DELETED 5
-#define DPLL_PIN_CHANGED 6
-
-struct dpll_pin_notifier_info {
- struct dpll_pin *pin;
- u32 id;
- u32 idx;
- u64 clock_id;
- const struct fwnode_handle *fwnode;
- const struct dpll_pin_properties *prop;
-};
-
#if IS_ENABLED(CONFIG_DPLL)
void dpll_netdev_pin_set(struct net_device *dev, struct dpll_pin *dpll_pin);
void dpll_netdev_pin_clear(struct net_device *dev);
@@ -306,8 +292,4 @@ int dpll_device_change_ntf(struct dpll_device *dpll);
int __dpll_pin_change_ntf(struct dpll_pin *pin);
int dpll_pin_change_ntf(struct dpll_pin *pin);
-int register_dpll_notifier(struct notifier_block *nb);
-
-int unregister_dpll_notifier(struct notifier_block *nb);
-
#endif
--
2.56.1
next prev parent reply other threads:[~2026-11-26 20:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 20:32 [PATCH RFC net-next 00/19] dpll: single-owner pins, board wiring as pin links Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 01/19] dpll: add " Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 02/19] dpll: report " Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 03/19] dpll: notify linked pins when a pin is registered or unregistered Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 04/19] dpll: add KUnit tests for pin links Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 05/19] ice: dpll: use own pins for the TX and time references Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 06/19] ice: dpll: drop the filter of notifications from own registrations Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 07/19] dpll: register pins only with a DPLL of their owner Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 08/19] dpll: drop the state change exception for pins with a firmware node Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 09/19] dpll: drop the source clock id from pin notifications Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 10/19] dpll: drop device events from the in-kernel notifier Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 11/19] dpll: drop the cached module name of a pin Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 12/19] ice: dpll: track the E825 recovered clock routing in the adapter Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 13/19] ice: dpll: register the E825 recovered clock muxes as DPLL devices Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 14/19] ice: dpll: route the E825 recovered clock through the mux devices Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 15/19] dpll: register pins only with a parent pin of their owner Ivan Vecera
2026-11-26 20:32 ` Ivan Vecera [this message]
2026-11-26 20:32 ` [PATCH RFC net-next 17/19] dpll: require a registered DPLL for pin registration Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 18/19] dpll: drop the owner reference selection of pins Ivan Vecera
2026-11-26 20:32 ` [PATCH RFC net-next 19/19] dpll: add KUnit tests for the pin owner checks Ivan Vecera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126203231.934632-17-ivecera@redhat.com \
--to=ivecera@redhat.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@kernel.org \
--cc=grzegorz.nitka@intel.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jiri@resnulli.us \
--cc=karol.kolacinski@intel.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.li@microchip.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rdunlap@infradead.org \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox