diff options
author | Tomer Tayar <ttayar@habana.ai> | 2019-08-08 14:30:22 +0200 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2019-09-05 13:55:27 +0200 |
commit | 129b6a9324ad8bdf0973a5441763e29bd4e91663 (patch) | |
tree | 25d765101322c77f1a624e43e870bf4269645dc3 /drivers/misc | |
parent | habanalabs: Expose devices after initialization is done (diff) | |
download | linux-129b6a9324ad8bdf0973a5441763e29bd4e91663.tar.xz linux-129b6a9324ad8bdf0973a5441763e29bd4e91663.zip |
habanalabs: Handle HW_IP_INFO if device disabled or in reset
The HW IP information is relevant even if the device is disabled or in
reset, so always handle the corresponding INFO IOCTL opcode.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/habanalabs_ioctl.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/misc/habanalabs/habanalabs_ioctl.c b/drivers/misc/habanalabs/habanalabs_ioctl.c index 6351fbf10ddc..1458b95de751 100644 --- a/drivers/misc/habanalabs/habanalabs_ioctl.c +++ b/drivers/misc/habanalabs/habanalabs_ioctl.c @@ -204,10 +204,21 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, struct hl_device *hdev = hpriv->hdev; int rc; - /* We want to return device status even if it disabled or in reset */ - if (args->op == HL_INFO_DEVICE_STATUS) + /* + * Information is returned for the following opcodes even if the device + * is disabled or in reset. + */ + switch (args->op) { + case HL_INFO_HW_IP_INFO: + return hw_ip_info(hdev, args); + + case HL_INFO_DEVICE_STATUS: return device_status_info(hdev, args); + default: + break; + } + if (hl_device_disabled_or_in_reset(hdev)) { dev_warn_ratelimited(dev, "Device is %s. Can't execute INFO IOCTL\n", @@ -216,10 +227,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, } switch (args->op) { - case HL_INFO_HW_IP_INFO: - rc = hw_ip_info(hdev, args); - break; - case HL_INFO_HW_EVENTS: rc = hw_events_info(hdev, args); break; |