From c2b1e76d8c91166ca5f7aa8df02d67b619e24dc3 Mon Sep 17 00:00:00 2001 From: Xianting Tian Date: Tue, 15 Sep 2020 15:44:41 +0800 Subject: 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 Message-Id: <20200915074441.4090-1-tian.xianting@h3c.com> [Converted printk() to pr_xxx().] Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_bt_sm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/char/ipmi/ipmi_bt_sm.c') 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"); -- cgit v1.2.3