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 v10 3/7] drm/tyr: add Memory Management Unit (MMU) support
Date: Tue, 28 Jul 2026 18:52:37 +0000	[thread overview]
Message-ID: <20260728185237.828AC1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260728-fw-boot-b4-v10-3-9187aefa3f2f@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing MmuCommand::Unlock in as_end_update() leaves the address space locked.
--

--- Patch [3]: [PATCH v10 3/7] drm/tyr: add Memory Management Unit (MMU) support ---
commit 4673c22526eac7702f0e2418212a28a74a5e56d8
Author: Boris Brezillon <boris.brezillon@collabora.com>

drm/tyr: add Memory Management Unit (MMU) support
    
Add Memory Management Unit (MMU) support in Tyr, which wraps a SlotManager
instance to allocate MMU address-space slots for virtual memory. This includes
an AddressSpaceManager for MMU hardware register operations such as locking
and flushing address spaces.

> diff --git a/drivers/gpu/drm/tyr/mmu/address_space.rs b/drivers/gpu/drm/tyr/mmu/address_space.rs
> new file mode 100644
> index 0000000000000..76e3d2df6afd4
> --- /dev/null
> +++ b/drivers/gpu/drm/tyr/mmu/address_space.rs

[ ... ]

> +    /// Locks a region of the translation tables for an atomic update.
> +    ///
> +    /// Programs the MMU LOCKADDR register for the given address space and issues
> +    /// the lock command. The hardware rounds the requested range up to a
> +    /// power-of-two region aligned to its size.
> +    ///
> +    /// Returns an error if the slot is invalid or if register writes/commands fail.
> +    fn as_start_update(&mut self, as_nr: usize, region: &Range<u64>) -> Result {

[ ... ]

> +        self.as_send_cmd_and_wait(as_nr, MmuCommand::Lock)
> +    }
> +
> +    /// Completes an atomic translation table update.
> +    ///
> +    /// Returns an error if the slot is invalid or if the flush command fails.
> +    fn as_end_update(&mut self, as_nr: usize) -> Result {
> +        self.validate_as_slot(as_nr)?;
> +        self.as_send_cmd_and_wait(as_nr, MmuCommand::FlushPt)?;

[Severity: High]
Does this function also need to send MmuCommand::Unlock to release the locked
region?

The start of the update sequence in as_start_update() locks the region by
sending MmuCommand::Lock, but as_end_update() currently only sends
MmuCommand::FlushPt and omits the unlock command. 

If the address space remains locked, GPU accesses to the updated virtual
memory region could be permanently blocked. This might lead to GPU hangs or
command timeouts when userspace triggers VM mapping or unmapping operations.

> +        Ok(())
> +    }

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260728-fw-boot-b4-v10-0-9187aefa3f2f@collabora.com?part=3

  reply	other threads:[~2026-07-28 18:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 18:39 [PATCH v10 0/7] drm/tyr: firmware loading and MCU boot support Deborah Brouwer
2026-07-28 18:39 ` [PATCH v10 1/7] drm/tyr: add resources to RegistrationData Deborah Brouwer
2026-07-28 18:55   ` sashiko-bot
2026-07-28 18:39 ` [PATCH v10 2/7] drm/tyr: add a generic slot manager Deborah Brouwer
2026-07-28 18:39 ` [PATCH v10 3/7] drm/tyr: add Memory Management Unit (MMU) support Deborah Brouwer
2026-07-28 18:52   ` sashiko-bot [this message]
2026-07-28 19:31   ` Danilo Krummrich
2026-07-28 20:35     ` Deborah Brouwer
2026-07-28 21:19       ` Danilo Krummrich
2026-07-28 18:39 ` [PATCH v10 4/7] drm/tyr: add GPU virtual memory (VM) support Deborah Brouwer
2026-07-28 18:54   ` sashiko-bot
2026-07-28 18:39 ` [PATCH v10 5/7] drm/tyr: add a kernel buffer object Deborah Brouwer
2026-07-28 18:54   ` sashiko-bot
2026-07-28 18:39 ` [PATCH v10 6/7] drm/tyr: add parser for firmware binary Deborah Brouwer
2026-07-28 18:47   ` sashiko-bot
2026-07-28 18:39 ` [PATCH v10 7/7] drm/tyr: add Microcontroller Unit (MCU) booting Deborah Brouwer

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=20260728185237.828AC1F00A3A@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.