public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Catch non-existent registers in find_fw_domain
@ 2016-12-07 13:49 Joonas Lahtinen
  2016-12-07 14:01 ` Chris Wilson
  2016-12-07 17:45 ` ✓ Fi.CI.BAT: success for drm/i915: Catch non-existent registers in find_fw_domain (rev2) Patchwork
  0 siblings, 2 replies; 9+ messages in thread
From: Joonas Lahtinen @ 2016-12-07 13:49 UTC (permalink / raw)
  To: Intel graphics driver community testing & development

Add WARN_ON to find_fw_domain to registers related to uninitialized
hardware.

Cc: Imre Deak <imre.deak@intel.com>
Cc: Wang Elaine <elaine.wang@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 07779d0..b20b58e 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -625,7 +625,12 @@ find_fw_domain(struct drm_i915_private *dev_priv, u32 offset)
 			dev_priv->uncore.fw_domains_table_entries,
 			fw_range_cmp);
 
-	return entry ? entry->domains : 0;
+	if (!entry)
+		return 0;
+
+	WARN_ON(entry->domains & ~dev_priv->uncore.fw_domains);
+
+	return entry->domains;
 }
 
 static void
-- 
2.7.4

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

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

end of thread, other threads:[~2016-12-08  7:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07 13:49 [PATCH] drm/i915: Catch non-existent registers in find_fw_domain Joonas Lahtinen
2016-12-07 14:01 ` Chris Wilson
2016-12-07 14:08   ` Joonas Lahtinen
2016-12-07 14:22   ` [PATCH v2] " Joonas Lahtinen
2016-12-07 14:40     ` Chris Wilson
2016-12-07 18:18     ` Tvrtko Ursulin
2016-12-07 18:28       ` Chris Wilson
2016-12-08  7:53         ` Joonas Lahtinen
2016-12-07 17:45 ` ✓ Fi.CI.BAT: success for drm/i915: Catch non-existent registers in find_fw_domain (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox