[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250424165020.627193-17-corey@minyard.net>
Date: Thu, 24 Apr 2025 11:49:53 -0500
From: Corey Minyard <corey@...yard.net>
To: linux-kernel@...r.kernel.org,
openipmi-developer@...ts.sourceforge.net,
Rik van Riel <riel@...riel.com>
Cc: "Paul E . McKenney" <paulmck@...nel.org>,
Breno Leitao <leitao@...ian.org>,
Corey Minyard <corey@...yard.net>,
Corey Minyard <cminyard@...sta.com>
Subject: [PATCH 16/23] ipmi:msghandler: Shut down lower layer first at unregister
This makes sure any outstanding messages are returned to the user before
the interface is cleaned up.
Signed-off-by: Corey Minyard <cminyard@...sta.com>
---
drivers/char/ipmi/ipmi_msghandler.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 927556ca469d..56654a9c5cf7 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -3738,7 +3738,13 @@ void ipmi_unregister_smi(struct ipmi_smi *intf)
list_del(&intf->link);
mutex_unlock(&ipmi_interfaces_mutex);
- /* At this point no users can be added to the interface. */
+ /*
+ * At this point no users can be added to the interface and no
+ * new messages can be sent.
+ */
+
+ if (intf->handlers->shutdown)
+ intf->handlers->shutdown(intf->send_info);
device_remove_file(intf->si_dev, &intf->nr_msgs_devattr);
device_remove_file(intf->si_dev, &intf->nr_users_devattr);
@@ -3761,9 +3767,6 @@ void ipmi_unregister_smi(struct ipmi_smi *intf)
}
mutex_unlock(&intf->users_mutex);
- if (intf->handlers->shutdown)
- intf->handlers->shutdown(intf->send_info);
-
cleanup_smi_msgs(intf);
ipmi_bmc_unregister(intf);
--
2.43.0
Powered by blists - more mailing lists