]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Read embedded cpu bit only once
authorParav Pandit <parav@mellanox.com>
Mon, 9 Mar 2020 02:41:22 +0000 (21:41 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 20 Apr 2020 21:20:21 +0000 (14:20 -0700)
Embedded CPU bit doesn't change with PCI resume/suspend.
Hence read it only once while probing the PCI device.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c

index 7af4210c1b967aa5375b3d423872d9dafdd6c82e..5a97e98e937c37ca7e3e1b11b94565630fe9b058 100644 (file)
@@ -782,7 +782,7 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
        }
 
        mlx5_pci_vsc_init(dev);
-
+       dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
        return 0;
 
 err_clr_master:
@@ -1180,7 +1180,6 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
 {
        int err = 0;
 
-       dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
        mutex_lock(&dev->intf_state_mutex);
        if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
                mlx5_core_warn(dev, "interface is up, NOP\n");