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>
This commit is contained in:
parent
fcaebc7354
commit
097c62b6f0
|
@ -17,12 +17,12 @@ enum hl_device_status hl_device_status(struct hl_device *hdev)
|
||||||
{
|
{
|
||||||
enum hl_device_status status;
|
enum hl_device_status status;
|
||||||
|
|
||||||
if (hdev->disabled)
|
if (atomic_read(&hdev->in_reset))
|
||||||
status = HL_DEVICE_STATUS_MALFUNCTION;
|
|
||||||
else if (atomic_read(&hdev->in_reset))
|
|
||||||
status = HL_DEVICE_STATUS_IN_RESET;
|
status = HL_DEVICE_STATUS_IN_RESET;
|
||||||
else if (hdev->needs_reset)
|
else if (hdev->needs_reset)
|
||||||
status = HL_DEVICE_STATUS_NEEDS_RESET;
|
status = HL_DEVICE_STATUS_NEEDS_RESET;
|
||||||
|
else if (hdev->disabled)
|
||||||
|
status = HL_DEVICE_STATUS_MALFUNCTION;
|
||||||
else
|
else
|
||||||
status = HL_DEVICE_STATUS_OPERATIONAL;
|
status = HL_DEVICE_STATUS_OPERATIONAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue