Skip to content

Commit f8f0de9

Browse files
committed
Merge branch 'mlx5-fixes'
Tariq Toukan says: ==================== mlx5 core fixes 20240603 This small patchset provides two bug fixes from the team to the mlx5 core driver. Series generated against: commit 33700a0 ("net/tcp: Don't consider TCP_CLOSE in TCP_AO_ESTABLISHED") ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents c57e558 + c8b3f38 commit f8f0de9

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/fw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ int mlx5_cmd_fast_teardown_hca(struct mlx5_core_dev *dev)
373373
do {
374374
if (mlx5_get_nic_state(dev) == MLX5_INITIAL_SEG_NIC_INTERFACE_DISABLED)
375375
break;
376+
if (pci_channel_offline(dev->pdev)) {
377+
mlx5_core_err(dev, "PCI channel offline, stop waiting for NIC IFC\n");
378+
return -EACCES;
379+
}
376380

377381
cond_resched();
378382
} while (!time_after(jiffies, end));

drivers/net/ethernet/mellanox/mlx5/core/health.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ void mlx5_error_sw_reset(struct mlx5_core_dev *dev)
248248
do {
249249
if (mlx5_get_nic_state(dev) == MLX5_INITIAL_SEG_NIC_INTERFACE_DISABLED)
250250
break;
251+
if (pci_channel_offline(dev->pdev)) {
252+
mlx5_core_err(dev, "PCI channel offline, stop waiting for NIC IFC\n");
253+
goto unlock;
254+
}
251255

252256
msleep(20);
253257
} while (!time_after(jiffies, end));
@@ -317,6 +321,10 @@ int mlx5_health_wait_pci_up(struct mlx5_core_dev *dev)
317321
mlx5_core_warn(dev, "device is being removed, stop waiting for PCI\n");
318322
return -ENODEV;
319323
}
324+
if (pci_channel_offline(dev->pdev)) {
325+
mlx5_core_err(dev, "PCI channel offline, stop waiting for PCI\n");
326+
return -EACCES;
327+
}
320328
msleep(100);
321329
}
322330
return 0;

drivers/net/ethernet/mellanox/mlx5/core/lib/pci_vsc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ int mlx5_vsc_gw_lock(struct mlx5_core_dev *dev)
7474
ret = -EBUSY;
7575
goto pci_unlock;
7676
}
77+
if (pci_channel_offline(dev->pdev)) {
78+
ret = -EACCES;
79+
goto pci_unlock;
80+
}
7781

7882
/* Check if semaphore is already locked */
7983
ret = vsc_read(dev, VSC_SEMAPHORE_OFFSET, &lock_val);

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,9 @@ static int mlx5_function_teardown(struct mlx5_core_dev *dev, bool boot)
12981298

12991299
if (!err)
13001300
mlx5_function_disable(dev, boot);
1301+
else
1302+
mlx5_stop_health_poll(dev, boot);
1303+
13011304
return err;
13021305
}
13031306

0 commit comments

Comments
 (0)