提交 129b6a93 编写于 作者: T Tomer Tayar 提交者: Oded Gabbay

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: NTomer Tayar <ttayar@habana.ai>
Reviewed-by: NOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
上级 ea451f88
...@@ -204,10 +204,21 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, ...@@ -204,10 +204,21 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data,
struct hl_device *hdev = hpriv->hdev; struct hl_device *hdev = hpriv->hdev;
int rc; 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); return device_status_info(hdev, args);
default:
break;
}
if (hl_device_disabled_or_in_reset(hdev)) { if (hl_device_disabled_or_in_reset(hdev)) {
dev_warn_ratelimited(dev, dev_warn_ratelimited(dev,
"Device is %s. Can't execute INFO IOCTL\n", "Device is %s. Can't execute INFO IOCTL\n",
...@@ -216,10 +227,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, ...@@ -216,10 +227,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data,
} }
switch (args->op) { switch (args->op) {
case HL_INFO_HW_IP_INFO:
rc = hw_ip_info(hdev, args);
break;
case HL_INFO_HW_EVENTS: case HL_INFO_HW_EVENTS:
rc = hw_events_info(hdev, args); rc = hw_events_info(hdev, args);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册