Re: [PATCH v2] drm/tyr: add Job IRQ handling

From: Ewan Chorynski

Date: Wed Jul 29 2026 - 08:45:13 EST


On Wed, Jul 29, 2026 at 11:58:29AM +0200, Laura Nao wrote:
> [...]
> +
> +impl<T: TyrIrqTrait> TyrIrq<T> {
> + pub(crate) fn request<'a>(
> + pdev: &'a platform::Device<Bound>,
> + name: &'static CStr,
> + irq: T,
> + ) -> Result<impl PinInit<ThreadedRegistration<'a, Self>, Error> + 'a>
> + where
> + T: 'a,
> + {
> + let handler = try_pin_init!(Self {
> + irq,
> + _pin: PhantomPinned,
> + });
> +
> + // SAFETY: The resulting `PinInit` is not leaked, it is consumed by the caller to
> + // initialize a pinned `ThreadedRegistration`.
> + Ok(unsafe { pdev.request_threaded_irq_by_name(Flags::SHARED, name, name, handler) })

I think your `request` function should be unsafe with the same
requirements as `request_threaded_irq_by_name`, otherwise how do you
guarantee that this safety justification holds ?

> + }
> +}
> [...]