Skip to contentSkip to conversation

habanalabs: halt the engines before hard-reset

PATCH In review Oded Gabbay 2 participants 2 messages Dec 25, 2019 – Dec 26, 2019 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

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.

---
 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
index b155e9549076..166883b64725 100644
@@ -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