diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-02-05 21:23:33 +0530 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-03-04 19:45:03 +0530 |
commit | 73fa7be132a4ac2f04af652e09297e984680af89 (patch) | |
tree | 9249ae1c42d2bb14d3d5198b6e5fbf28a82ac134 /hw | |
parent | 2e2bf87b42f704d40ac5855aace858b320184a20 (diff) | |
download | skiboot-73fa7be132a4ac2f04af652e09297e984680af89.zip skiboot-73fa7be132a4ac2f04af652e09297e984680af89.tar.gz skiboot-73fa7be132a4ac2f04af652e09297e984680af89.tar.bz2 |
hw/bt: Fix message retry handler
[ Upstream commit fdd27ca27231e1b128b6cfbc5d8786fe54861cdd ]
In some corner cases (like BMC reboot), bt_send_and_unlock() starts
message timer, but won't send message to BMC as driver is not free to
send message. bt_expire_old_msg() function enables H2B interrupt without
actually sending message.
This patch fixes above issue.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/bt.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -390,10 +390,18 @@ static void bt_expire_old_msg(uint64_t tb) * doing anything. The data will still be in the * FIFO so just reset the flag.*/ BT_Q_ERR(bt_msg, "Retry sending message"); - bt_msg->send_count++; + /* This means we have started message timeout, but not + * yet sent message to BMC as driver was not free to + * send message. Lets resend message. + */ + if (bt_msg->send_count == 0) + bt_send_msg(bt_msg); + else + bt_outb(BT_CTRL_H2B_ATN, BT_CTRL); + + bt_msg->send_count++; bt_msg->tb = tb; - bt_outb(BT_CTRL_H2B_ATN, BT_CTRL); } else { BT_Q_ERR(bt_msg, "Timeout sending message"); bt_msg_del(bt_msg); |