diff options
author | Oded Gabbay <ogabbay@kernel.org> | 2022-06-26 17:20:03 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-07-12 08:09:27 +0200 |
commit | d7bb1ac89b2f5e230ec87659dabd2600897e49ef (patch) | |
tree | e3874b2d93e24b856caaffe9b7545fcf4b85f2ef /drivers/misc/habanalabs/common/device.c | |
parent | uapi: habanalabs: add gaudi2 defines (diff) | |
download | linux-d7bb1ac89b2f5e230ec87659dabd2600897e49ef.tar.xz linux-d7bb1ac89b2f5e230ec87659dabd2600897e49ef.zip |
habanalabs: add gaudi2 asic-specific code
Add the ASIC-specific code for Gaudi2. Supply (almost) all of the
function callbacks that the driver's common code need to initialize,
finalize and submit workloads to the Gaudi2 ASIC.
It also contains the code to initialize the F/W of the Gaudi2 ASIC
and to receive events from the F/W.
It contains new debugfs entry to dump razwi events. razwi is a case
where the device's engines create a transaction that reaches an
invalid destination.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/device.c')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index adf0ff26636c..5b345fc3dcc1 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1822,6 +1822,12 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) goto release_ctx; } + rc = hl_dec_init(hdev); + if (rc) { + dev_err(hdev->dev, "Failed to initialize the decoder module\n"); + goto cb_pool_fini; + } + /* * From this point, override rc (=0) in case of an error to allow * debugging (by adding char devices and create sysfs nodes as part of @@ -1915,6 +1921,8 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) return 0; +cb_pool_fini: + hl_cb_pool_fini(hdev); release_ctx: if (hl_ctx_put(hdev->kernel_ctx) != 1) dev_err(hdev->dev, @@ -2065,6 +2073,8 @@ void hl_device_fini(struct hl_device *hdev) hl_debugfs_remove_device(hdev); + hl_dec_fini(hdev); + hl_vm_fini(hdev); hl_mmu_fini(hdev); |