Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mlx5: Fix MR cache initialization

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>

authored by

Artemy Kovalyov and committed by
Jason Gunthorpe
013c2403 e54b6a3b

+1 -1
+1 -1
drivers/infiniband/hw/mlx5/mr.c
··· 691 691 init_completion(&ent->compl); 692 692 INIT_WORK(&ent->work, cache_work_func); 693 693 INIT_DELAYED_WORK(&ent->dwork, delayed_cache_work_func); 694 - queue_work(cache->wq, &ent->work); 695 694 696 695 if (i > MR_CACHE_LAST_STD_ENTRY) { 697 696 mlx5_odp_init_mr_cache_entry(ent); ··· 710 711 ent->limit = dev->mdev->profile->mr_cache[i].limit; 711 712 else 712 713 ent->limit = 0; 714 + queue_work(cache->wq, &ent->work); 713 715 } 714 716 715 717 err = mlx5_mr_cache_debugfs_init(dev);