Re: [PATCH v3 1/2] rust: irq: add support for request_irq()
From: Danilo Krummrich
Date: Tue Jun 03 2025 - 04:47:00 EST
On Tue, Jun 03, 2025 at 08:28:42AM +0000, Alice Ryhl wrote:
> That optimization sounds like something we definitely want, but I have
> one question: is free_irq() safe to use in atomic context / inside
> rcu_read_lock()? What about the threaded-irq variant?
No, free_irq() must not be called from atomic context. Hence, it's not valid to
call it from within an RCU read-side critical section.
I assume you're confusing something, free_irq() is called from the destructor of
the irq::Registration object, hence it is either called when the object itself
is dropped or from the devres callback, which is called after the
synchronize_rcu(), but not from an RCU read-side critical section.