summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_kcs_sm.c
diff options
context:
space:
mode:
authorXianting Tian <tian.xianting@h3c.com>2020-09-15 10:44:41 +0300
committerCorey Minyard <cminyard@mvista.com>2020-09-15 17:46:20 +0300
commitc2b1e76d8c91166ca5f7aa8df02d67b619e24dc3 (patch)
tree1b73006ba1ffb13db8d0cd6a6a49f3bb32e0c33b /drivers/char/ipmi/ipmi_kcs_sm.c
parent81e7571ea35e2b8b74b777ac8484818c8a984ea9 (diff)
downloadlinux-c2b1e76d8c91166ca5f7aa8df02d67b619e24dc3.tar.xz
ipmi:sm: Print current state when the state is invalid
Print current state before returning IPMI_NOT_IN_MY_STATE_ERR so we can know where this issue is coming from and possibly fix the state machine. Signed-off-by: Xianting Tian <tian.xianting@h3c.com> Message-Id: <20200915074441.4090-1-tian.xianting@h3c.com> [Converted printk() to pr_xxx().] Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_kcs_sm.c')
-rw-r--r--drivers/char/ipmi/ipmi_kcs_sm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c
index 2e7cda08b079..5064b884ab67 100644
--- a/drivers/char/ipmi/ipmi_kcs_sm.c
+++ b/drivers/char/ipmi/ipmi_kcs_sm.c
@@ -268,8 +268,10 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data,
if (size > MAX_KCS_WRITE_SIZE)
return IPMI_REQ_LEN_EXCEEDED_ERR;
- if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED))
+ if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) {
+ pr_warn("KCS is now in the state %d\n", kcs->state);
return IPMI_NOT_IN_MY_STATE_ERR;
+ }
if (kcs_debug & KCS_DEBUG_MSG) {
printk(KERN_DEBUG "start_kcs_transaction -");