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 1/7] drm/tyr: add resources to RegistrationData
Date: Wed, 22 Jul 2026 01:05:47 +0000	[thread overview]
Message-ID: <20260722010548.3148A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721-fw-boot-b4-v8-1-b28f744581c9@collabora.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Clocks are enabled before power domains (regulators) are powered on.
- [Medium] Clock enable state is leaked on early probe failure paths.
--

--- Patch [1]: [PATCH v8 1/7] drm/tyr: add resources to RegistrationData ---
commit ebb25c59afc71f766bee84e4619205c5e8db839b
Author: Deborah Brouwer <deborah.brouwer@collabora.com>

drm/tyr: add resources to RegistrationData

This commit moves Tyr's device-private resources and GPU information
from drm::Driver::Data to drm::Driver::RegistrationData. This ensures
safe access to the data during the platform device binding lifetime and
while registered with userspace.

> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 8348c6cd39295..46ce5c41e310c 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs

[ ... ]

> @@ -134,10 +137,10 @@ fn probe<'bound>(
>          // other threads of execution.
>          unsafe { pdev.dma_set_mask_and_coherent(DmaMask::try_new(pa_bits)?)? };
>  
> -        let platform: ARef<platform::Device> = pdev.into();
> +        let unreg_dev = drm::UnregisteredDevice::<TyrDrmDriver>::new(pdev, Ok(()))?;
>  
> -        let data = try_pin_init!(TyrDrmDeviceData {
> -                pdev: platform.clone(),
> +        let reg_data = try_pin_init!(TyrDrmRegistrationData {
> +                pdev,
>                  clks <- new_mutex!(Clocks {

[Severity: Medium]
This is a pre-existing issue, but I noticed a potential resource leak in 
probe(). 

Earlier in this function, core_clk, stacks_clk, and coregroup_clk are 
enabled:

drivers/gpu/drm/tyr/driver.rs:probe() {
    ...
    core_clk.prepare_enable()?;
    stacks_clk.prepare_enable()?;
    coregroup_clk.prepare_enable()?;

    let mali_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"mali")?;
    ...
}

If getting a regulator or another step fails and returns early via ?, does 
the clock enable state leak? Because the Clocks struct isn't created until 
this point in the diff, it seems the enable count might remain incremented 
on those early error paths.

[Severity: High]
This is also a pre-existing issue, but looking at that same snippet in 
probe(), the hardware clocks are enabled before the mali and sram regulators 
are fetched and enabled. 

Could this sequencing cause problems? Toggling clocks for unpowered IP 
domains can sometimes lead to bus lockups or undefined hardware behavior 
during initialization.

>                      core: core_clk,
>                      stacks: stacks_clk,

[ ... ]

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

  reply	other threads:[~2026-07-22  1:05 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 [this message]
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
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=20260722010548.3148A1F000E9@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.