All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Deborah Brouwer" <deborah.brouwer@collabora.com>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v8 5/7] drm/tyr: add a kernel buffer object
Date: Wed, 22 Jul 2026 00:58:50 +0000	[thread overview]
Message-ID: <20260722005850.F1BE51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721-fw-boot-b4-v8-5-b28f744581c9@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Trailing newlines in logging macros cause double newlines in the kernel log.
--

--- Patch [5]: [PATCH v8 5/7] drm/tyr: add a kernel buffer object ---
commit d331aa5f9ef1fb72722d9ab68ad7b2746d91080d
Author: Deborah Brouwer <deborah.brouwer@collabora.com>

drm/tyr: add a kernel buffer object

Introduce a buffer object type (KernelBo) for internal driver allocations
that are managed by the kernel rather than userspace. It wraps a GEM shmem
object and automatically handles GPU virtual address space mapping during
creation and unmapping on drop.

> diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
> index c28be61a01bb2..583c2a87b23b3 100644
> --- a/drivers/gpu/drm/tyr/gem.rs
> +++ b/drivers/gpu/drm/tyr/gem.rs
[ ... ]
> +impl<'bound> KernelBo<'bound> {
> +    /// Creates a new kernel-owned buffer object and maps it into GPU VA space.
[ ... ]
> +    #[expect(dead_code)]
> +    pub(crate) fn new(
> +        ddev: &TyrDrmDevice,
> +        vm: Arc<Vm<'bound>>,
> +        size: u64,
> +        va_alloc: KernelBoVaAlloc,
> +        flags: VmMapFlags,
> +    ) -> Result<Self> {
> +        if size == 0 {
> +            dev_err!(vm.dev(), "Cannot create KernelBo with size 0\n");

[Severity: Low]
This isn't a bug, but does this dev_err macro call need a trailing newline? 
The rust dev_err macro automatically appends a newline to the formatted 
output. Including an explicit newline at the end of the format string 
might result in an unnecessary blank line in the kernel log.

> +            return Err(EINVAL);
> +        }
[ ... ]
> +impl Drop for KernelBo<'_> {
> +    fn drop(&mut self) {
> +        let va = self.va_range.start;
> +        let size = self.va_range.end - self.va_range.start;
> +
> +        if let Err(e) = self.vm.unmap_range(va, size) {
> +            // If unmap_range fails, it is still safe to drop the
> +            // KernelBo and its ARef to the GEM buffer object because
> +            // GPUVM also holds a reference to the GEM buffer object.
> +            // The physical pages won't be freed or reallocated.
> +            dev_err!(
> +                self.vm.dev(),
> +                "Failed to unmap KernelBo range {:#x}..{:#x}: {:?}\n",

[Severity: Low]
Similarly here, does this format string need the trailing newline?

> +                self.va_range.start,
> +                self.va_range.end,
> +                e
> +            );
> +        }
> +    }
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260721-fw-boot-b4-v8-0-b28f744581c9@collabora.com?part=5

  reply	other threads:[~2026-07-22  0:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  0:52 [PATCH v8 0/7] drm/tyr: firmware loading and MCU boot support Deborah Brouwer
2026-07-22  0:52 ` [PATCH v8 1/7] drm/tyr: add resources to RegistrationData Deborah Brouwer
2026-07-22  1:05   ` sashiko-bot
2026-07-22  0:52 ` [PATCH v8 2/7] drm/tyr: add a generic slot manager Deborah Brouwer
2026-07-22  1:01   ` sashiko-bot
2026-07-22  0:52 ` [PATCH v8 3/7] drm/tyr: add Memory Management Unit (MMU) support Deborah Brouwer
2026-07-22  1:02   ` sashiko-bot
2026-07-22  0:52 ` [PATCH v8 4/7] drm/tyr: add GPU virtual memory (VM) support Deborah Brouwer
2026-07-22  1:05   ` sashiko-bot
2026-07-22  0:52 ` [PATCH v8 5/7] drm/tyr: add a kernel buffer object Deborah Brouwer
2026-07-22  0:58   ` sashiko-bot [this message]
2026-07-22  0:52 ` [PATCH v8 6/7] drm/tyr: add parser for firmware binary Deborah Brouwer
2026-07-22  1:04   ` sashiko-bot
2026-07-22  0:52 ` [PATCH v8 7/7] drm/tyr: add Microcontroller Unit (MCU) booting Deborah Brouwer
2026-07-22  1:05   ` sashiko-bot

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=20260722005850.F1BE51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=deborah.brouwer@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.