]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Make mlx5_cmd_exec_cb() a safe API
authorJason Gunthorpe <jgg@mellanox.com>
Sat, 19 Jan 2019 00:33:10 +0000 (16:33 -0800)
committerLeon Romanovsky <leonro@mellanox.com>
Thu, 24 Jan 2019 12:25:26 +0000 (14:25 +0200)
commit68b50aa3c1539a87df5970c2241ce5b0805e9b5c
tree66e4737120f301838503d0cc8cd197ffabc85196
parent34cb352433b4d10c9008ff76aa0c6685f2f99e37
net/mlx5: Make mlx5_cmd_exec_cb() a safe API

APIs that have deferred callbacks should have some kind of cleanup
function that callers can use to fence the callbacks. Otherwise things
like module unloading can lead to dangling function pointers, or worse.

The IB MR code is the only place that calls this function and had a
really poor attempt at creating this fence. Provide a good version in
the core code as future patches will add more places that need this
fence.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/mr.c
include/linux/mlx5/driver.h