Skip to content

Commit

Permalink
habanalabs: disable FW events on device removal
Browse files Browse the repository at this point in the history
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: Oded Gabbay <[email protected]>
  • Loading branch information
ogabbay committed Jan 21, 2021
1 parent f8abaf3 commit 2dc4a6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/misc/habanalabs/common/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,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;

Expand Down

0 comments on commit 2dc4a6d

Please sign in to comment.