All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
@ 2018-03-20 15:17 Mika Kuoppala
  2018-03-20 15:17 ` [PATCH 2/2] drm/i915: Warn if rps max frequency is not set Mika Kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-20 15:17 UTC (permalink / raw)
  To: intel-gfx

Looping through rps frequencies when both min and max are zero
ends up into an endless loop. This can happen during hardware
enablement.

Bail out early if rps frequencies are not correctly set yet.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index dd5ddb77b306..19e82aaa9863 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6890,15 +6890,18 @@ static void gen6_enable_rps(struct drm_i915_private *dev_priv)
 static void gen6_update_ring_freq(struct drm_i915_private *dev_priv)
 {
 	struct intel_rps *rps = &dev_priv->gt_pm.rps;
-	int min_freq = 15;
+	const int min_freq = 15;
+	const int scaling_factor = 180;
 	unsigned int gpu_freq;
 	unsigned int max_ia_freq, min_ring_freq;
 	unsigned int max_gpu_freq, min_gpu_freq;
-	int scaling_factor = 180;
 	struct cpufreq_policy *policy;
 
 	WARN_ON(!mutex_is_locked(&dev_priv->pcu_lock));
 
+	if (rps->max_freq <= rps->min_freq)
+		return;
+
 	policy = cpufreq_cpu_get(0);
 	if (policy) {
 		max_ia_freq = policy->cpuinfo.max_freq;
@@ -6932,7 +6935,7 @@ static void gen6_update_ring_freq(struct drm_i915_private *dev_priv)
 	 * the PCU should use as a reference to determine the ring frequency.
 	 */
 	for (gpu_freq = max_gpu_freq; gpu_freq >= min_gpu_freq; gpu_freq--) {
-		int diff = max_gpu_freq - gpu_freq;
+		const int diff = max_gpu_freq - gpu_freq;
 		unsigned int ia_freq = 0, ring_freq = 0;
 
 		if (IS_GEN9_BC(dev_priv) || IS_CANNONLAKE(dev_priv)) {
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] drm/i915: Warn if rps max frequency is not set
  2018-03-20 15:17 [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Mika Kuoppala
@ 2018-03-20 15:17 ` Mika Kuoppala
  2018-03-20 16:28   ` Mika Kuoppala
  2018-03-20 15:56 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Patchwork
  2018-03-22 21:36 ` [PATCH 1/2] " Chris Wilson
  2 siblings, 1 reply; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-20 15:17 UTC (permalink / raw)
  To: intel-gfx

Warn on enabling rps when our hw max is invalid.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 19e82aaa9863..bc335c52a17a 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -8157,6 +8157,8 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)
 		intel_init_emon(dev_priv);
 	}
 
+	WARN_ON(rps->max_freq == 0);
+
 	WARN_ON(rps->max_freq < rps->min_freq);
 	WARN_ON(rps->idle_freq > rps->max_freq);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
  2018-03-20 15:17 [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Mika Kuoppala
  2018-03-20 15:17 ` [PATCH 2/2] drm/i915: Warn if rps max frequency is not set Mika Kuoppala
@ 2018-03-20 15:56 ` Patchwork
  2018-03-22 21:36 ` [PATCH 1/2] " Chris Wilson
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-03-20 15:56 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
URL   : https://patchwork.freedesktop.org/series/40289/
State : warning

== Summary ==

Series 40289v1 series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
https://patchwork.freedesktop.org/api/1.0/series/40289/revisions/1/mbox/

---- Possible new issues:

Test drv_hangman:
        Subgroup error-state-basic:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
Test drv_module_reload:
        Subgroup basic-no-display:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup basic-reload:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup basic-reload-inject:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
Test gem_busy:
        Subgroup basic-hang-default:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
Test gem_exec_fence:
        Subgroup await-hang-default:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
Test gem_ringfill:
        Subgroup basic-default-hang:
                pass       -> DMESG-WARN (fi-ilk-650)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup hang-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                incomplete -> PASS       (fi-cfl-s2)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-blb-e6850)
                pass       -> DMESG-WARN (fi-bwr-2160)
                pass       -> DMESG-WARN (fi-elk-e7500)
                pass       -> DMESG-WARN (fi-gdg-551)
                pass       -> DMESG-WARN (fi-ilk-650)
                pass       -> DMESG-WARN (fi-pnv-d510)

---- Known issues:

Test drv_module_reload:
        Subgroup basic-no-display:
                pass       -> DMESG-WARN (fi-bwr-2160) fdo#105268 +1
Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-elk-e7500) fdo#103989 +1
Test gem_ringfill:
        Subgroup basic-default-hang:
                pass       -> DMESG-WARN (fi-elk-e7500) fdo#104058
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-elk-e7500) fdo#105552
WARNING: Long output truncated

9d737cebc219c821989021a3115424165ff7b052 drm-tip: 2018y-03m-20d-14h-56m-05s UTC integration manifest
bb0439e3e798 drm/i915: Warn if rps max frequency is not set
771d861ab5fe drm/i915: Avoid setting ring freq on invalid rps freqs

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8416/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/i915: Warn if rps max frequency is not set
  2018-03-20 15:17 ` [PATCH 2/2] drm/i915: Warn if rps max frequency is not set Mika Kuoppala
@ 2018-03-20 16:28   ` Mika Kuoppala
  2018-03-20 18:01     ` Chris Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-20 16:28 UTC (permalink / raw)
  To: intel-gfx

Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:

> Warn on enabling rps when our hw max is invalid.
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 19e82aaa9863..bc335c52a17a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -8157,6 +8157,8 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)
>  		intel_init_emon(dev_priv);
>  	}
>  
> +	WARN_ON(rps->max_freq == 0);
> +
Ok, this wont fly with gen < 6
-Mika

>  	WARN_ON(rps->max_freq < rps->min_freq);
>  	WARN_ON(rps->idle_freq > rps->max_freq);
>  
> -- 
> 2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/i915: Warn if rps max frequency is not set
  2018-03-20 16:28   ` Mika Kuoppala
@ 2018-03-20 18:01     ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-03-20 18:01 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-03-20 16:28:20)
> Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:
> 
> > Warn on enabling rps when our hw max is invalid.
> >
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_pm.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 19e82aaa9863..bc335c52a17a 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -8157,6 +8157,8 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)
> >               intel_init_emon(dev_priv);
> >       }
> >  
> > +     WARN_ON(rps->max_freq == 0);
> > +
> Ok, this wont fly with gen < 6

Close, we can just guard these by HAS_RPS. I think there's a series you
might want to review...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
  2018-03-20 15:17 [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Mika Kuoppala
  2018-03-20 15:17 ` [PATCH 2/2] drm/i915: Warn if rps max frequency is not set Mika Kuoppala
  2018-03-20 15:56 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Patchwork
@ 2018-03-22 21:36 ` Chris Wilson
  2018-03-23 10:00   ` Mika Kuoppala
  2 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-03-22 21:36 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx

Quoting Mika Kuoppala (2018-03-20 15:17:33)
> Looping through rps frequencies when both min and max are zero
> ends up into an endless loop. This can happen during hardware
> enablement.
> 
> Bail out early if rps frequencies are not correctly set yet.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs
  2018-03-22 21:36 ` [PATCH 1/2] " Chris Wilson
@ 2018-03-23 10:00   ` Mika Kuoppala
  0 siblings, 0 replies; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-23 10:00 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Mika Kuoppala (2018-03-20 15:17:33)
>> Looping through rps frequencies when both min and max are zero
>> ends up into an endless loop. This can happen during hardware
>> enablement.
>> 
>> Bail out early if rps frequencies are not correctly set yet.
>> 
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Pushed. Thanks for review.
-Mika

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-23 10:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 15:17 [PATCH 1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Mika Kuoppala
2018-03-20 15:17 ` [PATCH 2/2] drm/i915: Warn if rps max frequency is not set Mika Kuoppala
2018-03-20 16:28   ` Mika Kuoppala
2018-03-20 18:01     ` Chris Wilson
2018-03-20 15:56 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Avoid setting ring freq on invalid rps freqs Patchwork
2018-03-22 21:36 ` [PATCH 1/2] " Chris Wilson
2018-03-23 10:00   ` Mika Kuoppala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.