diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-02-16 00:39:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-18 09:46:46 +0100 |
commit | c216477363a37a7d0a388315a2eb6c1bd965bdb8 (patch) | |
tree | 908c21b4d3e5b7b1ac735f08a3bce586262d6030 /drivers/misc/habanalabs/device.c | |
parent | d8dd7b0a81cc192ef5d30ec76ed6f6d35a1a7cf5 (diff) | |
download | linux-c216477363a37a7d0a388315a2eb6c1bd965bdb8.tar.bz2 |
habanalabs: add debugfs support
This patch adds debugfs support to the driver. It allows the user-space to
display information that is contained in the internal structures of the
driver, such as:
- active command submissions
- active user virtual memory mappings
- number of allocated command buffers
It also enables the user to perform reads and writes through Goya's PCI
bars.
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/device.c')
-rw-r--r-- | drivers/misc/habanalabs/device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index d0929022655b..a6fd3d90e9d1 100644 --- a/drivers/misc/habanalabs/device.c +++ b/drivers/misc/habanalabs/device.c @@ -30,6 +30,8 @@ static void hpriv_release(struct kref *ref) put_pid(hpriv->taskpid); + hl_debugfs_remove_file(hpriv); + mutex_destroy(&hpriv->restore_phase_mutex); kfree(hpriv); @@ -834,6 +836,8 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) goto free_cb_pool; } + hl_debugfs_add_device(hdev); + if (hdev->asic_funcs->get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) { dev_info(hdev->dev, "H/W state is dirty, must reset before initializing\n"); @@ -972,6 +976,8 @@ void hl_device_fini(struct hl_device *hdev) device_late_fini(hdev); + hl_debugfs_remove_device(hdev); + hl_sysfs_fini(hdev); /* |