Re: [PATCH v3 1/2] rust: irq: add support for request_irq()

From: Danilo Krummrich
Date: Tue Jun 03 2025 - 06:16:53 EST


On Tue, Jun 03, 2025 at 12:09:05PM +0200, Danilo Krummrich wrote:
> Yes, we could solve this with a lock as well, but it would be an additional
> lock, just to maintain the current drop() semantics, which I don't see much
> value in.

If we want to keep the current drop() semantics we could use a completion
instead.

// Devres::drop()
revoke_nosync()
complete()

// devres_callback
if !try_revoke() {
// we end up here if try_revoke() indicates that the object was
// revoked already
wait_for_completion()
}