Re: [PATCH v3 1/2] rust: irq: add support for request_irq()
From: Danilo Krummrich
Date: Tue Jun 03 2025 - 05:43:39 EST
On Tue, Jun 03, 2025 at 11:18:40AM +0200, Alice Ryhl wrote:
> I don't think that helps. If Devres::drop gets to swap is_available
> before the devm callback performs the swap, then the devm callback is
> just a no-op and the device still doesn't wait for free_irq() to
> finish running.
True, this will indeed always be racy. The rule from the C API has always been
that devm_{remove,release}_action() must not be called if a concurrent unbind
can't be ruled out. Consequently, the same is true for Revocable::revoke() in
this case.
I think Devres::drop() shouldn't do anything then and instead we should provide
Devres::release() and Devres::remove(), which require the &Device<Bound>
reference the Devres object was created with, in order to prove that there
can't be a concurrent unbind, just like Devres::access().