Skip to content

Commit bbfb835

Browse files
committed
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>
1 parent 6271184 commit bbfb835

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ static void intf_free(struct kref *ref);
5252
static bool initialized;
5353
static bool drvregistered;
5454

55+
static struct timer_list ipmi_timer;
56+
5557
/* Numbers in this enumerator should be mapped to ipmi_panic_event_str */
5658
enum ipmi_panic_event_op {
5759
IPMI_SEND_PANIC_EVENT_NONE,
@@ -1943,6 +1945,7 @@ static int i_ipmi_req_sysintf(struct ipmi_smi *intf,
19431945
&& intf->maintenance_mode_state < newst) {
19441946
intf->maintenance_mode_state = newst;
19451947
maintenance_mode_update(intf);
1948+
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
19461949
}
19471950
spin_unlock_irqrestore(&intf->maintenance_mode_lock,
19481951
flags);
@@ -5081,6 +5084,7 @@ static bool ipmi_timeout_handler(struct ipmi_smi *intf,
50815084
&& (intf->auto_maintenance_timeout <= 0)) {
50825085
intf->maintenance_mode_state =
50835086
IPMI_MAINTENANCE_MODE_STATE_OFF;
5087+
intf->auto_maintenance_timeout = 0;
50845088
maintenance_mode_update(intf);
50855089
}
50865090
}
@@ -5103,8 +5107,6 @@ static void ipmi_request_event(struct ipmi_smi *intf)
51035107
intf->handlers->request_events(intf->send_info);
51045108
}
51055109

5106-
static struct timer_list ipmi_timer;
5107-
51085110
static atomic_t stop_operation;
51095111

51105112
static void ipmi_timeout_work(struct work_struct *work)
@@ -5128,6 +5130,8 @@ static void ipmi_timeout_work(struct work_struct *work)
51285130
}
51295131
need_timer = true;
51305132
}
5133+
if (intf->maintenance_mode_state)
5134+
need_timer = true;
51315135

51325136
need_timer |= ipmi_timeout_handler(intf, IPMI_TIMEOUT_TIME);
51335137
}

0 commit comments

Comments
 (0)