diff options
author | Ohad Sharabi <osharabi@habana.ai> | 2021-05-02 09:56:51 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-06-18 15:23:39 +0300 |
commit | 6542c3541d0f9405626faff9509aa28671fc3804 (patch) | |
tree | 7c1f353d5ca40af85be59ff2b6098feb8e64a1b7 /drivers/misc/habanalabs/common/pci | |
parent | c07c54e9de32ea8e89e7c2a112c14f59602a402c (diff) |
habanalabs: set dma mask from fw once fw done iatu config
When setting "DMA mask from FW" we are reading PSOC_GLOBAL_CONF register
which is allowed only once FW has done it's iATU configuration.
Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/pci')
-rw-r--r-- | drivers/misc/habanalabs/common/pci/pci.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/misc/habanalabs/common/pci/pci.c b/drivers/misc/habanalabs/common/pci/pci.c index 8e7982be6191..d5bedf5ba011 100644 --- a/drivers/misc/habanalabs/common/pci/pci.c +++ b/drivers/misc/habanalabs/common/pci/pci.c @@ -421,6 +421,12 @@ 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); + hdev->asic_funcs->set_dma_mask_from_fw(hdev); + } + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(hdev->dma_mask)); if (rc) { @@ -430,10 +436,6 @@ 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: |