Skip to content

Commit 097c62b

Browse files
committed
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 <[email protected]>
1 parent fcaebc7 commit 097c62b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/misc/habanalabs/common/device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ enum hl_device_status hl_device_status(struct hl_device *hdev)
1717
{
1818
enum hl_device_status status;
1919

20-
if (hdev->disabled)
21-
status = HL_DEVICE_STATUS_MALFUNCTION;
22-
else if (atomic_read(&hdev->in_reset))
20+
if (atomic_read(&hdev->in_reset))
2321
status = HL_DEVICE_STATUS_IN_RESET;
2422
else if (hdev->needs_reset)
2523
status = HL_DEVICE_STATUS_NEEDS_RESET;
24+
else if (hdev->disabled)
25+
status = HL_DEVICE_STATUS_MALFUNCTION;
2626
else
2727
status = HL_DEVICE_STATUS_OPERATIONAL;
2828

0 commit comments

Comments
 (0)