Skip to content

Commit a6681cd

Browse files
Hakon-BuggeSaeed Mirzamohammadi
authored andcommitted
IB/mlx5: Disable BME for unbound devices too
Commit e51fa3d057e5 ("IB/mlx5: Disable BME on panic") disables PCI Bus Master Enable for devices when the kernel panics, by traversing the mlx5 IB driver's dev_list. However, when a device is unbound, the device is removed from said list and moved to an unaffiliated list. Therefore, we will also traverse the unaffiliated list in addition to the dev_list in order to make sure all VFs are silenced. Orabug: 34395378 Fixes: e51fa3d057e5 ("IB/mlx5: Disable BME on panic") Signed-off-by: Håkon Bugge <[email protected]> Tested-by: Aiman Al-Khammash <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Saeed Mirzamohammadi <[email protected]>
1 parent d79af93 commit a6681cd

File tree

1 file changed

+9
-0
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+9
-0
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3637,6 +3637,7 @@ static int mlx5_ib_panic_handler(struct notifier_block *nb,
36373637
unsigned long action, void *unused)
36383638
{
36393639
struct mlx5_ib_dev *dev;
3640+
struct mlx5_ib_multiport_info *mpi;
36403641

36413642
list_for_each_entry(dev, &mlx5_ib_dev_list, ib_dev_list) {
36423643
struct pci_dev *pdev = dev->mdev->pdev;
@@ -3645,6 +3646,14 @@ static int mlx5_ib_panic_handler(struct notifier_block *nb,
36453646
pci_clear_master(pdev);
36463647
}
36473648

3649+
/* Unbound devices are moved to the unaffiliated list */
3650+
list_for_each_entry(mpi, &mlx5_ib_unaffiliated_port_list, list) {
3651+
struct pci_dev *pdev = mpi->mdev->pdev;
3652+
3653+
pci_crit(pdev, "Revoke Bus_Mastership_Enable (BME) for unbound device\n");
3654+
pci_clear_master(pdev);
3655+
}
3656+
36483657
return NOTIFY_DONE;
36493658
}
36503659

0 commit comments

Comments
 (0)