[Skiboot] [PATCH] hw/bt.c: Fix message timeout

Stewart Smith stewart at linux.vnet.ibm.com
Thu Feb 25 14:05:17 AEDT 2016

Alistair Popple <alistair at popple.id.au> writes:
> Commit fb457c9 (hw/bt: Ask the BMC for its BT interface capabilities)
> sets the BT message timeout based on the IPMI get capabilities
> command. This adds a new structure containing a uint8_t to store the
> message timeout in seconds (msg_timeout).
> This introduces two problems:
> 1) The code that checks for timeouts assumes msg_timeout is in units
> of the timebase (tb_hz).
> 2) If get_bt_caps() fails msg_timeout is set to BT_MSG_TIMEOUT which
> is in units of tb_hz and easily overflows a uint8_t.
> This patch solves the above two problems by changing the definition of
> BT_MSG_TIMEOUT to seconds and using secs_to_tb() when comparing
> timebases. It also converts the timebase comparison to use
> tb_compare().
> Signed-off-by: Alistair Popple <alistair at popple.id.au>
> Cc: Cyril Bur <cyril.bur at au1.ibm.com>
> Cc: Stewart Smith <stewart at linux.vnet.ibm.com>
> Cc: Jeremy Kerr <jk at ozlabs.org>
> Cc: Mamatha Inamdar <mamatha4 at linux.vnet.ibm.com>
> ---
>  hw/bt.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Thanks, merged into master as of 9a6e83c

Stewart Smith
OPAL Architect, IBM.

More information about the Skiboot mailing list