]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/habanalabs/gaudi2: use the CPLD_SHUTDOWN event handler
authorKonstantin Sinyuk <konstantin.sinyuk@intel.com>
Thu, 15 Aug 2024 12:24:24 +0000 (15:24 +0300)
committerKoby Elbaz <koby.elbaz@intel.com>
Thu, 25 Sep 2025 06:09:29 +0000 (09:09 +0300)
After CPLD shutdown event the device is not usable anymore. The common
CPLD_SHUTDOWN event handler disables any subsequent device access.

Signed-off-by: Konstantin Sinyuk <konstantin.sinyuk@intel.com>
Reviewed-by: Koby Elbaz <koby.elbaz@intel.com>
Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>
drivers/accel/habanalabs/common/device.c
drivers/accel/habanalabs/gaudi2/gaudi2.c

index c6830c8026acf5572232356131025edc797d292f..999c92d7036ea73f581ae74bcfb07ba0627acdbf 100644 (file)
@@ -2965,6 +2965,4 @@ void hl_eq_cpld_shutdown_event_handle(struct hl_device *hdev, u16 event_id, u64
        /* Avoid any new accesses to the H/W */
        hdev->disabled = true;
        hdev->cpld_shutdown = true;
-       hl_cn_hard_reset_prepare(hdev);
-       hl_cn_stop(hdev);
 }
index d8f40f2c967c67e1860087cd639c803125d1cb86..72bfc5e639e413c3f5944a6225eb1efa6bb7d7d0 100644 (file)
@@ -5184,7 +5184,7 @@ static void gaudi2_halt_engines(struct hl_device *hdev, bool hard_reset, bool fw
        else
                wait_timeout_ms = GAUDI2_RESET_WAIT_MSEC;
 
-       if (fw_reset)
+       if (fw_reset || hdev->cpld_shutdown)
                goto skip_engines;
 
        gaudi2_stop_dma_qmans(hdev);
@@ -10522,7 +10522,7 @@ static void gaudi2_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_ent
                dev_err(hdev->dev, "CPLD shutdown event, reset reason: 0x%llx\n",
                                                le64_to_cpu(eq_entry->data[0]));
                error_count = GAUDI2_NA_EVENT_CAUSE;
-               event_mask |= HL_NOTIFIER_EVENT_GENERAL_HW_ERR;
+               hl_eq_cpld_shutdown_event_handle(hdev, event_type, &event_mask);
                break;
 
        case GAUDI2_EVENT_CPU_PKT_SANITY_FAILED: