git: df866676411e - stable/13 - ipmi(4): Limit maximum watchdog pre-timeout interval.

Alexander Motin mav at FreeBSD.org
Wed Sep 29 00:43:20 UTC 2021


The branch stable/13 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=df866676411e22c9de4b0ebb73fda41906a015c4

commit df866676411e22c9de4b0ebb73fda41906a015c4
Author:     Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-09-15 01:06:39 +0000
Commit:     Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-09-29 00:43:18 +0000

    ipmi(4): Limit maximum watchdog pre-timeout interval.
    
    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
    
    (cherry picked from commit 6c2d4404161aa2bac1c7992afbf5a763f1a6f66e)
---
 sys/dev/ipmi/ipmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c
index 77baf652b4bc..a8f3e7f1be10 100644
--- a/sys/dev/ipmi/ipmi.c
+++ b/sys/dev/ipmi/ipmi.c
@@ -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;


More information about the dev-commits-src-branches mailing list