diff options
author | Ofir Bitton <obitton@habana.ai> | 2021-11-23 15:15:22 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-12-26 14:41:28 +0200 |
commit | eb135291912f7554e2a2472befc44818098baa8d (patch) | |
tree | 94a83ce19a8593b3b16faea9ab3101417e225ffb /drivers/misc/habanalabs/common/sysfs.c | |
parent | 60bf3bfb5a37965fc33fa00f19a2074dd48077c5 (diff) | |
download | linux-eb135291912f7554e2a2472befc44818098baa8d.tar.bz2 |
habanalabs: refactor reset information variables
Unify variables related to device reset, which will help us to
add some new reset functionality in future patches.
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/sysfs.c')
-rw-r--r-- | drivers/misc/habanalabs/common/sysfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/misc/habanalabs/common/sysfs.c b/drivers/misc/habanalabs/common/sysfs.c index 1af568e46f46..45c715325e2a 100644 --- a/drivers/misc/habanalabs/common/sysfs.c +++ b/drivers/misc/habanalabs/common/sysfs.c @@ -211,7 +211,7 @@ static ssize_t soft_reset_store(struct device *dev, goto out; } - if (!hdev->allow_inference_soft_reset) { + if (!hdev->asic_prop.allow_inference_soft_reset) { dev_err(hdev->dev, "Device does not support inference soft-reset\n"); goto out; } @@ -303,7 +303,7 @@ static ssize_t soft_reset_cnt_show(struct device *dev, { struct hl_device *hdev = dev_get_drvdata(dev); - return sprintf(buf, "%d\n", hdev->soft_reset_cnt); + return sprintf(buf, "%d\n", hdev->reset_info.soft_reset_cnt); } static ssize_t hard_reset_cnt_show(struct device *dev, @@ -311,7 +311,7 @@ static ssize_t hard_reset_cnt_show(struct device *dev, { struct hl_device *hdev = dev_get_drvdata(dev); - return sprintf(buf, "%d\n", hdev->hard_reset_cnt); + return sprintf(buf, "%d\n", hdev->reset_info.hard_reset_cnt); } static ssize_t max_power_show(struct device *dev, struct device_attribute *attr, @@ -478,7 +478,7 @@ int hl_sysfs_init(struct hl_device *hdev) return rc; } - if (!hdev->allow_inference_soft_reset) + if (!hdev->asic_prop.allow_inference_soft_reset) return 0; rc = device_add_groups(hdev->dev, hl_dev_inference_attr_groups); @@ -495,7 +495,7 @@ void hl_sysfs_fini(struct hl_device *hdev) { device_remove_groups(hdev->dev, hl_dev_attr_groups); - if (!hdev->allow_inference_soft_reset) + if (!hdev->asic_prop.allow_inference_soft_reset) return; device_remove_groups(hdev->dev, hl_dev_inference_attr_groups); |