summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/common/sysfs.c
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2020-07-15 21:59:32 +0300
committerOded Gabbay <oded.gabbay@gmail.com>2020-07-24 20:31:37 +0300
commit8df8cb1efc1962356c97656839ea9c41e1ed4ba9 (patch)
tree1b12bb76e046441dcb98047d3f03eea8d65d346e /drivers/misc/habanalabs/common/sysfs.c
parenta04b7cd97eef13a489ca44c979cf91e24cfa7b55 (diff)
downloadlinux-8df8cb1efc1962356c97656839ea9c41e1ed4ba9.tar.xz
habanalabs: enable device before hw_init()
Device is now enabled before the hw_init() because part of the initialization requires communication with the device firmware to get information that is required for the initialization itself Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Diffstat (limited to 'drivers/misc/habanalabs/common/sysfs.c')
-rw-r--r--drivers/misc/habanalabs/common/sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/sysfs.c b/drivers/misc/habanalabs/common/sysfs.c
index 5d78d5e1c782..c4e7c682d584 100644
--- a/drivers/misc/habanalabs/common/sysfs.c
+++ b/drivers/misc/habanalabs/common/sysfs.c
@@ -334,6 +334,9 @@ static ssize_t eeprom_read_handler(struct file *filp, struct kobject *kobj,
char *data;
int rc;
+ if (hl_device_disabled_or_in_reset(hdev))
+ return -ENODEV;
+
if (!max_size)
return -EINVAL;