accel/habanalabs: remove pdev check on idle check
Oded Gabbay
maintainerPATCH 1/3 accel/habanalabs: remove pdev check on idle check
Our simulator supports idle check so no need anymore to check if pdev exists.
--- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/common/device.c +1 -1
@@ -424,7 +424,7 @@ static void hpriv_release(struct kref *ref)/* Check the device idle status and reset if not idle. * Skip it if already in reset, or if device is going to be reset in any case. */ -if (!hdev->reset_info.in_reset && !reset_device && hdev->pdev && !hdev->pldm) +if (!hdev->reset_info.in_reset && !reset_device && !hdev->pldm) device_is_idle = hdev->asic_funcs->is_device_idle (hdev, idle_mask,HL_BUSY_ENGINES_MASK_EXT_SIZE ,NULL );if (!device_is_idle) {
Signature · 1 line
2.40.1
Oded Gabbay
maintainerPATCH 2/3 accel/habanalabs: reset device if scrubbing failed
If scrubbing memory after user released device has failed it means the device is in a bad state and should be reset.
--- drivers/accel/habanalabs/common/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/accel/habanalabs/common/device.c +3 -1
@@ -454,8 +454,10 @@ static void hpriv_release(struct kref *ref)/* Scrubbing is handled within hl_device_reset(), so here need to do it directly */ int rc = hdev->asic_funcs->scrub_device_mem (hdev); -if (rc) +if (rc) {dev_err (hdev->dev,"failed to scrub memory from hpriv release (%d)\n" , rc); +hl_device_reset (hdev,HL_DRV_RESET_HARD ); + } }/* Now we can mark the compute_ctx as not active. Even if a reset is running in a different
Signature · 1 line
2.40.1
Oded Gabbay
maintainerPATCH 3/3 accel/habanalabs: dump temperature threshold boot error
In reply to Oded GabbayFrom: Ofir Bitton <[email protected]>
Add dump of an error reported from f/w during boot time. This error indicates a failure with setting temperature threshold.
--- drivers/accel/habanalabs/common/firmware_if.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/accel/habanalabs/common/firmware_if.c +5 -0
@@ -724,6 +724,11 @@ static bool fw_report_boot_dev0(struct hl_device *hdev, u32 err_val, err_exists = true; } +if (err_val &CPU_BOOT_ERR0_TMP_THRESH_INIT_FAIL ) { +dev_err (hdev->dev,"Device boot error - Failed to set threshold for temperature sensor\n" ); + err_exists = true; + } +if (err_val &CPU_BOOT_ERR0_DEVICE_UNUSABLE_FAIL ) {/* Ignore this bit, don't prevent driver loading */ dev_dbg (hdev->dev,"device unusable status is set\n" );
Signature · 1 line
2.40.1
On 12/06/2023 15:07, Oded Gabbay wrote:
Our simulator supports idle check so no need anymore to check if pdev exists.
--- drivers/accel/habanalabs/common/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/habanalabs/common/device.c +1 -1
@@ -424,7 +424,7 @@ static void hpriv_release(struct kref *ref)/* Check the device idle status and reset if not idle. * Skip it if already in reset, or if device is going to be reset in any case. */ -if (!hdev->reset_info.in_reset && !reset_device && hdev->pdev && !hdev->pldm) +if (!hdev->reset_info.in_reset && !reset_device && !hdev->pldm) device_is_idle = hdev->asic_funcs->is_device_idle (hdev, idle_mask,HL_BUSY_ENGINES_MASK_EXT_SIZE ,NULL );if (!device_is_idle) {
Re: [PATCH 2/3] accel/habanalabs: reset device if scrubbing failed
In reply to Oded GabbayOn 12/06/2023 15:07, Oded Gabbay wrote:
If scrubbing memory after user released device has failed it means the device is in a bad state and should be reset.
--- drivers/accel/habanalabs/common/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/accel/habanalabs/common/device.c +3 -1
@@ -454,8 +454,10 @@ static void hpriv_release(struct kref *ref)/* Scrubbing is handled within hl_device_reset(), so here need to do it directly */ int rc = hdev->asic_funcs->scrub_device_mem (hdev); -if (rc) +if (rc) {dev_err (hdev->dev,"failed to scrub memory from hpriv release (%d)\n" , rc); +hl_device_reset (hdev,HL_DRV_RESET_HARD ); + } }/* Now we can mark the compute_ctx as not active. Even if a reset is running in a different