diff mbox

[v2] drm/i915: Differentiate between hangcheck waiting for timer or scheduler

Message ID 20170303090056.19973-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson March 3, 2017, 9 a.m. UTC
Check timer_pending() as well as work_pending() to see if the timer for
the hangcheck has already expired and the work is pending execution on
some list somewhere.

v2: Use a more compact if-chain

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

Comments

Mika Kuoppala March 3, 2017, 9:13 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Check timer_pending() as well as work_pending() to see if the timer for
> the hangcheck has already expired and the work is pending execution on
> some list somewhere.
>
> v2: Use a more compact if-chain
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index a33c09dba105..5b51c9d179ad 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1334,11 +1334,13 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
>  
>  	intel_runtime_pm_put(dev_priv);
>  
> -	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
> -		seq_printf(m, "Hangcheck active, fires in %dms\n",
> +	if (timer_pending(&dev_priv->gpu_error.hangcheck_work.timer))
> +		seq_printf(m, "Hangcheck active, timer fires in %dms\n",
>  			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
>  					    jiffies));
> -	} else
> +	else if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work))
> +		seq_printf(m, "Hangcheck active, work pending\n");
> +	else
>  		seq_printf(m, "Hangcheck inactive\n");
>  
>  	seq_printf(m, "GT active? %s\n", yesno(dev_priv->gt.awake));
> -- 
> 2.11.0
Chris Wilson March 3, 2017, 9:40 a.m. UTC | #2
On Fri, Mar 03, 2017 at 11:13:15AM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Check timer_pending() as well as work_pending() to see if the timer for
> > the hangcheck has already expired and the work is pending execution on
> > some list somewhere.
> >
> > v2: Use a more compact if-chain
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

Pushed in the hope of getting a hit in CI, thanks.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a33c09dba105..5b51c9d179ad 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1334,11 +1334,13 @@  static int i915_hangcheck_info(struct seq_file *m, void *unused)
 
 	intel_runtime_pm_put(dev_priv);
 
-	if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
-		seq_printf(m, "Hangcheck active, fires in %dms\n",
+	if (timer_pending(&dev_priv->gpu_error.hangcheck_work.timer))
+		seq_printf(m, "Hangcheck active, timer fires in %dms\n",
 			   jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
 					    jiffies));
-	} else
+	else if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work))
+		seq_printf(m, "Hangcheck active, work pending\n");
+	else
 		seq_printf(m, "Hangcheck inactive\n");
 
 	seq_printf(m, "GT active? %s\n", yesno(dev_priv->gt.awake));