dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/amdgpu: debugfs: avoid extra EOLs in amdgpu_gem_info
Date: Thu, 02 Jul 2026 17:06:52 +0000	[thread overview]
Message-ID: <20260702170652.AB7481F000E9@smtp.kernel.org> (raw)
In-Reply-To: <982728e51afbb9d400372e98676ad76335a56410.1783009338.git.mirq-linux@rere.qmqm.pl>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing newline in debugfs output for buffer objects without fences.
--

commit 642a225a01d32a7d60ac3ca80f3eb6f52693b3f4
Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>

drm/amdgpu: debugfs: avoid extra EOLs in amdgpu_gem_info

This commit aims to avoid printing extra newlines in the amdgpu_gem_info
debugfs output. It does this by moving the newline into the lock failure
path when attempting to dump buffer object fences.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -1696,8 +1696,9 @@ u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m)
>  	if (dma_resv_trylock(bo->tbo.base.resv)) {
>  		dma_resv_describe(bo->tbo.base.resv, m);
>  		dma_resv_unlock(bo->tbo.base.resv);
> +	} else {
> +		seq_puts(m, "\n");
>  	}
> -	seq_puts(m, "\n");
>  
>  	return size;
>  }

[Severity: Medium]
Will this cause garbled debugfs output for buffer objects that do not have
any fences attached?

When dma_resv_trylock() succeeds, amdgpu_bo_print_info() calls
dma_resv_describe(). Looking at dma_resv_describe() in
drivers/dma-buf/dma-resv.c:

void dma_resv_describe(struct dma_resv *obj, struct seq_file *seq)
{
	...
	dma_resv_for_each_fence(&cursor, obj, DMA_RESV_USAGE_READ, fence) {
		seq_printf(seq, "\t%s fence:", ...);
		dma_fence_describe(fence, seq);
	}
}

If there are no fences, dma_resv_describe() iterates zero times and prints
nothing. Because the unconditional newline was moved to the lock-failure
branch, the success path for a fenceless buffer object now prints nothing
at all.

This means the next item dumped in the debugfs file will be concatenated onto
the same line, breaking readability and parsing tools. Should a newline still
be printed when the lock succeeds but no fences are present?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1783009338.git.mirq-linux@rere.qmqm.pl?part=5

      reply	other threads:[~2026-07-02 17:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02 16:24 [PATCH 0/5] Random debugging quality-of-life improvements Michał Mirosław
2026-07-02 16:24 ` [PATCH 1/5] drm/amd/display/amdgpu_dm: show error names Michał Mirosław
2026-07-02 16:24 ` [PATCH 3/5] drm/amd/pm/smu7: return error on message send failure Michał Mirosław
2026-07-02 16:56   ` sashiko-bot
2026-07-02 16:24 ` [PATCH 4/5] drm/amd/amdgpu/cgs: Avoid redundant copying of firmware filename Michał Mirosław
2026-07-02 16:24 ` [PATCH 2/5] drm/amd/pm/smu7: make SMU message reports more readable Michał Mirosław
2026-07-02 16:24 ` [PATCH 5/5] drm/amdgpu: debugfs: avoid extra EOLs in amdgpu_gem_info Michał Mirosław
2026-07-02 17:06   ` sashiko-bot [this message]

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=20260702170652.AB7481F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=sashiko-reviews@lists.linux.dev \
    /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