All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load
@ 2026-12-02 12:24 Tariq Toukan
  2026-12-02 12:28 ` netdev-bot+sinfo
  2026-12-02 12:31 ` sashiko-bot
  0 siblings, 2 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-12-02 12:24 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Willem de Bruijn
  Cc: Dragos Tatulea, Gal Pressman, Leon Romanovsky, linux-rdma,
	Mark Bloch, Nimrod Oren, Saeed Mahameed, Tariq Toukan

From: Dragos Tatulea <dtatulea@nvidia.com>

The device attach phase fails in mlx5_load_one_devl_locked() when
the first device fails to attach. The error path doesn't detach
the remaining devices that successfully attached.

Fix the above condition by properly calling detach on the error
path.

This issue was found during code inspection and was not reproduced.

Fixes: a925b5e309c9 ("net/mlx5: Register mlx5 devices to auxiliary virtual bus")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
 1 file changed, 1 insertion(+)

V3:
- Taken out of a larger series.
- Targeted net branch.
- Added the Fixes tag (a925b5e309c9) and Reviewed-by from Nimrod Oren.
- Pass false instead of true to mlx5_detach_device() in the attach error
  path.

V2:
https://lore.kernel.org/all/20261110183826.2927274-3-tariqt@nvidia.com/

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 0439fcfb9ce5..64ea9f720f2c 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, false);
 	clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
 	mlx5_unload(dev);
 err_load:
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load
  2026-12-02 12:24 [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load Tariq Toukan
@ 2026-12-02 12:28 ` netdev-bot+sinfo
  2026-12-02 12:31 ` sashiko-bot
  1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-12-02 12:28 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Willem de Bruijn, Dragos Tatulea,
	Gal Pressman, Leon Romanovsky, linux-rdma, Mark Bloch,
	Nimrod Oren, Saeed Mahameed

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load
  2026-12-02 12:24 [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load Tariq Toukan
  2026-12-02 12:28 ` netdev-bot+sinfo
@ 2026-12-02 12:31 ` sashiko-bot
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-02 12:31 UTC (permalink / raw)
  To: Tariq Toukan; +Cc: linux-rdma

> From: Dragos Tatulea <dtatulea@nvidia.com>
> 
> The device attach phase fails in mlx5_load_one_devl_locked() when
> the first device fails to attach. The error path doesn't detach
> the remaining devices that successfully attached.
> 
> Fix the above condition by properly calling detach on the error
> path.
> 
> This issue was found during code inspection and was not reproduced.
> 
> Fixes: a925b5e309c9 ("net/mlx5: Register mlx5 devices to auxiliary virtual bus")
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> Reviewed-by: Nimrod Oren <noren@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202122425.3433355-1-tariqt@nvidia.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-02 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 12:24 [PATCH net V3] net/mlx5: Detach auxiliary devices on attach failure during load Tariq Toukan
2026-12-02 12:28 ` netdev-bot+sinfo
2026-12-02 12:31 ` sashiko-bot

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.