All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Include power-management state in gpu error dump
@ 2017-03-02 15:15 Chris Wilson
  2017-03-02 15:29 ` Mika Kuoppala
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2017-03-02 15:15 UTC (permalink / raw)
  To: intel-gfx

Useful for double checking that the device is powered up when it hung,
include both the status of the power management and our rpm wakelock.

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

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 66f19924828a..28d8e95b4a14 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -937,6 +937,8 @@ struct i915_gpu_state {
 	char error_msg[128];
 	bool simulated;
 	bool awake;
+	bool wakelock;
+	bool suspended;
 	int iommu;
 	u32 reset_count;
 	u32 suspend_count;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index b4ae1464e0ab..8e14986f123c 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -633,6 +633,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	}
 
 	err_printf(m, "GT awake: %s\n", yesno(error->awake));
+	err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock));
+	err_printf(m, "PM suspended: %s\n", yesno(error->suspended));
 	err_printf(m, "EIR: 0x%08x\n", error->eir);
 	err_printf(m, "IER: 0x%08x\n", error->ier);
 	for (i = 0; i < error->ngtier; i++)
@@ -1655,6 +1657,8 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
 				   struct i915_gpu_state *error)
 {
 	error->awake = dev_priv->gt.awake;
+	error->wakelock = atomic_read(&dev_priv->pm.wakeref_count);
+	error->suspended = dev_priv->pm.suspended;
 
 	error->iommu = -1;
 #ifdef CONFIG_INTEL_IOMMU
-- 
2.11.0

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

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

* Re: [PATCH] drm/i915: Include power-management state in gpu error dump
  2017-03-02 15:15 [PATCH] drm/i915: Include power-management state in gpu error dump Chris Wilson
@ 2017-03-02 15:29 ` Mika Kuoppala
  2017-03-02 15:39   ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Kuoppala @ 2017-03-02 15:29 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

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

> Useful for double checking that the device is powered up when it hung,
> include both the status of the power management and our rpm wakelock.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       | 2 ++
>  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 66f19924828a..28d8e95b4a14 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -937,6 +937,8 @@ struct i915_gpu_state {
>  	char error_msg[128];
>  	bool simulated;
>  	bool awake;
> +	bool wakelock;
> +	bool suspended;
>  	int iommu;
>  	u32 reset_count;
>  	u32 suspend_count;
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index b4ae1464e0ab..8e14986f123c 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -633,6 +633,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  	}
>  
>  	err_printf(m, "GT awake: %s\n", yesno(error->awake));
> +	err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock));

Why not print the count as we have it?
-Mika

> +	err_printf(m, "PM suspended: %s\n", yesno(error->suspended));
>  	err_printf(m, "EIR: 0x%08x\n", error->eir);
>  	err_printf(m, "IER: 0x%08x\n", error->ier);
>  	for (i = 0; i < error->ngtier; i++)
> @@ -1655,6 +1657,8 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
>  				   struct i915_gpu_state *error)
>  {
>  	error->awake = dev_priv->gt.awake;
> +	error->wakelock = atomic_read(&dev_priv->pm.wakeref_count);
> +	error->suspended = dev_priv->pm.suspended;
>  
>  	error->iommu = -1;
>  #ifdef CONFIG_INTEL_IOMMU
> -- 
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Include power-management state in gpu error dump
  2017-03-02 15:29 ` Mika Kuoppala
@ 2017-03-02 15:39   ` Chris Wilson
  2017-03-02 16:40     ` Mika Kuoppala
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2017-03-02 15:39 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

On Thu, Mar 02, 2017 at 05:29:18PM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Useful for double checking that the device is powered up when it hung,
> > include both the status of the power management and our rpm wakelock.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h       | 2 ++
> >  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++++
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 66f19924828a..28d8e95b4a14 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -937,6 +937,8 @@ struct i915_gpu_state {
> >  	char error_msg[128];
> >  	bool simulated;
> >  	bool awake;
> > +	bool wakelock;
> > +	bool suspended;
> >  	int iommu;
> >  	u32 reset_count;
> >  	u32 suspend_count;
> > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> > index b4ae1464e0ab..8e14986f123c 100644
> > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> > @@ -633,6 +633,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
> >  	}
> >  
> >  	err_printf(m, "GT awake: %s\n", yesno(error->awake));
> > +	err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock));
> 
> Why not print the count as we have it?

I didn't consider it worthwhile knowing the count without the who. For
the purpose of debugging a hang, I just had one question: was the device
powered, did we think it should be?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Include power-management state in gpu error dump
  2017-03-02 15:39   ` Chris Wilson
@ 2017-03-02 16:40     ` Mika Kuoppala
  0 siblings, 0 replies; 4+ messages in thread
From: Mika Kuoppala @ 2017-03-02 16:40 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

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

> On Thu, Mar 02, 2017 at 05:29:18PM +0200, Mika Kuoppala wrote:
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> 
>> > Useful for double checking that the device is powered up when it hung,
>> > include both the status of the power management and our rpm wakelock.
>> >
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/i915_drv.h       | 2 ++
>> >  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++++
>> >  2 files changed, 6 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> > index 66f19924828a..28d8e95b4a14 100644
>> > --- a/drivers/gpu/drm/i915/i915_drv.h
>> > +++ b/drivers/gpu/drm/i915/i915_drv.h
>> > @@ -937,6 +937,8 @@ struct i915_gpu_state {
>> >  	char error_msg[128];
>> >  	bool simulated;
>> >  	bool awake;
>> > +	bool wakelock;
>> > +	bool suspended;
>> >  	int iommu;
>> >  	u32 reset_count;
>> >  	u32 suspend_count;
>> > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
>> > index b4ae1464e0ab..8e14986f123c 100644
>> > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
>> > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
>> > @@ -633,6 +633,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>> >  	}
>> >  
>> >  	err_printf(m, "GT awake: %s\n", yesno(error->awake));
>> > +	err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock));
>> 
>> Why not print the count as we have it?
>
> I didn't consider it worthwhile knowing the count without the who. For
> the purpose of debugging a hang, I just had one question: was the device
> powered, did we think it should be?

1 vs >100 could be revealing, but perhaps theoretical.
I can live with this.

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> -Chris
>
> -- 
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-03-02 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02 15:15 [PATCH] drm/i915: Include power-management state in gpu error dump Chris Wilson
2017-03-02 15:29 ` Mika Kuoppala
2017-03-02 15:39   ` Chris Wilson
2017-03-02 16:40     ` 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.