Merge tag 'char-misc-5.15-rc1-lkdtm' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / misc / habanalabs / goya / goya.c
index e690161..031c184 100644 (file)
@@ -654,14 +654,14 @@ pci_init:
                                        GOYA_BOOT_FIT_REQ_TIMEOUT_USEC);
        if (rc) {
                if (hdev->reset_on_preboot_fail)
-                       hdev->asic_funcs->hw_fini(hdev, true);
+                       hdev->asic_funcs->hw_fini(hdev, true, false);
                goto pci_fini;
        }
 
        if (goya_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->hw_fini(hdev, true);
+               hdev->asic_funcs->hw_fini(hdev, true, false);
        }
 
        if (!hdev->pldm) {
@@ -2380,7 +2380,7 @@ static void goya_disable_timestamp(struct hl_device *hdev)
        WREG32(mmPSOC_TIMESTAMP_BASE - CFG_BASE, 0);
 }
 
-static void goya_halt_engines(struct hl_device *hdev, bool hard_reset)
+static void goya_halt_engines(struct hl_device *hdev, bool hard_reset, bool fw_reset)
 {
        u32 wait_timeout_ms;
 
@@ -2703,14 +2703,7 @@ disable_queues:
        return rc;
 }
 
-/*
- * goya_hw_fini - Goya hardware tear-down code
- *
- * @hdev: pointer to hl_device structure
- * @hard_reset: should we do hard reset to all engines or just reset the
- *              compute/dma engines
- */
-static void goya_hw_fini(struct hl_device *hdev, bool hard_reset)
+static void goya_hw_fini(struct hl_device *hdev, bool hard_reset, bool fw_reset)
 {
        struct goya_device *goya = hdev->asic_specific;
        u32 reset_timeout_ms, cpu_timeout_ms, status;
@@ -4804,6 +4797,12 @@ void goya_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry)
                                >> EQ_CTL_EVENT_TYPE_SHIFT);
        struct goya_device *goya = hdev->asic_specific;
 
+       if (event_type >= GOYA_ASYNC_EVENT_ID_SIZE) {
+               dev_err(hdev->dev, "Event type %u exceeds maximum of %u",
+                               event_type, GOYA_ASYNC_EVENT_ID_SIZE - 1);
+               return;
+       }
+
        goya->events_stat[event_type]++;
        goya->events_stat_aggregate[event_type]++;
 
@@ -5582,6 +5581,11 @@ static u32 goya_get_sob_addr(struct hl_device *hdev, u32 sob_id)
        return 0;
 }
 
+static u32 *goya_get_stream_master_qid_arr(void)
+{
+       return NULL;
+}
+
 static const struct hl_asic_funcs goya_funcs = {
        .early_init = goya_early_init,
        .early_fini = goya_early_fini,
@@ -5671,6 +5675,7 @@ static const struct hl_asic_funcs goya_funcs = {
        .state_dump_init = goya_state_dump_init,
        .get_sob_addr = &goya_get_sob_addr,
        .set_pci_memory_regions = goya_set_pci_memory_regions,
+       .get_stream_master_qid_arr = goya_get_stream_master_qid_arr,
 };
 
 /*