From: sashiko-bot@kernel.org
To: "Tariq Toukan" <tariqt@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next V2 02/13] net/mlx5: Detach auxiliary devices on attach failure during load
Date: Wed, 11 Nov 2026 18:40:30 +0000 [thread overview]
Message-ID: <sashiko-outbox-209470@kernel.org> (raw)
In-Reply-To: <20261110183826.2927274-3-tariqt@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] net/mlx5: pass suspend=false to mlx5_detach_device() on
err_attach path
--
commit c641732ab192276884adbc4d8e49ff0e43bff599
Author: Dragos Tatulea <dtatulea@nvidia.com>
net/mlx5: Detach auxiliary devices on attach failure during load
This commit calls mlx5_detach_device() on the error path in
mlx5_load_one_devl_locked() when mlx5_attach_device() fails.
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> index 1a45474ce03db..7e762f72b19ef 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> @@ -1547,6 +1547,7 @@ int mlx5_load_one_devl_locked(struct mlx5_core_dev *dev, bool recovery)
> return 0;
>
> err_attach:
> + mlx5_detach_device(dev, true);
> clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
> mlx5_unload(dev);
> err_load:
[Severity: High]
Should this pass suspend = false instead of true to mlx5_detach_device()?
When suspend is true, mlx5_detach_device() invokes adrv->suspend() and
skips del_adev() for auxiliary drivers that implement .suspend (eth and
dpll), leaving those auxiliary devices registered while mlx5_unload() and
mlx5_function_teardown() tear down the core device:
drivers/net/ethernet/mellanox/mlx5/core/dev.c:mlx5_detach_device() {
...
if (adrv->suspend && suspend) {
adrv->suspend(adev, pm);
continue;
}
skip_suspend:
del_adev(&priv->adev[i]->adev);
priv->adev[i] = NULL;
...
}
For dpll, mlx5_dpll_suspend() is a no-op, so its periodic delayed work
mdpll->work remains active and continues issuing firmware commands against
the torn-down core device. For eth, suspending instead of deleting leaves
the netdev registered with MLX5E_STATE_DESTROYING set after destroying
mdev_resources, which causes a later _mlx5e_remove() -> _mlx5e_suspend()
to destroy mdev_resources a second time, and on a Socket-Direct secondary
mlx5e_suspend() clears mdev->sd so a subsequent mlx5e_remove()
dereferences NULL drvdata on the secondary adev.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110183826.2927274-1-tariqt@nvidia.com?part=2
next prev parent reply other threads:[~2026-11-11 18:40 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 18:38 [PATCH net-next V2 00/13] net/mlx5e: Add netdev support for data direct Tariq Toukan
2026-11-10 18:38 ` [PATCH net-next V2 01/13] net/mlx5: Log the data direct to PF device mapping Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-10 18:38 ` [PATCH net-next V2 02/13] net/mlx5: Detach auxiliary devices on attach failure during load Tariq Toukan
2026-11-11 18:40 ` sashiko-bot [this message]
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 03/13] net/mlx5e: Register supported netdevs as data direct users Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-10 18:38 ` [PATCH net-next V2 04/13] net/mlx5e: Pre-calculate UMR padding and entry size Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-10 18:38 ` [PATCH net-next V2 05/13] net/mlx5e: Add data direct ethtool private flag Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-10 18:38 ` [PATCH net-next V2 06/13] net/mlx5e: Add data direct RX infrastructure Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 07/13] net/mlx5e: SHAMPO, Use page_pool DMA sync helper for SKB frags Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 08/13] net/mlx5e: Add data direct TX infrastructure Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-10 18:38 ` [PATCH net-next V2 09/13] net/mlx5e: Use the correct DMA dev when data_direct is enabled Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 10/13] net: devmem: add netdev_has_dmabuf_binding() helper Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-11 21:46 ` Stanislav Fomichev
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 11/13] net: add netdev_unbind_dma_dev() helper Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 12/13] net/mlx5e: Disable data direct on data direct device unbind Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
2026-11-12 9:40 ` netdev-bot+sashiko
2026-11-10 18:38 ` [PATCH net-next V2 13/13] net/mlx5e: Enable the data direct netdev feature Tariq Toukan
2026-11-11 18:40 ` sashiko-bot
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=sashiko-outbox-209470@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tariqt@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.