All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Prevent divide-by-zero in debugfs/i915_rps_boost_info
@ 2017-02-18 11:27 Chris Wilson
  2017-02-18 11:52 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-02-20 11:02 ` [PATCH] " Szwichtenberg, Radoslaw
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-02-18 11:27 UTC (permalink / raw)
  To: intel-gfx

Either by chance, or by misread, the current evaluation interval may be
zero. If that is the case, don't divide by it!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 124213a36b4f..c0bc922fe497 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2367,10 +2367,10 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
 		seq_printf(m, "\nRPS Autotuning (current \"%s\" window):\n",
 			   rps_power_to_str(dev_priv->rps.power));
 		seq_printf(m, "  Avg. up: %d%% [above threshold? %d%%]\n",
-			   100 * rpup / rpupei,
+			   rpup && rpupei ? 100 * rpup / rpupei : 0,
 			   dev_priv->rps.up_threshold);
 		seq_printf(m, "  Avg. down: %d%% [below threshold? %d%%]\n",
-			   100 * rpdown / rpdownei,
+			   rpdown && rpdownei ? 100 * rpdown / rpdownei : 0,
 			   dev_priv->rps.down_threshold);
 	} else {
 		seq_puts(m, "\nRPS Autotuning inactive\n");
-- 
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

end of thread, other threads:[~2017-02-20 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-18 11:27 [PATCH] drm/i915: Prevent divide-by-zero in debugfs/i915_rps_boost_info Chris Wilson
2017-02-18 11:52 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-02-20 11:02 ` [PATCH] " Szwichtenberg, Radoslaw
2017-02-20 11:06   ` chris

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.