drm/i915/guc: Skip suspend/resume GuC action on platforms w/o GuC submission

Submitted by Hiatt, Don on Oct. 28, 2019, 9:25 p.m.

Details

Message ID 20191028212527.24401-1-don.hiatt@intel.com
State New
Headers show
Series "drm/i915/guc: Skip suspend/resume GuC action on platforms w/o GuC submission" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Hiatt, Don Oct. 28, 2019, 9:25 p.m.
From: Don Hiatt <don.hiatt@intel.com>

On some platforms (e.g. KBL) that do not support GuC submission, but
the user enabled the GuC communication (e.g for HuC authentication)
calling the GuC EXIT_S_STATE action results in lose of ability to
enter RC6. We can remove the GuC suspend/remove entirely as we do
not need to save the GuC submission status.

v2: Do not suspend/resume the GuC on platforms that do not support
    Guc Submission.

Signed-off-by: Don Hiatt <don.hiatt@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
index 3fdbc935d155..04031564f0b1 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
@@ -572,10 +572,19 @@  void intel_uc_runtime_suspend(struct intel_uc *uc)
 	if (!intel_guc_is_running(guc))
 		return;
 
+	/*
+	 * If GuC communciation is enabled but submission is not supported,
+	 * we do not need to suspend the GuC but we do need to disable the
+	 * GuC communication on suspend.
+	 */
+	if (!guc->submission_supported)
+		goto guc_disable_comm;
+
 	err = intel_guc_suspend(guc);
 	if (err)
 		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
 
+guc_disable_comm:
 	guc_disable_communication(guc);
 }
 
@@ -605,6 +614,14 @@  static int __uc_resume(struct intel_uc *uc, bool enable_communication)
 	if (enable_communication)
 		guc_enable_communication(guc);
 
+	/*
+	 * If GuC communciation is enabled but submission is not supported,
+	 * we do not need to resume the GuC but we do need to enable the
+	 * GuC communication on resume (above).
+	 */
+	if (!guc->submission_supported)
+		return 0;
+
 	err = intel_guc_resume(guc);
 	if (err) {
 		DRM_DEBUG_DRIVER("Failed to resume GuC, err=%d", err);

Comments

On Mon, 28 Oct 2019 22:25:27 +0100, <don.hiatt@intel.com> wrote:

> From: Don Hiatt <don.hiatt@intel.com>
>
> On some platforms (e.g. KBL) that do not support GuC submission, but
> the user enabled the GuC communication (e.g for HuC authentication)
> calling the GuC EXIT_S_STATE action results in lose of ability to
> enter RC6. We can remove the GuC suspend/remove entirely as we do
> not need to save the GuC submission status.
>
> v2: Do not suspend/resume the GuC on platforms that do not support
>     Guc Submission.
>
> Signed-off-by: Don Hiatt <don.hiatt@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c  
> b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> index 3fdbc935d155..04031564f0b1 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> @@ -572,10 +572,19 @@ void intel_uc_runtime_suspend(struct intel_uc *uc)
>  	if (!intel_guc_is_running(guc))
>  		return;
> +	/*
> +	 * If GuC communciation is enabled but submission is not supported,

typo

> +	 * we do not need to suspend the GuC but we do need to disable the
> +	 * GuC communication on suspend.
> +	 */
> +	if (!guc->submission_supported)

Using submission_supported flag directly can be tricky, as today it
is always set to false, but in the future it may indicate either that
submission is supported by the driver/fw and/or enabled by modparam.

There is no guarantee that it will reflect actual runtime status,
as even supported/unblocked guc submission may fallback to execlists.

We may need something like intel_guc_submission_is_active() that will
reflect actual mode of submission currently used by the driver.

> +		goto guc_disable_comm;

and maybe we can move above logic to intel_guc_suspend()
to do not introduce extra goto's ?

> +
>  	err = intel_guc_suspend(guc);
>  	if (err)
>  		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
> +guc_disable_comm:
>  	guc_disable_communication(guc);
>  }
> @@ -605,6 +614,14 @@ static int __uc_resume(struct intel_uc *uc, bool  
> enable_communication)
>  	if (enable_communication)
>  		guc_enable_communication(guc);
> +	/*
> +	 * If GuC communciation is enabled but submission is not supported,

typo

> +	 * we do not need to resume the GuC but we do need to enable the
> +	 * GuC communication on resume (above).
> +	 */
> +	if (!guc->submission_supported)
> +		return 0;

see suspend case comment

> +
>  	err = intel_guc_resume(guc);
>  	if (err) {
>  		DRM_DEBUG_DRIVER("Failed to resume GuC, err=%d", err);

Thanks,
Michal
> From: Wajdeczko, Michal <Michal.Wajdeczko@intel.com>

> Sent: Tuesday, October 29, 2019 5:33 AM

> To: intel-gfx@lists.freedesktop.org; Hiatt, Don <don.hiatt@intel.com>

> Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: Skip suspend/resume GuC action

> on platforms w/o GuC submission

> 

> On Mon, 28 Oct 2019 22:25:27 +0100, <don.hiatt@intel.com> wrote:

> 

> > From: Don Hiatt <don.hiatt@intel.com>

> >

> > On some platforms (e.g. KBL) that do not support GuC submission, but

> > the user enabled the GuC communication (e.g for HuC authentication)

> > calling the GuC EXIT_S_STATE action results in lose of ability to

> > enter RC6. We can remove the GuC suspend/remove entirely as we do

> > not need to save the GuC submission status.

> >

> > v2: Do not suspend/resume the GuC on platforms that do not support

> >     Guc Submission.

> >

> > Signed-off-by: Don Hiatt <don.hiatt@intel.com>

> > ---

> >  drivers/gpu/drm/i915/gt/uc/intel_uc.c | 17 +++++++++++++++++

> >  1 file changed, 17 insertions(+)

> >

> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c

> > b/drivers/gpu/drm/i915/gt/uc/intel_uc.c

> > index 3fdbc935d155..04031564f0b1 100644

> > --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c

> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c

> > @@ -572,10 +572,19 @@ void intel_uc_runtime_suspend(struct intel_uc *uc)

> >  	if (!intel_guc_is_running(guc))

> >  		return;

> > +	/*

> > +	 * If GuC communciation is enabled but submission is not supported,

> 

> typo

> 

> > +	 * we do not need to suspend the GuC but we do need to disable the

> > +	 * GuC communication on suspend.

> > +	 */

> > +	if (!guc->submission_supported)

> 

> Using submission_supported flag directly can be tricky, as today it

> is always set to false, but in the future it may indicate either that

> submission is supported by the driver/fw and/or enabled by modparam.

> 

> There is no guarantee that it will reflect actual runtime status,

> as even supported/unblocked guc submission may fallback to execlists.

> 

> We may need something like intel_guc_submission_is_active() that will

> reflect actual mode of submission currently used by the driver.


Hi Michal,

I looked at your patch wrt checking the set_default_submission vfunc but
as that is for the engine, and here I only have access to the intel_guc struct.
I'm not sure just where I can know what the default submission is and then
flag it somewhere that I can then check here in the suspend/resume. I'll keep
looking (sorry, I'm very new to this code). 😊

Thanks,

don






> 

> > +		goto guc_disable_comm;

> 

> and maybe we can move above logic to intel_guc_suspend()

> to do not introduce extra goto's ?

> 

> > +

> >  	err = intel_guc_suspend(guc);

> >  	if (err)

> >  		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);

> > +guc_disable_comm:

> >  	guc_disable_communication(guc);

> >  }

> > @@ -605,6 +614,14 @@ static int __uc_resume(struct intel_uc *uc, bool

> > enable_communication)

> >  	if (enable_communication)

> >  		guc_enable_communication(guc);

> > +	/*

> > +	 * If GuC communciation is enabled but submission is not supported,

> 

> typo

> 

> > +	 * we do not need to resume the GuC but we do need to enable the

> > +	 * GuC communication on resume (above).

> > +	 */

> > +	if (!guc->submission_supported)

> > +		return 0;

> 

> see suspend case comment

> 

> > +

> >  	err = intel_guc_resume(guc);

> >  	if (err) {

> >  		DRM_DEBUG_DRIVER("Failed to resume GuC, err=%d", err);

> 

> Thanks,

> Michal