Skip to content

Commit fa58b59

Browse files
ofirbittogabbay
authored andcommitted
accel/habanalabs: modify pci health check
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>
1 parent c517068 commit fa58b59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/accel/habanalabs/common/device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,14 +1035,14 @@ static void device_early_fini(struct hl_device *hdev)
10351035

10361036
static bool is_pci_link_healthy(struct hl_device *hdev)
10371037
{
1038-
u16 vendor_id;
1038+
u16 device_id;
10391039

10401040
if (!hdev->pdev)
10411041
return false;
10421042

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

1045-
return (vendor_id == PCI_VENDOR_ID_HABANALABS);
1045+
return (device_id == hdev->pdev->device);
10461046
}
10471047

10481048
static int hl_device_eq_heartbeat_check(struct hl_device *hdev)

0 commit comments

Comments
 (0)