Hi tech@,

sending IPMI command can fail for some reason (e.g. during BMC reset,
and possibly BMC is just busy?), then it should be better to return
error than panic().

--- sys/dev/ipmi.c
+++ sys/dev/ipmi.c
@@ -1039,10 +1039,10 @@ ipmi_cmd_poll(struct ipmi_cmd *c)
 {
        mtx_enter(&c->c_sc->sc_cmd_mtx);
 
-       if (ipmi_sendcmd(c)) {
-               panic("%s: sendcmd fails", DEVNAME(c->c_sc));
-       }
-       c->c_ccode = ipmi_recvcmd(c);
+       if ((c->c_ccode = ipmi_sendcmd(c)))
+               printf("%s: sendcmd fails\n", DEVNAME(c->c_sc));
+       else
+               c->c_ccode = ipmi_recvcmd(c);
 
        mtx_leave(&c->c_sc->sc_cmd_mtx);
 }
@@ -1819,8 +1819,6 @@ ipmiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, 
struct proc *proc)
                c->c_txlen = req->msg.data_len;
                c->c_rxlen = 0;
                ipmi_cmd(c);
-
-               KASSERT(c->c_ccode != -1);
                break;
        case IPMICTL_RECEIVE_MSG_TRUNC:
        case IPMICTL_RECEIVE_MSG:

--
FUKAUMI Naoki

Reply via email to