habanalabs: give FW a grace time for configuring iATU
authorOfir Bitton <obitton@habana.ai>
Tue, 20 Apr 2021 07:15:25 +0000 (10:15 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 18 Jun 2021 12:23:39 +0000 (15:23 +0300)
iATU (internal Address Translation Unit of the PCI controller)
configuration is being done by FW right after driver enables
the PCI device. Hence, driver must add a minor sleep afterwards
in order to make sure FW finishes configuring iATU regions.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/pci/pci.c

index 9ef6c46..8e7982b 100644 (file)
@@ -430,6 +430,10 @@ int hl_pci_init(struct hl_device *hdev)
                goto unmap_pci_bars;
        }
 
+       /* Driver must sleep in order for FW to finish the iATU configuration */
+       if (hdev->asic_prop.iatu_done_by_fw)
+               usleep_range(2000, 3000);
+
        return 0;
 
 unmap_pci_bars: