From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Tvrtko Ursulin <tursulin@ursulin.net>,
Intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
"Paneri, Praveen" <praveen.paneri@intel.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
"v4 . 10+" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] drm/i915: Fix forcewake active domain tracking
Date: Fri, 10 Mar 2017 09:09:06 +0000 [thread overview]
Message-ID: <0fa6e2fa-4677-7e03-ce3f-b23d8ddae433@linux.intel.com> (raw)
In-Reply-To: <20170310085000.GL28427@nuc-i3427.alporthouse.com>
On 10/03/2017 08:50, Chris Wilson wrote:
> On Fri, Mar 10, 2017 at 07:32:51AM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> In commit 003342a50021 ("drm/i915: Keep track of active
>> forcewake domains in a bitmask") I forgot to adjust the
>> newly introduce fw_domains_active state across reset.
>>
>> This caused the assert_forcewakes_inactive to trigger
>> during suspend and resume if there were user held
>> forcewakes.
>>
>> v2: Bitmask checks are required since vfuncs are not
>> always present.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Fixes: 003342a50021 ("drm/i915: Keep track of active forcewake domains in a bitmask")
>> Testcase: igt/drv_suspend/forcewake
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: "Paneri, Praveen" <praveen.paneri@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: intel-gfx@lists.freedesktop.org
>> Cc: v4.10+ <stable@vger.kernel.org>
>> ---
>> drivers/gpu/drm/i915/intel_uncore.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
>> index 2a3f35c30501..7efae77faca0 100644
>> --- a/drivers/gpu/drm/i915/intel_uncore.c
>> +++ b/drivers/gpu/drm/i915/intel_uncore.c
>> @@ -304,12 +304,14 @@ static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
>> fw = dev_priv->uncore.fw_domains_active;
>> if (fw)
>> dev_priv->uncore.funcs.force_wake_put(dev_priv, fw);
>> + dev_priv->uncore.fw_domains_active = 0;
>
> Hmm, I think we would be happier with (think of a good name)
>
> static void __intel_uncore_force_wake_get(i915, fw_domains)
> {
> i915->uncore.funcs.force_wake_get(i915, fw_domains);
> i915->uncore.funcs.fw_domains_active |= fw_domain;
> }
>
> static void __intel_uncore_force_wake_put(i915, fw_domains)
> {
> i915->uncore.funcs.force_wake_put(i915, fw_domains);
> i915->uncore.funcs.fw_domains_active &= ~fw_domain;
> }
>
> Another alternative would be to move the bitops down to the callbacks.
> gcc might be happier, at the expense of some duplication and risk of
> forgetting.
>
> Anyway worth the effort?
Yes I agree, was considering the second option myself. Think I still
prefer that one to keep the inseparable together.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-10 9:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 15:52 [PATCH] drm/i915: Fix forcewake active domain tracking Tvrtko Ursulin
2017-03-09 19:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-03-09 20:48 ` Chris Wilson
2017-03-09 21:12 ` [PATCH] " Chris Wilson
2017-03-10 7:32 ` [PATCH v2] " Tvrtko Ursulin
2017-03-10 8:50 ` Chris Wilson
2017-03-10 9:09 ` Tvrtko Ursulin [this message]
2017-03-10 9:32 ` [PATCH v3] " Tvrtko Ursulin
2017-03-10 10:54 ` Chris Wilson
2017-03-10 11:51 ` Tvrtko Ursulin
2017-03-10 9:22 ` ✓ Fi.CI.BAT: success for drm/i915: Fix forcewake active domain tracking (rev2) Patchwork
2017-03-10 10:47 ` ✓ Fi.CI.BAT: success for drm/i915: Fix forcewake active domain tracking (rev4) 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=0fa6e2fa-4677-7e03-ce3f-b23d8ddae433@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@intel.com \
--cc=jani.nikula@linux.intel.com \
--cc=praveen.paneri@intel.com \
--cc=stable@vger.kernel.org \
--cc=tursulin@ursulin.net \
--cc=tvrtko.ursulin@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