]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add mutual exclusion mechanism for software reset of firmware in mlx5core.
authorhselasky <hselasky@FreeBSD.org>
Fri, 23 Mar 2018 18:32:03 +0000 (18:32 +0000)
committerhselasky <hselasky@FreeBSD.org>
Fri, 23 Mar 2018 18:32:03 +0000 (18:32 +0000)
commit122dd82620ea71937b680e61383e89283870cbb1
treef0d32aaf6a39ebc6011281359fb21241da42ccfd
parent174f956d99c8351a87541ac24105b6140d662555
Add mutual exclusion mechanism for software reset of firmware in mlx5core.

Since the FW can be shared between PCI functions it is common that
more than one health poll will detected a failure, this can lead to
multiple resets.

The solution is to use a FW locking mechanism using semaphore space to
provide a way to synchronize between functions. The FW semaphore is
acquired via config cycle access. First the VSEC gateway must be
acquired, then the semaphore can be locked by writing a value to it
and confirmed it's locked by reading the same value back. The process
in the same to free the semaphore, except the value written should be
zero.

Submitted by: slavash@
MFC after: 1 week
Sponsored by: Mellanox Technologies
sys/conf/files
sys/dev/mlx5/driver.h
sys/dev/mlx5/mlx5_core/mlx5_core.h
sys/dev/mlx5/mlx5_core/mlx5_crspace.c [new file with mode: 0644]
sys/dev/mlx5/mlx5_core/mlx5_health.c
sys/dev/mlx5/mlx5_core/mlx5_main.c
sys/modules/mlx5/Makefile