From 2963db2f1827d9bf9f21cd626c08db86a047694d Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 12 Sep 2024 23:26:26 +0000 Subject: [PATCH] drm/i915: Do not attempt to load the GSC multiple times From Daniele Ceraolo Spurio 337266ada863a4232c9f8634deedc298a145521c in linux-6.6.y/6.6.51 59d3cfdd7f9655a0400ac453bf92199204f8b2a1 in mainline linux --- sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc.c | 2 +- sys/dev/pci/drm/i915/gt/uc/intel_uc_fw.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc.c b/sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc.c index 0d3b22a7436..e251e061d1a 100644 --- a/sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc.c +++ b/sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc.c @@ -304,7 +304,7 @@ void intel_gsc_uc_load_start(struct intel_gsc_uc *gsc) { struct intel_gt *gt = gsc_uc_to_gt(gsc); - if (!intel_uc_fw_is_loadable(&gsc->fw)) + if (!intel_uc_fw_is_loadable(&gsc->fw) || intel_uc_fw_is_in_error(&gsc->fw)) return; if (intel_gsc_uc_fw_init_done(gsc)) diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_uc_fw.h b/sys/dev/pci/drm/i915/gt/uc/intel_uc_fw.h index 9a431726c8d..ac7b3aad222 100644 --- a/sys/dev/pci/drm/i915/gt/uc/intel_uc_fw.h +++ b/sys/dev/pci/drm/i915/gt/uc/intel_uc_fw.h @@ -258,6 +258,11 @@ static inline bool intel_uc_fw_is_running(struct intel_uc_fw *uc_fw) return __intel_uc_fw_status(uc_fw) == INTEL_UC_FIRMWARE_RUNNING; } +static inline bool intel_uc_fw_is_in_error(struct intel_uc_fw *uc_fw) +{ + return intel_uc_fw_status_to_error(__intel_uc_fw_status(uc_fw)) != 0; +} + static inline bool intel_uc_fw_is_overridden(const struct intel_uc_fw *uc_fw) { return uc_fw->user_overridden; -- 2.20.1