]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
RDMA/mlx5: Lock access to ent->available_mrs/limit when doing queue_work
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 10 Mar 2020 08:22:35 +0000 (10:22 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 13 Mar 2020 14:08:01 +0000 (11:08 -0300)
commitad2d3ef46d2a88f2906d8d0cc6b912199ec3f1d6
treee340c15843e1aa47281a4eebe0b2fa31a3781f62
parenta1d8854aae4ee19df6161a276a99d3c9c2abc4f3
RDMA/mlx5: Lock access to ent->available_mrs/limit when doing queue_work

Accesses to these members needs to be locked. There is no reason not to
hold a spinlock while calling queue_work(), so move the tests into a
helper and always call it under lock.

The helper should be called when available_mrs is adjusted.

Link: https://lore.kernel.org/r/20200310082238.239865-10-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/mr.c