Skip to content

Commit

Permalink
ipmi(4): Limit maximum watchdog pre-timeout interval.
Browse files Browse the repository at this point in the history
Previous code by default setting pre-timeout interval to 120 seconds
made impossible to set timeout interval below that, resulting in error
0xcc (Invalid data field in Request) at least on Supermicro boards.

To fix that limit maximum pre-timeout interval to ~1/4 of the timeout
interval, that sounds like a reasonable default: not too short to fire
too late, but also not too long to give many false reports.

MFC after:	2 weeks
  • Loading branch information
amotin committed Sep 15, 2021
1 parent 02d8194 commit 6c2d440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/dev/ipmi/ipmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec)
req->ir_request[0] = IPMI_SET_WD_TIMER_DONT_STOP
| IPMI_SET_WD_TIMER_SMS_OS;
req->ir_request[1] = (wd_timer_actions & 0xff);
req->ir_request[2] = (wd_pretimeout_countdown & 0xff);
req->ir_request[2] = min(0xff,
min(wd_pretimeout_countdown, (sec + 2) / 4));
req->ir_request[3] = 0; /* Timer use */
req->ir_request[4] = (sec * 10) & 0xff;
req->ir_request[5] = (sec * 10) >> 8;
Expand Down

0 comments on commit 6c2d440

Please sign in to comment.