From: "Souza, Jose" <jose.souza@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v2] lib/debugfs: Sanity check even discarded CRCs
Date: Mon, 18 May 2020 19:06:27 +0000 [thread overview]
Message-ID: <d4c196efe8d7afc567cc6291a7a0b18886c56992.camel@intel.com> (raw)
In-Reply-To: <20200515143857.21222-1-ville.syrjala@linux.intel.com>
On Fri, 2020-05-15 at 17:38 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We currently only spot check some of the CRCs. We should check them
> all. This will probably cause failures on machines with PSR as
> it looks like the CRC captured after PSR exit is bogus. Or at least
> it is on ICL. We should probably just disable PSR whenever CRC
> capturing is active.
There was some PSR changes around CRC, it should not be a problem anymore.
>
> v2: Rebase
>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> #v1
> References: https://bugs.freedesktop.org/show_bug.cgi?id=106974
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_debugfs.c | 47 ++++++++++++++++++++++-------------------------
> 1 file changed, 22 insertions(+), 25 deletions(-)
>
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index 0506707852f0..73975f922e19 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -759,6 +759,26 @@ static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
> return true;
> }
>
> +static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> + bool all_zero = true;
> +
> + /* Any CRC value can be considered valid on amdgpu hardware. */
> + if (is_amdgpu_device(pipe_crc->fd))
> + return;
> +
> + for (int i = 0; i < crc->n_words; i++) {
> + igt_warn_on_f(crc->crc[i] == 0xffffffff,
> + "Suspicious CRC: it looks like the CRC "
> + "read back was from a register in a powered "
> + "down well\n");
> + if (crc->crc[i])
> + all_zero = false;
> + }
> +
> + igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> +}
> +
> static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> {
> ssize_t bytes_read;
> @@ -776,6 +796,8 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
> return -EINVAL;
>
> + crc_sanity_checks(pipe_crc, out);
> +
> return bytes_read;
> }
>
> @@ -885,27 +907,6 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> return n;
> }
>
> -static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> - int i;
> - bool all_zero = true;
> -
> - /* Any CRC value can be considered valid on amdgpu hardware. */
> - if (is_amdgpu_device(pipe_crc->fd))
> - return;
> -
> - for (i = 0; i < crc->n_words; i++) {
> - igt_warn_on_f(crc->crc[i] == 0xffffffff,
> - "Suspicious CRC: it looks like the CRC "
> - "read back was from a register in a powered "
> - "down well\n");
> - if (crc->crc[i])
> - all_zero = false;
> - }
> -
> - igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> -}
> -
> /**
> * igt_pipe_crc_drain:
> * @pipe_crc: pipe CRC object
> @@ -946,8 +947,6 @@ void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
> void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> {
> read_one_crc(pipe_crc, crc);
> -
> - crc_sanity_checks(pipe_crc, crc);
> }
>
> /**
> @@ -974,8 +973,6 @@ igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> return;
> }
> } while (igt_vblank_before(crc->frame, vblank));
> -
> - crc_sanity_checks(pipe_crc, crc);
> }
>
> /**
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-05-18 19:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 10:57 [igt-dev] [PATCH i-g-t] lib/debugfs: Sanity check even discarded CRCs Ville Syrjala
2018-12-13 11:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-12-13 20:51 ` [igt-dev] [PATCH i-g-t] " Dhinakaran Pandiyan
2018-12-19 14:46 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/debugfs: Sanity check even discarded CRCs (rev2) Patchwork
2020-05-15 14:38 ` [igt-dev] [PATCH i-g-t v2] lib/debugfs: Sanity check even discarded CRCs Ville Syrjala
2020-05-18 19:06 ` Souza, Jose [this message]
2020-05-15 15:12 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/debugfs: Sanity check even discarded CRCs (rev3) Patchwork
2020-05-15 18:14 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-15 18:52 ` Ville Syrjälä
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=d4c196efe8d7afc567cc6291a7a0b18886c56992.camel@intel.com \
--to=jose.souza@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@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