diff mbox series

drm/i915/guc: Check if reset is supported before attempting to reset GuC

Message ID 20190614130207.1754-1-michal.winiarski@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/guc: Check if reset is supported before attempting to reset GuC | expand

Commit Message

Michał Winiarski June 14, 2019, 1:02 p.m. UTC
Let's trust both the user (i915.reset modparam) and device caps instead
of attempting to reset unconditionally.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index a8e7f0ba7c3b..0752fb77b6fe 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -38,6 +38,11 @@  static int __intel_uc_reset_hw(struct drm_i915_private *dev_priv)
 	int ret;
 	u32 guc_status;
 
+	if (!intel_has_gpu_reset(dev_priv)) {
+		DRM_DEBUG_DRIVER("GPU reset disabled, skipping GuC reset\n");
+		return 0;
+	}
+
 	ret = intel_reset_guc(dev_priv);
 	if (ret) {
 		DRM_ERROR("Failed to reset GuC, ret = %d\n", ret);