drm/xe: Add functions and sysfs for boot survivability
authorRiana Tauro <riana.tauro@intel.com>
Tue, 28 Jan 2025 09:56:30 +0000 (15:26 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 28 Jan 2025 13:58:45 +0000 (08:58 -0500)
commit5e940312a2ac64ba0d6239aff72135226818b238
tree13fe24f1beaac8ff8d6b83e332bee3b1946844e5
parentcb1f868ca13756c0c18ba54d1591332476760d07
drm/xe: Add functions and sysfs for boot survivability

Boot Survivability is a software based workflow for recovering a system
in a failed boot state. Here system recoverability is concerned with
recovering the firmware responsible for boot.

This is implemented by loading the driver with bare minimum (no drm card)
to allow the firmware to be flashed through mei-gsc and collect telemetry.
The driver's probe flow is modified such that it enters survivability mode
when pcode initialization is incomplete and boot status denotes a failure.
In this mode, drm card is not exposed and presence of survivability_mode
entry in PCI sysfs  is used to indicate survivability mode and
provide additional information required for debug

This patch adds initialization functions and exposes admin
readable sysfs entries

The new sysfs will have the below layout

/sys/bus/.../bdf
                   ├── survivability_mode

v2: reorder headers
    fix doc
    remove survivability info and use mode to display information
    use separate function for logging survivability information
    for critical error (Rodrigo)

v3: use for loop
    use dev logs instead of drm
    use helper function for aux history(Rodrigo)
    remove unnecessary error check of greater than max_scratch
    as we are reading only 3 bit

v4: fix checkpatch warnings
    fix space (Rodrigo)
    rename register

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Acked-by: Ashwin Kumar Kulkarni <ashwin.kumar.kulkarni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250128095632.1294722-2-riana.tauro@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/Makefile
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_pcode_api.h
drivers/gpu/drm/xe/xe_survivability_mode.c [new file with mode: 0644]
drivers/gpu/drm/xe/xe_survivability_mode.h [new file with mode: 0644]
drivers/gpu/drm/xe/xe_survivability_mode_types.h [new file with mode: 0644]