Commit 83bce0d7 authored by Oded Gabbay's avatar Oded Gabbay Committed by Zheng Zengkai
Browse files

habanalabs: disable FW events on device removal



stable inclusion
from stable-5.10.14
commit 4587cb6f27a6f3518aa5195e6a2676ac02dac5aa
bugzilla: 48051

--------------------------------

[ Upstream commit 2dc4a6d7 ]

When device is removed, we need to make sure the F/W won't send us
any more events because during the remove process we disable the
interrupts.

Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 2ca05cc7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,15 @@ void hl_device_fini(struct hl_device *hdev)
		}
	}

	/* Disable PCI access from device F/W so it won't send us additional
	 * interrupts. We disable MSI/MSI-X at the halt_engines function and we
	 * can't have the F/W sending us interrupts after that. We need to
	 * disable the access here because if the device is marked disable, the
	 * message won't be send. Also, in case of heartbeat, the device CPU is
	 * marked as disable so this message won't be sent
	 */
	hl_fw_send_pci_access_msg(hdev,	CPUCP_PACKET_DISABLE_PCI_ACCESS);

	/* Mark device as disabled */
	hdev->disabled = true;