[Skiboot] [PATCH] hw/bt.c: Retry sending ipmi message in bt with correct data

Alistair Popple alistair at popple.id.au
Tue Feb 23 17:06:06 AEDT 2016


Hi Mamatha,

On Tue, 23 Feb 2016 10:44:37 Vaibhav Jain wrote:
> Hi Mamatha,
> 
> A minor comment.
> 
> Mamatha Inamdar <mamatha4 at linux.vnet.ibm.com> writes:
> 
> > diff --git a/hw/bt.c b/hw/bt.c
> > index df4a4f0..e4266f6 100644
> > --- a/hw/bt.c
> > +++ b/hw/bt.c
> > @@ -397,10 +397,10 @@ 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++;
> > -
> >  			bt_msg->tb = tb;
> > -			bt_outb(BT_CTRL_H2B_ATN, BT_CTRL);
> > +
> > +			/* retry sending ipmi_msg */
> > +			bt_send_msg(bt_msg);
> With this change the comment above the code isnt valid anymore. So
> please update the comment accordingly.

There are two types of timeouts we have observed:
1. The BMC clears H2B_ATN but doesn't actually consume the data.
2. The BMC clears H2B_ATN and consumes the data.

The original code only dealt with the first case as in that case the data 
hasn't been consumed and there is no risk of the BMC seeing the command twice.

The second case is more tricky, the BMC may have processed the data but not 
sent a response. Or it may not have processed the data at all. Or it may start 
processing data just as we start writing more data.

We will need to check for bt_idle() before calling bt_send_msg() as 
bt_send_msg() assumes the BT interface is idle and the BMC isn't reading from 
it. I am still somewhat concerned about sending two copies of the same message 
which may result in the BMC doing something twice, but I'm not sure how much 
of a problem this would be in practice?

- Alistair

> Cheers,
> ~ Vaibhav
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
> 



More information about the Skiboot mailing list