Skip to content

Commit 21d4b92

Browse files
rlippertgregkh
authored andcommitted
ipmi/watchdog: fix wdog hang on panic waiting for ipmi response
[ Upstream commit 2c1175c2e8e5487233cabde358a19577562ac83e ] Commit c49c097610fe ("ipmi: Don't call receive handler in the panic context") means that the panic_recv_free is not called during a panic and the atomic count does not drop to 0. Fix this by only expecting one decrement of the atomic variable which comes from panic_smi_free. Signed-off-by: Robert Lippert <[email protected]> Signed-off-by: Corey Minyard <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b69c4a1 commit 21d4b92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/char/ipmi/ipmi_watchdog.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static void panic_halt_ipmi_heartbeat(void)
509509
msg.cmd = IPMI_WDOG_RESET_TIMER;
510510
msg.data = NULL;
511511
msg.data_len = 0;
512-
atomic_add(2, &panic_done_count);
512+
atomic_add(1, &panic_done_count);
513513
rv = ipmi_request_supply_msgs(watchdog_user,
514514
(struct ipmi_addr *) &addr,
515515
0,
@@ -519,7 +519,7 @@ static void panic_halt_ipmi_heartbeat(void)
519519
&panic_halt_heartbeat_recv_msg,
520520
1);
521521
if (rv)
522-
atomic_sub(2, &panic_done_count);
522+
atomic_sub(1, &panic_done_count);
523523
}
524524

525525
static struct ipmi_smi_msg panic_halt_smi_msg = {
@@ -543,12 +543,12 @@ static void panic_halt_ipmi_set_timeout(void)
543543
/* Wait for the messages to be free. */
544544
while (atomic_read(&panic_done_count) != 0)
545545
ipmi_poll_interface(watchdog_user);
546-
atomic_add(2, &panic_done_count);
546+
atomic_add(1, &panic_done_count);
547547
rv = i_ipmi_set_timeout(&panic_halt_smi_msg,
548548
&panic_halt_recv_msg,
549549
&send_heartbeat_now);
550550
if (rv) {
551-
atomic_sub(2, &panic_done_count);
551+
atomic_sub(1, &panic_done_count);
552552
printk(KERN_WARNING PFX
553553
"Unable to extend the watchdog timeout.");
554554
} else {

0 commit comments

Comments
 (0)