]> 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)
commit45cd67c053591a2f036d270a8aceec505f6073aa
tree66e4737120f301838503d0cc8cd197ffabc85196
parentd7e5b0105a96552cf6abba34407b2c9d226463af
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