Skip to contentSkip to conversation

net/mlx5: Continue driver initialization despite debugfs failure

PATCH Applied Leon Romanovsky 2 participants 2 messages Dec 13, 2018 – Dec 17, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: Continue driver initialization despite debugfs failure

From: Leon Romanovsky <[email protected]>

The failure to create debugfs entry is unpleasant event, but not enough to abort drier initialization. Align the mlx5_core code to debugfs design and continue execution whenever debugfs_create_dir() successes or not.

Fixes e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")

---
It goes to -next and not to -rc, because this issue was forever.

---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +3 -5
index 778995573812..93fa48a7eabb 100644
@@ -661,11 +661,9 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
 
 	priv->numa_node = dev_to_node(&dev->pdev->dev);
 
-	priv->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), mlx5_debugfs_root);
-	if (!priv->dbg_root) {
-		dev_err(&pdev->dev, "Cannot create debugfs dir, aborting\n");
-		return -ENOMEM;
-	}
+	if (mlx5_debugfs_root)
+		priv->dbg_root =
+			debugfs_create_dir(pci_name(pdev), mlx5_debugfs_root);
 
 	err = mlx5_pci_enable_device(dev);
 	if (err) {
#1 lore raw
Quoted 9 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

The failure to create debugfs entry is unpleasant event, but not enough
to abort drier initialization. Align the mlx5_core code to debugfs design
and continue execution whenever debugfs_create_dir() successes or not.

Quoted 5 lines
Fixes e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB

adapters")

Applied to mlx5-next.

Thanks.