diff options
author | Oded Gabbay <ogabbay@kernel.org> | 2020-12-22 15:21:07 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2020-12-28 08:47:39 +0200 |
commit | 097c62b6f0ec2bdadf86afbe80df03856338724d (patch) | |
tree | 0960f3e36664934ce0c1cf731c6b4ed9f823c252 /drivers/misc | |
parent | fcaebc7354188b0d708c79df4390fbabd4d9799d (diff) |
habanalabs: fix order of status check
When the device is in reset or needs to be reset, the disabled property
is don't-care.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 5871162a8442..0749c92cbcf6 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -17,12 +17,12 @@ enum hl_device_status hl_device_status(struct hl_device *hdev) { enum hl_device_status status; - if (hdev->disabled) - status = HL_DEVICE_STATUS_MALFUNCTION; - else if (atomic_read(&hdev->in_reset)) + if (atomic_read(&hdev->in_reset)) status = HL_DEVICE_STATUS_IN_RESET; else if (hdev->needs_reset) status = HL_DEVICE_STATUS_NEEDS_RESET; + else if (hdev->disabled) + status = HL_DEVICE_STATUS_MALFUNCTION; else status = HL_DEVICE_STATUS_OPERATIONAL; |