Re: [PATCH v2 1/2] rust: add abstraction for struct device

Greg KH
2024-06-11T13:29:25Z

On Tue, Jun 11, 2024 at 03:21:31PM +0200, Danilo Krummrich wrote:
> ...hence, I agree we should indeed add to the #Invariants and #Safety section
> that `->release` must be callable from any thread.
>
> However, this is just theory, do we actually have cases where `device::release`
> is not allowed to be called from any thread? If so, this would be very confusing
> for a reference counted type from a design point of view...

What do you mean exactly "by any thread"? Maybe not from interrupt
context, but any other normal thread (i.e. that you can sleep in), it
should be fine to call release() in.

thanks,

greg k-h