habanalabs: halt the engines before hard-reset
PATCH 1/1 habanalabs: halt the engines before hard-reset
The driver must halt the engines before doing hard-reset, otherwise the device can go into undefined state. There is a place where the driver didn't do that and this patch fixes it.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/device.c | 1 + drivers/misc/habanalabs/goya/goya.c | 42 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)
drivers/misc/habanalabs/device.c +1 -0
@@ -1189,6 +1189,7 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)if (hdev->asic_funcs->get_hw_state (hdev) ==HL_DEVICE_HW_STATE_DIRTY ) {dev_info (hdev->dev,"H/W state is dirty, must reset before initializing\n" ); + hdev->asic_funcs->halt_engines (hdev, true); hdev->asic_funcs->hw_fini (hdev, true); }
drivers/misc/habanalabs/goya/goya.c +42 -0
95 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 5 lines · Oded Gabbay
The driver must halt the engines before doing hard-reset, otherwise the device can go into undefined state. There is a place where the driver didn't do that and this patch fixes it.
Signed-off-by Oded Gabbay <[email protected]>
Reviewed-by Tomer Tayar <[email protected]>