Skip to content

Commit

Permalink
accel/habanalabs: modify pci health check
Browse files Browse the repository at this point in the history
Today we read PCI VENDOR-ID in order to make sure PCI link is
healthy. Apparently the VENDOR-ID might be stored on host and
hence, when we read it we might not access the PCI bus.
In order to make sure PCI health check is reliable, we will start
checking the DEVICE-ID instead.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
  • Loading branch information
Ofir Bitton authored and Oded Gabbay committed Feb 26, 2024
1 parent c517068 commit fa58b59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/accel/habanalabs/common/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,14 +1035,14 @@ static void device_early_fini(struct hl_device *hdev)

static bool is_pci_link_healthy(struct hl_device *hdev)
{
u16 vendor_id;
u16 device_id;

if (!hdev->pdev)
return false;

pci_read_config_word(hdev->pdev, PCI_VENDOR_ID, &vendor_id);
pci_read_config_word(hdev->pdev, PCI_DEVICE_ID, &device_id);

return (vendor_id == PCI_VENDOR_ID_HABANALABS);
return (device_id == hdev->pdev->device);
}

static int hl_device_eq_heartbeat_check(struct hl_device *hdev)
Expand Down

0 comments on commit fa58b59

Please sign in to comment.