From: Petr Oros <poros@redhat.com>
To: Ivan Vecera <ivecera@redhat.com>, netdev@vger.kernel.org
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Milena Olech <milena.olech@intel.com>,
Michal Michalik <michal.michalik@intel.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH net] dpll: send the device delete notification on the last unregistration
Date: Tue, 1 Dec 2026 09:14:26 +0100 [thread overview]
Message-ID: <dd939f44-181f-4e68-abb9-271c88bb1b47@redhat.com> (raw)
In-Reply-To: <20261125170234.294969-1-ivecera@redhat.com>
On 11/25/26 6:02 PM, Ivan Vecera wrote:
> A DPLL device can be registered more than once. mlx5 does this when
> several functions of one NIC share a device. dpll_device_register()
> sends the create notification only on the first registration, but
> dpll_device_unregister() sends the delete notification on every
> unregistration. Removing one function then tells userspace that the
> device is gone while it is still registered and still listed by
> device-get.
>
> Send the delete notification only when the last registration goes
> away. Send it before that registration is removed, so the message can
> still be filled.
>
> Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
> drivers/dpll/dpll_core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index 277692d12d3d1e..c32e59f3e25afa 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -534,12 +534,14 @@ void dpll_device_unregister(struct dpll_device *dpll,
>
> mutex_lock(&dpll_lock);
> ASSERT_DPLL_REGISTERED(dpll);
> - dpll_device_delete_ntf(dpll);
> reg = dpll_device_registration_find(dpll, ops, priv);
> if (WARN_ON(!reg)) {
> mutex_unlock(&dpll_lock);
> return;
> }
> + /* The device goes away with its last registration */
> + if (list_is_singular(&dpll->registration_list))
> + dpll_device_delete_ntf(dpll);
> list_del(®->list);
> __dpll_device_put(dpll, ®->tracker);
> kfree(reg);
>
> base-commit: 7ed616970b652ae76d99a01b468588e491021648
Reviewed-by: Petr Oros <poros@redhat.com>
prev parent reply other threads:[~2026-12-01 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 17:02 [PATCH net] dpll: send the device delete notification on the last unregistration Ivan Vecera
2026-11-25 17:07 ` netdev-bot+sinfo
2026-11-25 17:32 ` Ivan Vecera
2026-12-01 8:14 ` Petr Oros [this message]
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=dd939f44-181f-4e68-abb9-271c88bb1b47@redhat.com \
--to=poros@redhat.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=michal.michalik@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--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