[Skiboot] [PATCH] hw/bt: Fix message retry handler

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Feb 6 02:53:33 AEDT 2019


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 at linux.vnet.ibm.com>
---
 hw/bt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/bt.c b/hw/bt.c
index 79e3e1ed4..0411d392a 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -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);
-- 
2.14.3



More information about the Skiboot mailing list