summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_bt_sm.c
diff options
context:
space:
mode:
authorXianting Tian <tian.xianting@h3c.com>2020-09-15 15:44:41 +0800
committerCorey Minyard <cminyard@mvista.com>2020-09-15 09:46:20 -0500
commitc2b1e76d8c91166ca5f7aa8df02d67b619e24dc3 (patch)
tree1b73006ba1ffb13db8d0cd6a6a49f3bb32e0c33b /drivers/char/ipmi/ipmi_bt_sm.c
parent81e7571ea35e2b8b74b777ac8484818c8a984ea9 (diff)
downloadlinux-c2b1e76d8c91166ca5f7aa8df02d67b619e24dc3.tar.bz2
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_bt_sm.c')
-rw-r--r--drivers/char/ipmi/ipmi_bt_sm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index f3f216cdf686..2de0c6c304f3 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -213,8 +213,10 @@ static int bt_start_transaction(struct si_sm_data *bt,
if (bt->state == BT_STATE_LONG_BUSY)
return IPMI_NODE_BUSY_ERR;
- if (bt->state != BT_STATE_IDLE)
+ if (bt->state != BT_STATE_IDLE) {
+ dev_warn(bt->io->dev, "BT is now in the state %d\n", bt->state);
return IPMI_NOT_IN_MY_STATE_ERR;
+ }
if (bt_debug & BT_DEBUG_MSG) {
dev_dbg(bt->io->dev, "+++++++++++++++++ New command\n");