public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/i915: Catch non-existent registers in find_fw_domain
Date: Wed, 7 Dec 2016 18:18:02 +0000	[thread overview]
Message-ID: <c894dab0-4712-b0b1-d4e5-c854ba5001ea@linux.intel.com> (raw)
In-Reply-To: <1481120559-17413-1-git-send-email-joonas.lahtinen@linux.intel.com>


On 07/12/2016 14:22, Joonas Lahtinen wrote:
> Add WARN_ON to find_fw_domain to registers related to uninitialized
> hardware.
>
> v2:
> - Print the uninitialized domains and register (Chris)
>
> 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 | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 07779d0..88f3611 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -625,7 +625,14 @@ 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(entry->domains & ~dev_priv->uncore.fw_domains,
> +	     "Uninitialized forcewake domain(s) 0x%x accessed at 0x%x\n",
> +	     entry->domains & ~dev_priv->uncore.fw_domains, offset);
> +
> +	return entry->domains;
>  }
>
>  static void
>

Only slight issues I can spot is that for some platforms, should it 
trigger, it would trigger twice since 
intel_uncore_forcewake_for_read/write functions have the same WARN.

If we wanted to avoid that then this WARN would work better in 
fwtable_read/write I think.

Regards,

Tvrtko

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

  parent reply	other threads:[~2016-12-07 18:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c894dab0-4712-b0b1-d4e5-c854ba5001ea@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox