]> www.infradead.org Git - users/dwmw2/linux.git/commit
habanalabs: don't allow hard reset with open processes
authorOmer Shpigelman <oshpigelman@habana.ai>
Mon, 18 May 2020 19:27:46 +0000 (22:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:26 +0000 (17:48 +0200)
commitf3922d1a65cd8f8287be624e1c68f7d3beaba1b1
tree483db1f687b413557cbb24c5efea32a86f217400
parentc7e949b1817c72ffbb9811a9d6415db0b860c79b
habanalabs: don't allow hard reset with open processes

[ Upstream commit 36fafe87edd636292a4ed6a3af9608f2c7d0d0fb ]

When the MMU is heavily used by the engines, unmapping might take a lot of
time due to a full MMU cache invalidation done as part of the unmap flow.
Hence we might not be able to kill all open processes before going to hard
reset the device, as it involves unmapping of all user memory.
In case of a failure in killing all open processes, we should stop the
hard reset flow as it might lead to a kernel crash - one thread (killing
of a process) is updating MMU structures that other thread (hard reset) is
freeing.
Stopping a hard reset flow leaves the device as nonoperational and the
user can then initiate a hard reset via sysfs to reinitialize the device.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/device.c