Re: [PATCH v7 2/3] drm/tyr: add TyrIrq threaded IRQ wrapper

From: Danilo Krummrich

Date: Thu Nov 26 2026 - 06:42:06 EST


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,
> + )
> + }
> +}