Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <andi.shyti@linux.intel.com>,
	<vidya.srinivas@intel.com>
Subject: Re: [RFC PATCH] i915/gt: Reapply workarounds in case the previous attempt failed.
Date: Fri, 6 Dec 2024 10:38:24 -0500	[thread overview]
Message-ID: <Z1MacMC8XyyyHcqj@intel.com> (raw)
In-Reply-To: <aqoql4ri3vpe4larpkz4p6hxy76agq6pmn6gunt5xv56hxdbye@72ilwk7rpiu5>

On Thu, Dec 05, 2024 at 03:47:35PM +0000, Sebastian Brzezinka wrote:
> `wa_verify`sporadically detects lost workaround on application; this
> is unusual behavior since wa are applied at `intel_gt_init_hw` and
> verified right away by `intel_gt_verify_workarounds`, and  `wa_verify`
> doesn't fail on initialization as one might suspect would happen.
> 
> One approach that may be somewhat beneficial is to reapply workarounds
> in the event of failure, or even get rid of verify on application,
> since it's redundant to `intel_gt_verify_workarounds`.
> 
> This patch aims to resolve: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12668

It should be:

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12668

> 
> Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_workarounds.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index 570c91878189..4ee623448223 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -1761,6 +1761,17 @@ static void wa_list_apply(const struct i915_wa_list *wal)
>  				intel_gt_mcr_read_any_fw(gt, wa->mcr_reg) :
>  				intel_uncore_read_fw(uncore, wa->reg);
>  
> +			if ((val ^ wa->set) & wa->read) { 
> +				if (wa->is_mcr)
> +					intel_gt_mcr_multicast_write_fw(gt, wa->mcr_reg, val);
> +				else
> +					intel_uncore_write_fw(uncore, wa->reg, val);
> +			}

instead of duplicating the code you should extract that to an aux function
to write it...

> +
> +			val = wa->is_mcr ?
> +				intel_gt_mcr_read_any_fw(gt, wa->mcr_reg) :
> +				intel_uncore_read_fw(uncore, wa->reg);

and another one to read it...

> +
>  			wa_verify(gt, wa, val, wal->name, "application");

However my biggest concern with this patch is the brute force solution
and only on CONFIG_DRM_I915_DEBUG_GEM case...

and as duplication because I see that the second write attempt is
already happening above if (val != old || !wa->clr)

So, something is not quite right in here and this deserves another alternative..


>  		}
>  	}
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2024-12-06 15:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 15:47 [RFC PATCH] i915/gt: Reapply workarounds in case the previous attempt failed Sebastian Brzezinka
2024-12-05 21:45 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-12-05 22:04 ` ✗ i915.CI.BAT: failure " Patchwork
2024-12-06 12:36 ` ✗ Fi.CI.CHECKPATCH: warning for i915/gt: Reapply workarounds in case the previous attempt failed. (rev2) Patchwork
2024-12-06 12:45 ` ✓ i915.CI.BAT: success " Patchwork
2024-12-06 14:03 ` ✓ i915.CI.Full: " Patchwork
2024-12-06 15:38 ` Rodrigo Vivi [this message]
2024-12-12 14:51   ` [RFC PATCH] i915/gt: Reapply workarounds in case the previous attempt failed Andi Shyti
2024-12-16 21:27     ` Matt Roper
2024-12-18 14:48       ` Andi Shyti

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=Z1MacMC8XyyyHcqj@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sebastian.brzezinka@intel.com \
    --cc=vidya.srinivas@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