public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Deborah Brouwer <deborah.brouwer@collabora.com>
Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	daniel.almeida@collabora.com, aliceryhl@google.com,
	beata.michalska@arm.com, lyude@redhat.com
Subject: Re: [PATCH 02/12] drm/tyr: move clock cleanup into Clocks Drop impl
Date: Thu, 12 Feb 2026 09:12:55 +0100	[thread overview]
Message-ID: <20260212091255.74b65cb0@fedora> (raw)
In-Reply-To: <20260212013713.304343-3-deborah.brouwer@collabora.com>

On Wed, 11 Feb 2026 17:37:03 -0800
Deborah Brouwer <deborah.brouwer@collabora.com> wrote:

> Currently Tyr disables its clocks from TyrDrmDeviceData::drop(), which
> causes them to be shut down before any other fields in TyrDrmDeviceData
> are dropped. This prevents us from using the clocks when dropping the
> other fields in TyrDrmDeviceData.
> 
> In order to better control when the clocks are dropped, move this cleanup
> logic into a Drop implementation on the Clocks struct itself.
> 
> Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>

Maybe you should mention that Clocks is no longer considered pinned,
because it's not needed in practice.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/gpu/drm/tyr/driver.rs | 23 +++++++++--------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index ae4daa12b3e5..9bc6ed56c45e 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -54,7 +54,7 @@ pub(crate) struct TyrPlatformDeviceData {
>      _device: ARef<TyrDrmDevice>,
>  }
>  
> -#[pin_data(PinnedDrop)]
> +#[pin_data]
>  pub(crate) struct TyrDrmDeviceData {
>      pub(crate) pdev: ARef<platform::Device>,
>  
> @@ -168,17 +168,6 @@ impl PinnedDrop for TyrPlatformDeviceData {
>      fn drop(self: Pin<&mut Self>) {}
>  }
>  
> -#[pinned_drop]
> -impl PinnedDrop for TyrDrmDeviceData {
> -    fn drop(self: Pin<&mut Self>) {
> -        // TODO: the type-state pattern for Clks will fix this.
> -        let clks = self.clks.lock();
> -        clks.core.disable_unprepare();
> -        clks.stacks.disable_unprepare();
> -        clks.coregroup.disable_unprepare();
> -    }
> -}
> -
>  // We need to retain the name "panthor" to achieve drop-in compatibility with
>  // the C driver in the userspace stack.
>  const INFO: drm::DriverInfo = drm::DriverInfo {
> @@ -202,14 +191,20 @@ impl drm::Driver for TyrDrmDriver {
>      }
>  }
>  
> -#[pin_data]
>  struct Clocks {
>      core: Clk,
>      stacks: OptionalClk,
>      coregroup: OptionalClk,
>  }
>  
> -#[pin_data]
> +impl Drop for Clocks {
> +    fn drop(&mut self) {
> +        self.core.disable_unprepare();
> +        self.stacks.disable_unprepare();
> +        self.coregroup.disable_unprepare();
> +    }
> +}
> +
>  struct Regulators {
>      _mali: Regulator<regulator::Enabled>,
>      _sram: Regulator<regulator::Enabled>,


  reply	other threads:[~2026-02-12  8:13 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12  1:37 [PATCH 0/12] drm/tyr: firmware loading and MCU boot support Deborah Brouwer
2026-02-12  1:37 ` [PATCH 01/12] drm/tyr: select DRM abstractions in Kconfig Deborah Brouwer
2026-02-12  1:37 ` [PATCH 02/12] drm/tyr: move clock cleanup into Clocks Drop impl Deborah Brouwer
2026-02-12  8:12   ` Boris Brezillon [this message]
2026-02-28  0:18     ` Deborah Brouwer
2026-02-20 14:03   ` Daniel Almeida
2026-02-21  9:01   ` Alice Ryhl
2026-02-12  1:37 ` [PATCH 03/12] drm/tyr: rename TyrObject to BoData Deborah Brouwer
2026-02-20 14:04   ` Daniel Almeida
2026-02-21  9:01   ` Alice Ryhl
2026-02-12  1:37 ` [PATCH 04/12] drm/tyr: set DMA mask using GPU physical address Deborah Brouwer
2026-02-12 10:16   ` Boris Brezillon
2026-02-20 14:19   ` Daniel Almeida
2026-02-21  9:03   ` Alice Ryhl
2026-02-12  1:37 ` [PATCH 05/12] drm/tyr: add MMU address space registers Deborah Brouwer
2026-02-12  8:16   ` Boris Brezillon
2026-02-28  0:12     ` Deborah Brouwer
2026-02-20 14:21   ` Daniel Almeida
2026-02-21  9:09   ` Alice Ryhl
2026-02-22 18:13     ` Boris Brezillon
2026-02-28  0:13       ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 06/12] drm/tyr: add shmem backing for GEM objects Deborah Brouwer
2026-02-12  8:17   ` Boris Brezillon
2026-02-28  0:15     ` Deborah Brouwer
2026-02-20 14:25   ` Daniel Almeida
2026-02-28  0:17     ` Deborah Brouwer
2026-03-02 10:17       ` Boris Brezillon
2026-03-02 17:03         ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 07/12] drm/tyr: Add generic slot manager Deborah Brouwer
2026-02-12 10:11   ` Boris Brezillon
2026-02-12 10:45     ` Miguel Ojeda
2026-02-20 15:25     ` Daniel Almeida
2026-02-20 16:21       ` Boris Brezillon
2026-02-20 16:55         ` Daniel Almeida
2026-02-22 17:57           ` Boris Brezillon
2026-02-22 18:46             ` Daniel Almeida
2026-02-28  0:28               ` Deborah Brouwer
2026-03-02 10:10                 ` Boris Brezillon
2026-02-21 11:16     ` Alice Ryhl
2026-02-21 12:44       ` Daniel Almeida
2026-02-21 13:40         ` Alice Ryhl
2026-02-21 13:48           ` Daniel Almeida
2026-02-28  0:25     ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 08/12] drm/tyr: add MMU module Deborah Brouwer
2026-02-12 10:44   ` Boris Brezillon
2026-02-28  0:31     ` Deborah Brouwer
2026-02-12 11:05   ` Boris Brezillon
2026-02-20 15:41     ` Daniel Almeida
2026-02-21 11:17     ` Alice Ryhl
2026-02-20 17:11   ` Daniel Almeida
2026-02-28  0:46     ` Deborah Brouwer
2026-02-21 11:20   ` Alice Ryhl
2026-02-28  0:49     ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 09/12] drm/tyr: add GPU virtual memory module Deborah Brouwer
2026-02-12 10:54   ` Boris Brezillon
2026-02-28  0:52     ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 10/12] drm/tyr: add a kernel buffer object Deborah Brouwer
2026-02-12 11:00   ` Boris Brezillon
2026-02-28  1:01     ` Deborah Brouwer
2026-02-12  1:37 ` [PATCH 11/12] drm/tyr: add parser for firmware binary Deborah Brouwer
2026-02-12  1:37 ` [PATCH 12/12] drm/tyr: add firmware loading and MCU boot support Deborah Brouwer
2026-02-21 11:25   ` Alice Ryhl
2026-02-28  1:02     ` 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=20260212091255.74b65cb0@fedora \
    --to=boris.brezillon@collabora.com \
    --cc=aliceryhl@google.com \
    --cc=beata.michalska@arm.com \
    --cc=daniel.almeida@collabora.com \
    --cc=deborah.brouwer@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --cc=rust-for-linux@vger.kernel.org \
    /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