]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipmi:msghandler: Fix locking around users and interfaces
authorCorey Minyard <corey@minyard.net>
Fri, 21 Mar 2025 19:46:46 +0000 (14:46 -0500)
committerCorey Minyard <corey@minyard.net>
Wed, 7 May 2025 22:25:48 +0000 (17:25 -0500)
commit84fe1ebcc92cf3880130bfe51040769d7931423a
tree922f04c729fd0c483fd916512715365e64aa889f
parent83d19f03f3e5e1421d7cda78d0bec80e1769e8aa
ipmi:msghandler: Fix locking around users and interfaces

Now that SRCU is gone from IPMI, it can no longer be sloppy about
locking.  Use the users mutex now when sending a message, not the big
ipmi_interfaces mutex, because it can result in a recursive lock.  The
users mutex will work because the interface destroy code claims it after
setting the interface in shutdown mode.

Also, due to the same changes, rework the refcounting on users and
interfaces.  Remove the refcount to an interface when the user is
freed, not when it is destroyed.  If the interface is destroyed
while the user still exists, the user will still point to the
interface to test that it is valid if the user tries to do anything
but delete the user.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_msghandler.c