summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Minyard <corey@minyard.net>2025-03-19 00:08:45 +0300
committerCorey Minyard <corey@minyard.net>2025-05-08 01:25:47 +0300
commit742219863ee940c4cb3dcfe10030c080804d3a00 (patch)
tree69caef2d9f64b894e5285bfed932e4c0079009c5
parent305923bd3b61e3ee4716f6aed7f68daadbe6ceaf (diff)
downloadlinux-742219863ee940c4cb3dcfe10030c080804d3a00.tar.xz
ipmi:msghandler: Move timer handling into a work queue
Get all operations that manipulate the interface list into thread context. Signed-off-by: Corey Minyard <cminyard@mvista.com>
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 8d53e1f96b3d..1e892ef00f29 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -5083,8 +5083,11 @@ static struct timer_list ipmi_timer;
static atomic_t stop_operation;
-static void ipmi_timeout(struct timer_list *unused)
+static void ipmi_timeout_work(struct work_struct *work)
{
+ if (atomic_read(&stop_operation))
+ return;
+
struct ipmi_smi *intf;
bool need_timer = false;
int index;
@@ -5111,6 +5114,16 @@ static void ipmi_timeout(struct timer_list *unused)
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
}
+static DECLARE_WORK(ipmi_timer_work, ipmi_timeout_work);
+
+static void ipmi_timeout(struct timer_list *unused)
+{
+ if (atomic_read(&stop_operation))
+ return;
+
+ queue_work(system_bh_wq, &ipmi_timer_work);
+}
+
static void need_waiter(struct ipmi_smi *intf)
{
/* Racy, but worst case we start the timer twice. */
@@ -5538,6 +5551,7 @@ static void __exit cleanup_ipmi(void)
*/
atomic_set(&stop_operation, 1);
timer_delete_sync(&ipmi_timer);
+ cancel_work_sync(&ipmi_timer_work);
initialized = false;