]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Oct 2023 10:32:36 +0000 (12:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Oct 2023 10:32:36 +0000 (12:32 +0200)
added patches:
rdma-mlx5-remove-not-used-cache-disable-flag.patch

queue-6.5/rdma-mlx5-remove-not-used-cache-disable-flag.patch [new file with mode: 0644]
queue-6.5/series

diff --git a/queue-6.5/rdma-mlx5-remove-not-used-cache-disable-flag.patch b/queue-6.5/rdma-mlx5-remove-not-used-cache-disable-flag.patch
new file mode 100644 (file)
index 0000000..777658f
--- /dev/null
@@ -0,0 +1,53 @@
+From c99a7457e5bb873914a74307ba2df85f6799203b Mon Sep 17 00:00:00 2001
+From: Leon Romanovsky <leonro@nvidia.com>
+Date: Thu, 28 Sep 2023 20:20:47 +0300
+Subject: RDMA/mlx5: Remove not-used cache disable flag
+
+From: Leon Romanovsky <leonro@nvidia.com>
+
+commit c99a7457e5bb873914a74307ba2df85f6799203b upstream.
+
+During execution of mlx5_mkey_cache_cleanup(), there is a guarantee
+that MR are not registered and/or destroyed. It means that we don't
+need newly introduced cache disable flag.
+
+Fixes: 374012b00457 ("RDMA/mlx5: Fix mkey cache possible deadlock on cleanup")
+Link: https://lore.kernel.org/r/c7e9c9f98c8ae4a7413d97d9349b29f5b0a23dbe.1695921626.git.leon@kernel.org
+Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/infiniband/hw/mlx5/mlx5_ib.h |    1 -
+ drivers/infiniband/hw/mlx5/mr.c      |    5 -----
+ 2 files changed, 6 deletions(-)
+
+--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
++++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
+@@ -797,7 +797,6 @@ struct mlx5_mkey_cache {
+       struct dentry           *fs_root;
+       unsigned long           last_add;
+       struct delayed_work     remove_ent_dwork;
+-      u8                      disable: 1;
+ };
+ struct mlx5_ib_port_resources {
+--- a/drivers/infiniband/hw/mlx5/mr.c
++++ b/drivers/infiniband/hw/mlx5/mr.c
+@@ -1026,7 +1026,6 @@ void mlx5_mkey_cache_cleanup(struct mlx5
+               return;
+       mutex_lock(&dev->cache.rb_lock);
+-      dev->cache.disable = true;
+       for (node = rb_first(root); node; node = rb_next(node)) {
+               ent = rb_entry(node, struct mlx5_cache_ent, node);
+               xa_lock_irq(&ent->mkeys);
+@@ -1824,10 +1823,6 @@ static int cache_ent_find_and_store(stru
+       }
+       mutex_lock(&cache->rb_lock);
+-      if (cache->disable) {
+-              mutex_unlock(&cache->rb_lock);
+-              return 0;
+-      }
+       ent = mkey_cache_ent_from_rb_key(dev, mr->mmkey.rb_key);
+       if (ent) {
+               if (ent->rb_key.ndescs == mr->mmkey.rb_key.ndescs) {
index 87940c8c32e0590a5deb9030f3774548a297e8af..a53b4f38bc8bc9fdc2470d5d0f1520c2fababb7b 100644 (file)
@@ -160,3 +160,4 @@ x86-sev-use-the-ghcb-protocol-when-available-for-snp-cpuid-requests.patch
 ksmbd-fix-race-condition-between-session-lookup-and-expire.patch
 ksmbd-fix-uaf-in-smb20_oplock_break_ack.patch
 ksmbd-fix-race-condition-from-parallel-smb2-lock-requests.patch
+rdma-mlx5-remove-not-used-cache-disable-flag.patch