OpenCloudOS-Kernel/drivers/misc/habanalabs/common
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
..
mmu habanalabs: refactor HOP functions in MMU V1 2022-05-22 21:01:17 +02:00
pci habanalabs: modify dma_mask to be ASIC specific property 2022-05-22 20:57:35 +02:00
Makefile habanalabs: unified memory manager infrastructure 2022-05-22 20:57:36 +02:00
asid.c habanalabs: replace WARN/WARN_ON with dev_crit in driver 2021-01-27 21:03:49 +02:00
command_buffer.c habanalabs: use unified memory manager for CB flow 2022-05-22 21:01:19 +02:00
command_submission.c habanalabs: use unified memory manager for CB flow 2022-05-22 21:01:19 +02:00
context.c habanalabs: keep control device alive during hard reset 2021-12-26 08:59:09 +02:00
debugfs.c habanalabs: add device memory scrub ability through debugfs 2022-05-22 21:01:20 +02:00
device.c habanalabs: handle race in driver fini 2022-05-22 21:01:20 +02:00
firmware_if.c habanalabs: Add separate poll interval value for protocol 2022-05-22 21:01:19 +02:00
habanalabs.h habanalabs: add device memory scrub ability through debugfs 2022-05-22 21:01:20 +02:00
habanalabs_drv.c habanalabs: add device memory scrub ability through debugfs 2022-05-22 21:01:20 +02:00
habanalabs_ioctl.c habanalabs: expose compute ctx status through info ioctl 2022-05-22 20:57:34 +02:00
hw_queue.c habanalabs: save ctx inside encaps signal 2021-12-26 08:59:08 +02:00
hwmon.c habanalabs: fix hwmon handling for legacy f/w 2021-12-26 08:59:09 +02:00
irq.c habanalabs: remove user interrupt debug print 2022-05-22 21:01:17 +02:00
memory.c habanalabs: hide memory manager page shift 2022-05-22 21:01:19 +02:00
memory_mgr.c habanalabs: add put by handle method to memory manager 2022-05-22 21:01:19 +02:00
state_dump.c habanalabs: state dump monitors and fences infrastructure 2021-08-29 09:47:46 +03:00
sysfs.c habanalabs: add missing error check in sysfs max_power_show 2022-02-28 14:22:03 +02:00