diff options
author | Alistair Popple <alistair@popple.id.au> | 2014-11-05 14:40:45 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-11-12 16:41:25 +1100 |
commit | 90c13453f743574146cfcf33a3a05d99167eb2ad (patch) | |
tree | 76a4bcc68b6a729f1d1dee35d791fcb62df273cc /hw/bt.c | |
parent | b54d1a8cfc24b06a7649cc5e33aa704662716a28 (diff) | |
download | skiboot-90c13453f743574146cfcf33a3a05d99167eb2ad.zip skiboot-90c13453f743574146cfcf33a3a05d99167eb2ad.tar.gz skiboot-90c13453f743574146cfcf33a3a05d99167eb2ad.tar.bz2 |
bt: Add call to bt_poll to kick start message state machine
The bt interface relies on a fairly simple state machine to send
messages to the bmc. Messages are added to a queue for sending and
something calls the state machine to start sending messages, usually
via opal_poll_events. However under some circumstances this doesn't
happen so we need to crank the state machine to start start sending
messages.
This patch adds a call to bt_poll to make sure we start sending a
message which should ensure the bmc generates an irq once the message
is sent to continue processing.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/bt.c')
-rw-r--r-- | hw/bt.c | 46 |
1 files changed, 24 insertions, 22 deletions
@@ -129,28 +129,6 @@ static void bt_msg_del(struct bt_msg *bt_msg) IPMI_TIMEOUT_ERR, &bt_msg->ipmi_msg); } -static int bt_add_ipmi_msg(struct ipmi_msg *ipmi_msg) -{ - struct bt_msg *bt_msg = container_of(ipmi_msg, struct bt_msg, ipmi_msg); - - lock(&bt.lock); - bt_msg->tb = mftb(); - bt_msg->seq = ipmi_seq++; - list_add_tail(&bt.msgq, &bt_msg->link); - bt.queue_len++; - if (bt.queue_len > BT_MAX_QUEUE_LEN) { - /* Maximum ueue lenght exceeded - remove the oldest message - from the queue. */ - prerror("BT: Maximum queue length exceeded\n"); - bt_msg = list_tail(&bt.msgq, struct bt_msg, link); - assert(bt_msg); - bt_msg_del(bt_msg); - } - unlock(&bt.lock); - - return 0; -} - static void bt_reset_interface(void) { bt_outb(BT_INTMASK_BMC_HWRST, BT_INTMASK); @@ -379,6 +357,30 @@ static void bt_poll(void *data __unused) while(!ret); } +static int bt_add_ipmi_msg(struct ipmi_msg *ipmi_msg) +{ + struct bt_msg *bt_msg = container_of(ipmi_msg, struct bt_msg, ipmi_msg); + + lock(&bt.lock); + bt_msg->tb = mftb(); + bt_msg->seq = ipmi_seq++; + list_add_tail(&bt.msgq, &bt_msg->link); + bt.queue_len++; + if (bt.queue_len > BT_MAX_QUEUE_LEN) { + /* Maximum ueue lenght exceeded - remove the oldest message + from the queue. */ + prerror("BT: Maximum queue length exceeded\n"); + bt_msg = list_tail(&bt.msgq, struct bt_msg, link); + assert(bt_msg); + bt_msg_del(bt_msg); + } + unlock(&bt.lock); + + bt_poll(NULL); + + return 0; +} + void bt_irq(void) { uint8_t ireg = bt_inb(BT_INTMASK); |