public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Do uncore early sanitize after domain init
Date: Wed, 28 Jan 2015 12:59:52 +0200	[thread overview]
Message-ID: <87zj93891z.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20150128104550.GA25850@nuc-i3427.alporthouse.com>

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

> On Wed, Jan 28, 2015 at 10:17:39AM +0000, Chris Wilson wrote:
>> On Wed, Jan 28, 2015 at 11:45:04AM +0200, Mika Kuoppala wrote:
>> > intel_uncore_early_sanitize() will reset the forcewake registers. When
>> > forcewake domains were introduced, the domain init was done after the
>> > sanitization of the forcewake registers. And as the resetting of
>> > registers use the domain accessors, we tried to reset the forcewake
>> > registers with unitialized forcewake domains and failed.
>> > 
>> > Fix this by sanitizing after all the domains have been initialized.
>> > On ivb we need special care as there we need early forcewake access to
>> > determine the final configuration for the forcewake domain.
>> > 
>> > This regression was introduced in
>> > 
>> > commit 05a2fb157e44a53c79133805d30eaada43911941
>> > Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> > Date:   Mon Jan 19 16:20:43 2015 +0200
>> > 
>> >     drm/i915: Consolidate forcewake code
>> > 
>> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88805
>> > Reported-by: Olof Johansson <olof@lixom.net>
>> > Tested-by: Darren Hart <dvhart@linux.intel.com>
>> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/intel_uncore.c | 11 +++++++++--
>> >  1 file changed, 9 insertions(+), 2 deletions(-)
>> > 
>> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
>> > index b3951f2..c438ca4 100644
>> > --- a/drivers/gpu/drm/i915/intel_uncore.c
>> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
>> > @@ -72,6 +72,7 @@ assert_device_not_suspended(struct drm_i915_private *dev_priv)
>> >  static inline void
>> >  fw_domain_reset(const struct intel_uncore_forcewake_domain *d)
>> >  {
>> > +	WARN_ON(d->reg_set == 0);
>> >  	__raw_i915_write32(d->i915, d->reg_set, d->val_reset);
>> >  }
>> >  
>> > @@ -166,6 +167,8 @@ fw_domains_reset(struct drm_i915_private *dev_priv, enum forcewake_domains fw_do
>> >  	struct intel_uncore_forcewake_domain *d;
>> >  	enum forcewake_domain_id id;
>> >  
>> > +	WARN_ON(dev_priv->uncore.fw_domains == 0);
>> > +
>> >  	for_each_fw_domain_mask(d, fw_domains, dev_priv, id)
>> >  		fw_domain_reset(d);
>> >  
>> > @@ -987,8 +990,7 @@ static void fw_domain_init(struct drm_i915_private *dev_priv,
>> >  void intel_uncore_init(struct drm_device *dev)
>> >  {
>> >  	struct drm_i915_private *dev_priv = dev->dev_private;
>> > -
>> > -	__intel_uncore_early_sanitize(dev, false);
>> > +	bool sanitize_done = false;
>> 
>> I felt this looks quite clumsy. The only reason why you want to restrict
>> calling __intel_uncore_early_sanitize() is that it does ellc_size
>> detection and has a DRM_INFO right?
>> 
>> I think you want to pull that out of __intel_uncore_early_santize() into
>> intel_uncore_init() itself (or better, it's own
>> intel_uncore_ellc_detect()). ellc_size detection has nothing to do with
>> sanitizing register state.
>> 
>> Then it should be simple to enough to sanitize twice, once with a
>> comment in the code explaining how we verify that FORCEWAKE_MT is
>> enabled by a manual forcewaked read of ECOBUS.
>
> Also, why are we not calling fw_domain_reset() from fw_domain_init()?
> That would be enough to avoid the early santize required for ivb,
> right?

Agreed here. That was my plan originally, doing the sanitize inside 
in domain inits. But I wanted to fix this particular item by trying to
be as close as possible to the previous init/forcewake ordering on all gens. 

Reasoning is that I would like to see this stabilize a short while
before introducing further changes. I burned my fingers already touching
these, so they need to heal :)

Ok if this is for future work?

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

  reply	other threads:[~2015-01-28 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28  9:45 [PATCH] drm/i915: Do uncore early sanitize after domain init Mika Kuoppala
2015-01-28 10:17 ` Chris Wilson
2015-01-28 10:45   ` Chris Wilson
2015-01-28 10:59     ` Mika Kuoppala [this message]
2015-01-28 11:29       ` Chris Wilson
2015-01-28 12:46         ` Mika Kuoppala
2015-02-01 15:36 ` shuang.he

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=87zj93891z.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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