Re: [PATCH v2] drm/tyr: add Job IRQ handling
Ewan Chorynski <[email protected]> Wed, 29 Jul 2026 14:12:24 +0200
| Newsgroups | org.kernel.vger.rust-for-linux,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 ?
> + }
> +}
> [...]