From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagar Arun Kamble Subject: Re: [PATCH v10 3/9] drm/i915: Create uC runtime and system suspend/resume helpers Date: Thu, 28 Sep 2017 17:26:23 +0530 Message-ID: References: <1506504639-25631-1-git-send-email-sagar.a.kamble@intel.com> <1506504639-25631-4-git-send-email-sagar.a.kamble@intel.com> <150659912898.18872.6297202076529404980@mail.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1322642003==" Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC2D26E932 for ; Thu, 28 Sep 2017 11:56:29 +0000 (UTC) In-Reply-To: <150659912898.18872.6297202076529404980@mail.alporthouse.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org Cc: =?UTF-8?Q?Sagar_Arun_Kamble_=2c_Michal_Wajdeczko_=2c_=22_Micha=c5=82_Win?= =?UTF-8?Q?iarski?= <"\"sagar.a.kamble@intel.commichal.wajdeczko\"@intel.commic?= =?UTF-8?Q?hal.winiarski"@intel.com> List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============1322642003== Content-Type: multipart/alternative; boundary="------------3EBDE66AF7E74C274A503819" Content-Language: en-US This is a multi-part message in MIME format. --------------3EBDE66AF7E74C274A503819 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 9/28/2017 5:15 PM, Chris Wilson wrote: > Quoting Sagar Arun Kamble (2017-09-27 10:30:33) >> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c >> index 174a7c5..f79646b 100644 >> --- a/drivers/gpu/drm/i915/i915_drv.c >> +++ b/drivers/gpu/drm/i915/i915_drv.c >> @@ -1698,6 +1698,16 @@ static int i915_drm_resume(struct drm_device *dev) >> } >> mutex_unlock(&dev->struct_mutex); >> >> + /* >> + * NB: Currently we know that at the end of suspend we have done Full >> + * GPU reset, Hence GuC is loaded again during i915_gem_init_hw. >> + * Now, send action to GuC to resume back again as earlier call to >> + * intel_uc_resume from i915_gem_resume would have done nothing. >> + */ > When you say "GuC is loaded again during i915_gem_init_hw" are you > thinking of the i915_reset call or i915_drm_resume call? We are using > intel_gpu_reset() to do the full device reset at suspend/resume, so > bypassing the i915_gem_init_hw from i915_reset. Could you clarify what > you mean by "hence"? > -Chris Hi Chris, I've updated the comments in the latest revision. Please review v12 patches from https://patchwork.freedesktop.org/series/30802/. Sorry I have pushed few more revisions in past few days as one of the igt fail due to patch change was not caught by trybot. From Latest patch: @@ -1698,6 +1698,18 @@static int i915_drm_resume(struct drm_device *dev) } mutex_unlock(&dev->struct_mutex); +/* +* FIXME: Currently we know that at the end of suspend we have done Full +* GPU reset and GuC is loaded again during i915_gem_init_hw. +* Now, send action to GuC to resume back again as earlier call to +* intel_uc_resume from i915_gem_resume would have done nothing. +* This needs to be skipped if GuC was not loaded during resume as +* intel_uc_resume would have been already called from i915_gem_resume. +*/ +ret = intel_uc_resume(dev_priv); +if (ret) +i915_gem_set_wedged(dev_priv); + I referred to intel_gpu_reset from i915_gem_suspend here. Thanks Sagar --------------3EBDE66AF7E74C274A503819 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit



On 9/28/2017 5:15 PM, Chris Wilson wrote:
Quoting Sagar Arun Kamble (2017-09-27 10:30:33)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 174a7c5..f79646b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1698,6 +1698,16 @@ static int i915_drm_resume(struct drm_device *dev)
        }
        mutex_unlock(&dev->struct_mutex);
 
+       /*
+        * NB: Currently we know that at the end of suspend we have done Full
+        * GPU reset, Hence GuC is loaded again during i915_gem_init_hw.
+        * Now, send action to GuC to resume back again as earlier call to
+        * intel_uc_resume from i915_gem_resume would have done nothing.
+        */
When you say "GuC is loaded again during i915_gem_init_hw" are you
thinking of the i915_reset call or i915_drm_resume call? We are using
intel_gpu_reset() to do the full device reset at suspend/resume, so
bypassing the i915_gem_init_hw from i915_reset. Could you clarify what
you mean by "hence"?
-Chris

Hi Chris,
 
I've updated the comments in the latest revision.
Please review v12 patches from https://patchwork.freedesktop.org/series/30802/.
Sorry I have pushed few more revisions in past few days as one of the igt fail due to patch change was not caught by trybot.
 
From Latest patch:
@@ -1698,6 +1698,18 @@  static int i915_drm_resume(struct drm_device *dev)
               }
               mutex_unlock(&dev->struct_mutex);
 
+             /*
+             * FIXME: Currently we know that at the end of suspend we have done Full
+             * GPU reset and GuC is loaded again during i915_gem_init_hw.
+             * Now, send action to GuC to resume back again as earlier call to
+             * intel_uc_resume from i915_gem_resume would have done nothing.
+             * This needs to be skipped if GuC was not loaded during resume as
+             * intel_uc_resume would have been already called from i915_gem_resume.
+             */
+             ret = intel_uc_resume(dev_priv);
+             if (ret)
+                            i915_gem_set_wedged(dev_priv);
+
             

I referred to intel_gpu_reset from i915_gem_suspend here.

Thanks
Sagar

    

--------------3EBDE66AF7E74C274A503819-- --===============1322642003== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1322642003==--