From: Jason Gunthorpe Date: Tue, 31 Oct 2023 13:54:48 +0000 (-0300) Subject: Merge tag 'v6.6' into rdma.git for-next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=162e3480246ef69386d4647d2320d86741bf08a2;p=linux.git Merge tag 'v6.6' into rdma.git for-next Resolve conflict by taking the spin_lock hunk from for-next: https://lore.kernel.org/r/20230928113851.5197a1ec@canb.auug.org.au Required for the next patch. Signed-off-by: Jason Gunthorpe --- 162e3480246ef69386d4647d2320d86741bf08a2 diff --cc drivers/infiniband/hw/mlx5/mr.c index b0fa2d6449736,8a3762d9ff58c..1d6c54a53df62 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@@ -1001,12 -1028,17 +1002,17 @@@ void mlx5_mkey_cache_cleanup(struct mlx mutex_lock(&dev->cache.rb_lock); for (node = rb_first(root); node; node = rb_next(node)) { ent = rb_entry(node, struct mlx5_cache_ent, node); - xa_lock_irq(&ent->mkeys); + spin_lock_irq(&ent->mkeys_queue.lock); ent->disabled = true; - xa_unlock_irq(&ent->mkeys); + spin_unlock_irq(&ent->mkeys_queue.lock); - cancel_delayed_work_sync(&ent->dwork); } + mutex_unlock(&dev->cache.rb_lock); + + /* + * After all entries are disabled and will not reschedule on WQ, + * flush it and all async commands. + */ + flush_workqueue(dev->cache.wq); mlx5_mkey_cache_debugfs_cleanup(dev); mlx5_cmd_cleanup_async_ctx(&dev->async_ctx);