mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Coster <Matt.Coster@imgtec.com>
To: Alessio Belle <Alessio.Belle@imgtec.com>
Cc: Frank Binns <Frank.Binns@imgtec.com>,
	Alexandru Dadu <Alexandru.Dadu@imgtec.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/imagination: Fix timestamps in firmware traces
Date: Mon, 3 Mar 2025 12:15:21 +0000	[thread overview]
Message-ID: <41383f9a-ff72-4911-aa2d-00702a8d62eb@imgtec.com> (raw)
In-Reply-To: <20250221-fix-fw-trace-timestamps-v1-1-dba4aeb030ca@imgtec.com>


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

On 21/02/2025 10:49, Alessio Belle wrote:
> When firmware traces are enabled, the firmware dumps 48-bit timestamps
> for each trace as two 32-bit values, highest 32 bits (of which only 16
> useful) first.
> 
> The driver was reassembling them the other way round i.e. interpreting
> the first value in memory as the lowest 32 bits, and the second value
> as the highest 32 bits (then truncated to 16 bits).
> 
> Due to this, firmware trace dumps showed very large timestamps even for
> traces recorded shortly after GPU boot. The timestamps in these dumps
> would also sometimes jump backwards because of the truncation.
> 
> Example trace dumped after loading the powervr module and enabling
> firmware traces, where each line is commented with the timestamp value
> in hexadecimal to better show both issues:
> 
> [93540092739584] : Host Sync Partition marker: 1    // 0x551300000000
> [28419798597632] : GPU units deinit                 // 0x19d900000000
> [28548647616512] : GPU deinit                       // 0x19f700000000
> 
> Update logic to reassemble the timestamps halves in the correct order.
> 
> Fixes: cb56cd610866 ("drm/imagination: Add firmware trace to debugfs")
> Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>

Reviewed-by: Matt Coster <matt.coster@imgtec.com>

Cheers,
Matt

> ---
>  drivers/gpu/drm/imagination/pvr_fw_trace.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imagination/pvr_fw_trace.c b/drivers/gpu/drm/imagination/pvr_fw_trace.c
> index 73707daa4e52d13fd1388cb2e9feff0aea109620..5dbb636d7d4ffeea2253ea58e817710979f90cf0 100644
> --- a/drivers/gpu/drm/imagination/pvr_fw_trace.c
> +++ b/drivers/gpu/drm/imagination/pvr_fw_trace.c
> @@ -333,8 +333,8 @@ static int fw_trace_seq_show(struct seq_file *s, void *v)
>         if (sf_id == ROGUE_FW_SF_LAST)
>                 return -EINVAL;
> 
> -       timestamp = read_fw_trace(trace_seq_data, 1) |
> -               ((u64)read_fw_trace(trace_seq_data, 2) << 32);
> +       timestamp = ((u64)read_fw_trace(trace_seq_data, 1) << 32) |
> +               read_fw_trace(trace_seq_data, 2);
>         timestamp = (timestamp & ~ROGUE_FWT_TIMESTAMP_TIME_CLRMSK) >>
>                 ROGUE_FWT_TIMESTAMP_TIME_SHIFT;
> 
> 
> ---
> base-commit: 938fbb16aba8f7b88e0fdcf56f315a5bbad41aad
> change-id: 20250220-fix-fw-trace-timestamps-15d70bb2d93d
> 
> Best regards,
> --
> Alessio Belle <alessio.belle@imgtec.com>
> 


-- 
Matt Coster
E: matt.coster@imgtec.com

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2025-03-03 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 10:49 Alessio Belle
2025-03-03 12:15 ` Matt Coster [this message]
2025-03-03 12:18 ` Matt Coster

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=41383f9a-ff72-4911-aa2d-00702a8d62eb@imgtec.com \
    --to=matt.coster@imgtec.com \
    --cc=Alessio.Belle@imgtec.com \
    --cc=Alexandru.Dadu@imgtec.com \
    --cc=Frank.Binns@imgtec.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®