OpenCloudOS-Kernel/drivers/misc/habanalabs
Dani Liberman c37803388c habanalabs: handle race in driver fini
Scenario:

1. During hard reset, driver executes device_kill_open_processes.
2. Drivers file descriptor is not closed yet (user process is alive),
   hence we are starting loop on all open file descriptors.
3. Just before getting task struct of user process, according to
   pid, SIGKILL is sent to the user process, hence get_pid_task
   fails, driver prints a warning and device_kill_open_processes
   returns an error.
4. Returned error causing driver fini do disable the device object
   of the process which causes a kernel crash.

The fix is to handle this case not as an error and continue fini flow
as normal, since the killed process (by the SIGKILL) will release its
resources just like it will do when the driver sends him the sigkill.

Signed-off-by: Dani Liberman <dliberman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-22 21:01:20 +02:00
..
common habanalabs: handle race in driver fini 2022-05-22 21:01:20 +02:00
gaudi habanalabs: add device memory scrub ability through debugfs 2022-05-22 21:01:20 +02:00
goya habanalabs: add device memory scrub ability through debugfs 2022-05-22 21:01:20 +02:00
include habanalabs/gaudi: add debugfs to fetch internal sync status 2022-05-22 20:57:37 +02:00
Kconfig habanalabs: select CRC32 2021-10-18 12:05:47 +03:00
Makefile habanalabs: create common folder 2020-07-24 20:31:37 +03:00