On 10/29/2026 2:30 PM, Zack McKevitt wrote:
@@ -611,6 +620,13 @@ static int qaic_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
                return ret;
        }
+ ret = qaic_drm_ras_register_node(qdev);
+       if (ret) {
+               qaic_mhi_free_controller(qdev->mhi_cntrl, link_up);
+               qaic_destroy_drm_device(qdev, QAIC_NO_PARTITION);
+               return ret;
+       }
+
        return 0;
  }

Registering the mhi_controller will kickoff a whole init and boot sequence for the hardware. Feels like we should attempt this before that as if this fails, we don't leave the hardware in a weird state.

diff --git a/drivers/accel/qaic/qaic_telemetry.c 
b/drivers/accel/qaic/qaic_telemetry.c
new file mode 100644
index 000000000000..fdce7a71d3eb
--- /dev/null
+++ b/drivers/accel/qaic/qaic_telemetry.c
@@ -0,0 +1,513 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */
+/* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */
+
+#include <drm/drm_file.h>
+#include <drm/drm_ras.h>
+#include <asm/byteorder.h>

A before D in the alphabet?

+#include <linux/completion.h>
+#include <linux/fs.h>
+#include <linux/fs_struct.h>
+#include <linux/kernel.h>
+#include <linux/kref.h>
+#include <linux/list.h>
+#include <linux/mhi.h>
+#include <linux/mutex.h>
+#include <linux/namei.h>
+#include <linux/path.h>
+#include <linux/sprintf.h>
+#include <linux/srcu.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+#include <uapi/drm/qaic_accel.h>
+
+#include "qaic.h"
+#include "qaic_telemetry.h"
+
+#define MAGIC                          0x55AA
+#define VERSION                                0x1
+
+/*
+ * Telemetry fields defined by the uAPI.
+ * This table will be used by drm_ras's dumpit to display
+ * each field to userspace.
+ */
+const struct drm_ras_telemetry_field qaic_telemetry_fields_gettable[] = {
+       {"QAIC_DEVINFO_THERMAL_SOC_MAX_TEMP", 1},
+       {"QAIC_DEVINFO_THERMAL_BOARD_TEMP", 2},
+       {"QAIC_DEVINFO_THERMAL_BOARD_MAX_TEMP", 3},
+       {"QAIC_DEVINFO_THERMAL_DDR_TEMP", 4},
+       {"QAIC_DEVINFO_THERMAL_WARNING_TEMP", 5},
+       {"QAIC_DEVINFO_THERMAL_SHUTDOWN_TEMP", 6},
+       {"QAIC_DEVINFO_BOARD_TDP", 7},
+       {"QAIC_DEVINFO_BOARD_POWER", 8},
+       {"QAIC_DEVINFO_POWER_STATE", 9},
+       {"QAIC_DEVINFO_POWER_MAX", 10},
+       {"QAIC_DEVINFO_THROTTLE_PERCENT", 11},
+       {"QAIC_DEVINFO_THROTTLE_TIME", 12},
+       {"QAIC_DEVINFO_UPTIME", 13},
+       {"QAIC_DEVINFO_THERMAL_SOC_FLOOR_TEMP", 14},
+       {"QAIC_DEVINFO_THERMAL_SOC_CEILING_TEMP", 15},
+       {"QAIC_DEVINFO_VOLTAGE_CX", 16},
+       {"QAIC_DEVINFO_VOLTAGE_MX", 17},
+       {"QAIC_DEVINFO_VOLTAGE_NSP_CX", 18},
+       {"QAIC_DEVINFO_VOLTAGE_NSP_MX", 19},
+       {"QAIC_DEVINFO_CFG_TOPS", 20},
+       {"QAIC_DEVINFO_THERMAL_PMIC_TEMP_A", 21},
+       {"QAIC_DEVINFO_THERMAL_PMIC_TEMP_C", 22},
+       {"QAIC_DEVINFO_THERMAL_PMIC_TEMP_E", 23},
+       {"QAIC_DEVINFO_POWER_ACTION", 24},
+       {"QAIC_DEVINFO_SOC_TDP", 25},
+       {"QAIC_DEVINFO_SOC_POWER", 26},

This should be in sync with the defines in qaic_accel.h right? Can we just use those defines here?


Reply via email to