diff options
author | Corey Minyard <corey@minyard.net> | 2025-08-07 17:55:44 -0500 |
---|---|---|
committer | Corey Minyard <corey@minyard.net> | 2025-09-08 10:21:41 -0500 |
commit | bbfb8353cb26acb05b48380f2213d51938f11019 (patch) | |
tree | 2fd1a5ac131af1171a008b2b35b9203f495ff6c5 | |
parent | 627118470fccc61d7763aa667fcab0a9476843f6 (diff) |
ipmi: Set a timer for maintenance mode
Now that maintenance mode rejects all messages, there's nothing to
run time timer. Make sure the timer is running in maintenance mode.
Signed-off-by: Corey Minyard <corey@minyard.net>
Tested-by: Frederick Lawler <fred@cloudflare.com>
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index a33d3e2b345e..c6a5673b6f01 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -52,6 +52,8 @@ static void intf_free(struct kref *ref); static bool initialized; static bool drvregistered; +static struct timer_list ipmi_timer; + /* Numbers in this enumerator should be mapped to ipmi_panic_event_str */ enum ipmi_panic_event_op { IPMI_SEND_PANIC_EVENT_NONE, @@ -1943,6 +1945,7 @@ static int i_ipmi_req_sysintf(struct ipmi_smi *intf, && intf->maintenance_mode_state < newst) { intf->maintenance_mode_state = newst; maintenance_mode_update(intf); + mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); } spin_unlock_irqrestore(&intf->maintenance_mode_lock, flags); @@ -5081,6 +5084,7 @@ static bool ipmi_timeout_handler(struct ipmi_smi *intf, && (intf->auto_maintenance_timeout <= 0)) { intf->maintenance_mode_state = IPMI_MAINTENANCE_MODE_STATE_OFF; + intf->auto_maintenance_timeout = 0; maintenance_mode_update(intf); } } @@ -5103,8 +5107,6 @@ static void ipmi_request_event(struct ipmi_smi *intf) intf->handlers->request_events(intf->send_info); } -static struct timer_list ipmi_timer; - static atomic_t stop_operation; static void ipmi_timeout_work(struct work_struct *work) @@ -5128,6 +5130,8 @@ static void ipmi_timeout_work(struct work_struct *work) } need_timer = true; } + if (intf->maintenance_mode_state) + need_timer = true; need_timer |= ipmi_timeout_handler(intf, IPMI_TIMEOUT_TIME); } |