All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Laura Nao" <laura.nao@collabora.com>
Cc: "Daniel Almeida" <daniel.almeida@collabora.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	rust-for-linux@vger.kernel.org, kernel@collabora.com,
	"Deborah Brouwer" <deborah.brouwer@collabora.com>
Subject: Re: [PATCH v7 2/3] drm/tyr: add TyrIrq threaded IRQ wrapper
Date: Thu, 26 Nov 2026 12:41:49 +0100	[thread overview]
Message-ID: <DN545I66CKO1.2YKP99UIQQR43@kernel.org> (raw)
In-Reply-To: <20260728-tyr-irq-v2-v7-2-4e172e58e28c@collabora.com>

On Mon Nov 23, 2026 at 3:58 PM CET, Laura Nao wrote:
> +impl<'a, T: TyrIrqTrait> TyrIrqRegistration<'a, T> {
> +    /// Requests a threaded IRQ registration for `irq`, using `name` to look up the interrupt.
> +    ///
> +    /// # Safety
> +    ///
> +    /// Callers must not `mem::forget()` the resulting registration or otherwise prevent its
> +    /// [`Drop`] implementation from running.
> +    pub(crate) unsafe fn request(
> +        pdev: &'a platform::Device<Bound>,
> +        name: &'static CStr,
> +        irq: T,
> +        hw: Arc<HwGate<'a>>,
> +    ) -> Result<Pin<KBox<Self>>>

Why does this not return a pin initializer itself?

I don't think this has a user in this series (except job_irq_init(), which
itself seems unused), but I expect this to be stored in some other container
that is pinned anyway.

(Note that in C we'd also not need a separate allocation and just embed it in
its corresponding container.)

> +    where
> +        T: 'a,
> +    {
> +        // SAFETY: The caller guarantees the resulting registration will not be leaked.
> +        let registration = unsafe { TyrIrq::request(pdev, name, irq, hw) }?;
> +
> +        KBox::try_pin_init(
> +            try_pin_init!(Self {
> +                registration <- registration,
> +            }),
> +            GFP_KERNEL,
> +        )
> +    }
> +}

  parent reply	other threads:[~2026-11-26 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 14:58 [PATCH v7 0/3] drm/tyr: add Job IRQ handling Laura Nao
2026-11-23 14:58 ` [PATCH v7 1/3] drm/tyr: add HwGate::try_access_atomic() Laura Nao
2026-11-23 18:13   ` Onur Özkan
2026-11-23 14:58 ` [PATCH v7 2/3] drm/tyr: add TyrIrq threaded IRQ wrapper Laura Nao
2026-11-24 17:54   ` Daniel Almeida
2026-11-26 11:21     ` Laura Nao
2026-11-26 11:41   ` Danilo Krummrich [this message]
2026-11-26 14:21     ` Laura Nao
2026-11-23 14:58 ` [PATCH v7 3/3] drm/tyr: add Job IRQ handling Laura Nao
2026-11-24 20:49   ` Daniel Almeida
2026-11-26 11:11     ` Laura Nao
2026-11-26 14:18       ` Laura Nao
2026-11-26 16:01         ` Danilo Krummrich
2026-11-26 11:45   ` Danilo Krummrich
2026-11-26 14:23     ` Laura Nao

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=DN545I66CKO1.2YKP99UIQQR43@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=deborah.brouwer@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=kernel@collabora.com \
    --cc=laura.nao@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.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.