]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r347323:
authorhselasky <hselasky@FreeBSD.org>
Thu, 16 May 2019 18:28:12 +0000 (18:28 +0000)
committerhselasky <hselasky@FreeBSD.org>
Thu, 16 May 2019 18:28:12 +0000 (18:28 +0000)
commit691d23b6c51cd390fd17369ebbdc1bdc7c3b61c3
tree619a3d9f2b6526fa4db422007d28c11b62edb885
parentbc640b851af6574e73354d80fb809f3fe3f1a85e
MFC r347323:
Fix race between driver unload and dumping firmware in mlx5core.

Present code uses lock-less accesses to the dump data to prevent top
level ioctls from blocking bottom-level call to dump.  Unfortunately, this
depends on the type stability of the dump data structure, which makes it
non-functional during driver teardown.

Switch to the mutex locking scheme where top levels use the mutex in the
bound regions, while copyouts and drain for completion utilize condvars.
The mutex lifetime is guaranteed to be strictly larger than the time
interval where driver can initiate dump, and most of the control fields
of the old struct mlx5_dump_data are directly embedded into struct
mlx5_core_dev.

Submitted by: kib@
Sponsored by: Mellanox Technologies
sys/dev/mlx5/driver.h
sys/dev/mlx5/mlx5_core/mlx5_fwdump.c
sys/dev/mlx5/mlx5_core/mlx5_main.c