BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931

Is rhere some rule for might sleep and spin lock? When I merge Real-Time Linux Patch into 4.19.82 kernel, I meets some problems. I have checked patches, then found that some spin locks are replaced with raw spin locks. I want to know if rhere is some rule for this action. Thanks.

What exact hardware (module and carrier board) and software versions of things are you talking about?