mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: github@szelinsky.de
Cc: o.rempel@pengutronix.de, kory.maincent@bootlin.com,
	andrew+netdev@lunn.ch, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, corey@leavitt.info,
	jelonek.jonas@gmail.com, horms@kernel.org, olek2@wp.pl,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 1/5] net: pse-pd: add notifier chain for controller lifecycle events
Date: Wed, 09 Sep 2026 06:33:15 +0000	[thread overview]
Message-ID: <178893559565.219967.17359688741683052582@kernel.org> (raw)
In-Reply-To: <20260906153102.959217-2-github@szelinsky.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 1

- [Low] Claim: the patch adds a blocking notifier chain and two
  EXPORT_SYMBOL_GPL() entry points…

--

net: pse-pd: add notifier chain for controller lifecycle events

This adds a blocking notifier chain to pse_core along with
pse_register_notifier() and pse_unregister_notifier() as the subscriber
interface, plus enum pse_controller_event describing PSE_REGISTERED and
PSE_UNREGISTERED. Nothing fires the chain and nothing subscribes to it in
this patch.

No Link: tags present in the commit header.

> diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
> index 69dbdbde9d71a..3c4d09f1d6e4f 100644
> --- a/drivers/net/pse-pd/pse_core.c
> +++ b/drivers/net/pse-pd/pse_core.c

[ ... ]

> @@ -23,6 +24,39 @@ static LIST_HEAD(pse_controller_list);
>  static DEFINE_XARRAY_ALLOC(pse_pw_d_map);
>  static DEFINE_MUTEX(pse_pw_d_mutex);
>  
> +static BLOCKING_NOTIFIER_HEAD(pse_controller_notifier);
> +
> +/**
> + * pse_register_notifier - register a callback for PSE controller events
> + * @nb: notifier block to register
> + *
> + * See enum pse_controller_event for events fired and their subscriber
> + * contract. Callbacks run in process context; they may sleep, take
> + * rtnl, and call of_pse_control_get(). The chain fires synchronously,
> + * so a PSE controller driver's probe/unbind path must not hold any
> + * such lock when calling pse_controller_register() or
> + * pse_controller_unregister().
> + *
> + * Return: 0 on success, negative error code otherwise.
> + */
> +int pse_register_notifier(struct notifier_block *nb)
> +{
> +	return blocking_notifier_chain_register(&pse_controller_notifier, nb);
> +}
> +EXPORT_SYMBOL_GPL(pse_register_notifier);
> +
> +/**
> + * pse_unregister_notifier - unregister a previously registered callback
> + * @nb: notifier block previously passed to pse_register_notifier()
> + *
> + * Return: 0 on success, negative error code otherwise.
> + */
> +int pse_unregister_notifier(struct notifier_block *nb)
> +{
> +	return blocking_notifier_chain_unregister(&pse_controller_notifier, nb);
> +}
> +EXPORT_SYMBOL_GPL(pse_unregister_notifier);

[Severity: Low]
This isn't a bug, just a note on something that stood out while reading the
patch on its own.

At this commit, pse_register_notifier() and pse_unregister_notifier() in
drivers/net/pse-pd/pse_core.c are exported with no in-tree caller, and the
event-data contract documented for enum pse_controller_event has no producer
yet, so the documented semantics cannot be checked from this patch alone.

Following the series forward, the producer side shows up in the next commit,
with pse_controller_register() and pse_controller_unregister() doing:

	blocking_notifier_call_chain(&pse_controller_notifier,
				     PSE_REGISTERED, pcdev);

	blocking_notifier_call_chain(&pse_controller_notifier,
				     PSE_UNREGISTERED, pcdev);

and the first subscriber lands in phy_init() in drivers/net/phy/phy_device.c:

	rc = pse_register_notifier(&phy_pse_notifier);

Both call sites pass pcdev, which matches what the kerneldoc for enum
pse_controller_event promises, and the commit message states outright that
nothing fires or subscribes yet.

So nothing to fix here, this is the usual "add the API, then use it" split.

[ ... ]

> diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h
> index 4e5696cfade7c..78fe3a2b1ea84 100644
> --- a/include/linux/pse-pd/pse.h
> +++ b/include/linux/pse-pd/pse.h

[ ... ]

> @@ -366,6 +385,9 @@ int pse_ethtool_set_prio(struct pse_control *psec,
>  bool pse_has_podl(struct pse_control *psec);
>  bool pse_has_c33(struct pse_control *psec);
>  
> +int pse_register_notifier(struct notifier_block *nb);
> +int pse_unregister_notifier(struct notifier_block *nb);
> +
>  #else

[ ... ]

No other regressions found.  The CONFIG_PSE_CONTROLLER=n stubs returning 0
match the existing stub style in include/linux/pse-pd/pse.h, and placing
enum pse_controller_event outside the IS_ENABLED() guard is consistent with
the stated goal of letting subscribers reference the values in dead-code
paths.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260906153102.959217-1-github%40szelinsky.de

  reply	other threads:[~2026-09-09  6:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06 15:30 [PATCH net-next v6 0/5] net: pse-pd: decouple controller lookup from MDIO probe Carlo Szelinsky
2026-09-06 15:30 ` [PATCH net-next v6 1/5] net: pse-pd: add notifier chain for controller lifecycle events Carlo Szelinsky
2026-09-09  6:33   ` netdev-bot+sashiko [this message]
2026-09-06 15:30 ` [PATCH net-next v6 2/5] net: pse-pd: fire lifecycle events on controller register/unregister Carlo Szelinsky
2026-09-09  6:33   ` netdev-bot+sashiko
2026-09-06 15:31 ` [PATCH net-next v6 3/5] net: phy: own phydev->psec via PSE notifier and remove fwnode_mdio hook Carlo Szelinsky
2026-09-09  6:33   ` netdev-bot+sashiko
2026-09-06 15:31 ` [PATCH net-next v6 4/5] net: phy: use a dedicated mutex instead of rtnl for PSE control attach Carlo Szelinsky
2026-09-09  6:33   ` netdev-bot+sashiko
2026-09-06 15:31 ` [PATCH net-next v6 5/5] net: phy: release phydev->psec from phy_device_remove() again Carlo Szelinsky
2026-09-09  6:33   ` netdev-bot+sashiko
2026-09-10  9:06 ` [PATCH net-next v6 0/5] net: pse-pd: decouple controller lookup from MDIO probe Paolo Abeni

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=178893559565.219967.17359688741683052582@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=corey@leavitt.info \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=github@szelinsky.de \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jelonek.jonas@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olek2@wp.pl \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®