]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
IB/mlx5: Fix MR cache initialization
authorArtemy Kovalyov <artemyko@mellanox.com>
Mon, 15 Oct 2018 11:13:35 +0000 (14:13 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:57:14 +0000 (19:57 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836802
commit 013c2403bf32e48119aeb13126929f81352cc7ac upstream.

Schedule MR cache work only after bucket was initialized.

Cc: <stable@vger.kernel.org> # 4.10
Fixes: 49780d42dfc9 ("IB/mlx5: Expose MR cache for mlx5_ib")
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Reviewed-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/hw/mlx5/mr.c

index 3ea59fe907d7ef84631ae713502a8c602b3d6948..44a990374c46c8b584545999154a71a2a5680ee4 100644 (file)
@@ -662,7 +662,6 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)
                init_completion(&ent->compl);
                INIT_WORK(&ent->work, cache_work_func);
                INIT_DELAYED_WORK(&ent->dwork, delayed_cache_work_func);
-               queue_work(cache->wq, &ent->work);
 
                if (i > MR_CACHE_LAST_STD_ENTRY) {
                        mlx5_odp_init_mr_cache_entry(ent);
@@ -681,6 +680,7 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)
                        ent->limit = dev->mdev->profile->mr_cache[i].limit;
                else
                        ent->limit = 0;
+               queue_work(cache->wq, &ent->work);
        }
 
        err = mlx5_mr_cache_debugfs_init(dev);