public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Subject: Re: [PATCH] drm/i915: Fix off-by-one in looking up icl sseu slice
Date: Tue, 28 May 2019 20:45:05 +0000	[thread overview]
Message-ID: <841d0d2765421947fbbeeefc523fbd3cbb516da2.camel@intel.com> (raw)
In-Reply-To: <20190528200655.11605-1-chris@chris-wilson.co.uk>


[-- Attachment #1.1: Type: text/plain, Size: 2153 bytes --]

On Tue, 2019-05-28 at 21:06 +0100, Chris Wilson wrote:
> We want the index corresponding to the set bit but fls() returns the
> 1-index value.
> 
> Otherwise, we trigger the sanitycheck
> 	intel_sseu_get_subslices:46 GEM_BUG_ON(slice >= sseu-
> >max_slices)
> when we look up the invalid slice.
> 
> The only remaining question then is just how reliable the rest of
> intel_calculate_mcr_s_ss_select() is -- how many more of those fls()
> are
> also off-by-one.
> 
> Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask")
> Fixes: 1e40d4aea57b ("drm/i915/cnl: Implement
> WaProgramMgsrForCorrectSliceSpecificMmioReads")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Stuart Summers <stuart.summers@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_workarounds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index fbc853085809..485cd1c8ecc4 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -781,7 +781,7 @@ wa_init_mcr(struct drm_i915_private *i915, struct
> i915_wa_list *wal)
>  		 * read FUSE3 for enabled L3 Bank IDs, if L3 Bank
> matches
>  		 * enabled subslice, no need to redirect MCR packet
>  		 */
> -		u32 slice = fls(sseu->slice_mask);
> +		u32 slice = __fls(sseu->slice_mask);

The condition around this (is_power_of_2) makes sure we meet the case
where the slice_mask is uninitialized. This is going to work here, but
might not work in all other places. If we propagate this change to the
other places we call fls(slice_mask), which I'd recommend, we'll want
to make sure we check for that.

Once we show results in CI:
Reviewed-by: Stuart Summers <stuart.summers@intel.com>

>  		u32 fuse3 =
>  			intel_uncore_read(&i915->uncore,
> GEN10_MIRROR_FUSE3);
>  		u32 ss_mask = intel_sseu_get_subslices(sseu, slice);

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3270 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2019-05-28 20:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 20:06 [PATCH] drm/i915: Fix off-by-one in looking up icl sseu slice Chris Wilson
2019-05-28 20:45 ` Summers, Stuart [this message]
2019-05-28 22:03   ` Chris Wilson
2019-05-28 22:05     ` Chris Wilson
2019-05-28 22:17       ` Summers, Stuart
2019-05-28 21:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-05-29  8:08 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-29  8:26 ` [PATCH] " Jani Nikula
2019-05-29 14:23   ` Jani Nikula
2019-05-29 14:32     ` Saarinen, Jani

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=841d0d2765421947fbbeeefc523fbd3cbb516da2.camel@intel.com \
    --to=stuart.summers@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