diff options
author | Ofir Bitton <obitton@habana.ai> | 2022-08-28 12:46:27 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-09-19 15:08:37 +0300 |
commit | f5ec364c9ecd1113492e15ceaafd4447f5836528 (patch) | |
tree | 0c2ae548cb8b68cb9404eb58eb9cb5f4560e5253 /drivers/misc/habanalabs/common/device.c | |
parent | habanalabs: send device active message to f/w (diff) | |
download | linux-dev-f5ec364c9ecd1113492e15ceaafd4447f5836528.tar.xz linux-dev-f5ec364c9ecd1113492e15ceaafd4447f5836528.zip |
habanalabs: send device activity in a proper context
'Device activity open packet' should be sent outside of mutex as
there is no real necessity for a lock.
In addition 'device activity close packet' should be sent upon an
actual release of the device.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index d6df0bd55e9f..5f6407ed3b04 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -363,6 +363,8 @@ static void hpriv_release(struct kref *ref) hdev = hpriv->hdev; + hdev->asic_funcs->send_device_activity(hdev, false); + put_pid(hpriv->taskpid); hl_debugfs_remove_file(hpriv); @@ -470,8 +472,6 @@ static int hl_device_release(struct inode *inode, struct file *filp) hdev->last_open_session_duration_jif = jiffies - hdev->last_successful_open_jif; - hdev->asic_funcs->send_device_activity(hdev, false); - return 0; } |