[Skiboot] [PATCH] hw/bt: allow BT driver to use different buffer size

Cyril Bur cyrilbur at gmail.com
Mon Jan 11 17:09:39 AEDT 2016


On Wed,  6 Jan 2016 10:57:13 +0100
Cédric Le Goater <clg at fr.ibm.com> wrote:

> The buffer size used by the BT driver defaults to 64bytes even when
> the BMC reports a different size. This patch removes the restriction
> as there is no apparent reason for it.
> 

The only reason it was written like this was to avoid breaking anything, I like
this change especially if we have things out there that can make use of bigger
buffers.

> The extra byte added on the input and output buffer size in the test
> also seems superfluous. The buffer lengths used later in the code are
> correct as they take into account the extra byte needed for the
> message size :
> 
> 	bt.caps.input_buf_len = msg->data[1] + 1;
> 	bt.caps.output_buf_len = msg->data[2] + 1;
> 
> 
> From IPMI Specs:
> 
>     22.10 Get BT Interface Capabilities Command
> 
>     For Bytes 3 and 4 (Input and Output Buffer size), the buffer
>     message size is the largest value allowed in first byte (length
>     field) of any BT request or response message. For a send, this
>     means if Get BT Interface Capabilities returns 255 in byte 3
>     (input buffer size) the driver can actually write 256 bytes to the
>     input buffer (adding one for the length byte (byte 1) that is sent
>     in with the request.)
> 
> 
> Signed-off-by: Cédric Le Goater <clg at fr.ibm.com>
> ---
> 
>  Tested on palmetto which uses a 64bytes fifo and qemu which uses
>  255bytes.
>  
>  hw/bt.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> Index: skiboot.git/hw/bt.c
> ===================================================================
> --- skiboot.git.orig/hw/bt.c
> +++ skiboot.git/hw/bt.c
> @@ -164,16 +164,14 @@ static void get_bt_caps_complete(struct
>  		goto out;
>  	}
>  
> -	if (msg->data[1] + 1 != BT_FIFO_LEN) {
> +	if (msg->data[1] != BT_FIFO_LEN) {

The aspeed2400 doc (I can't seem to find where I got it from... sorry) states
that the hardware is 64 bytes so i would expect the BMC to return 63 here?
Admittedly I never actually checked what the BMC returns, have you observed
something different from BMC firmware? 
>  		BT_DBG("Got a input buffer len (%u) cap which differs from the default\n",
>  				msg->data[1]);
> -		goto out;
>  	}
>  
> -	if (msg->data[2] + 1 != BT_FIFO_LEN) {
> +	if (msg->data[2] != BT_FIFO_LEN) {
>  		BT_DBG("Got a output buffer len (%u) cap which differs from the default\n",
>  				msg->data[2]);
> -		goto out;
>  	}
>  
>  	/*
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot



More information about the Skiboot mailing list