diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-04-28 10:18:35 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2019-04-28 10:18:35 +0300 |
commit | a38693d77576145673a7b3d4d771d992282ad13b (patch) | |
tree | 7253cb74316b8d9093f7a8cadda464232cf853e0 /drivers/misc/habanalabs/pci.c | |
parent | 027d35d0b6999c02de4c1ef86d0df4b5f4119167 (diff) |
habanalabs: return old dram bar address upon change
This patch changes the ASIC interface function that changes the DRAM bar
window. The change is to return the old address that the DRAM bar pointed
to instead of an error code.
This simplifies the code that use this function (mainly in debugfs) to
restore the bar to the old setting.
This is also needed for easier support in future ASICs.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc/habanalabs/pci.c')
-rw-r--r-- | drivers/misc/habanalabs/pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/pci.c b/drivers/misc/habanalabs/pci.c index d472d02a8e6e..5278f086d65d 100644 --- a/drivers/misc/habanalabs/pci.c +++ b/drivers/misc/habanalabs/pci.c @@ -259,7 +259,10 @@ int hl_pci_init_iatu(struct hl_device *hdev, u64 sram_base_address, /* Point to DRAM */ if (!hdev->asic_funcs->set_dram_bar_base) return -EINVAL; - rc |= hdev->asic_funcs->set_dram_bar_base(hdev, dram_base_address); + if (hdev->asic_funcs->set_dram_bar_base(hdev, dram_base_address) == + U64_MAX) + return -EIO; + /* Outbound Region 0 - Point to Host */ host_phys_end_addr = prop->host_phys_base_address + host_phys_size - 1; |