From: Vinay Belgaumkar Date: Fri, 12 Nov 2021 07:10:16 +0000 (-0800) Subject: drm/i915/guc/slpc: Check GuC status before freq boost X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f1176b419f9468f05dabdc8352bfa9b15427377;p=linux.git drm/i915/guc/slpc: Check GuC status before freq boost It's possible that i915 might get wedged between a boost and un-boost. Validate the i915-GuC connection before trying to send a H2G to change the min frequency. Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/4464 Cc: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211112071016.9640-1-vinay.belgaumkar@intel.com --- diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c index 4e1d3cd291649..22c1c12369f2f 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c @@ -183,11 +183,15 @@ static int slpc_unset_param(struct intel_guc_slpc *slpc, static int slpc_force_min_freq(struct intel_guc_slpc *slpc, u32 freq) { struct drm_i915_private *i915 = slpc_to_i915(slpc); + struct intel_guc *guc = slpc_to_guc(slpc); intel_wakeref_t wakeref; int ret = 0; lockdep_assert_held(&slpc->lock); + if (!intel_guc_is_ready(guc)) + return -ENODEV; + /* * This function is a little different as compared to * intel_guc_slpc_set_min_freq(). Softlimit will not be updated