[PATCH linux dev-5.7 1/6] spi: fsi: Handle 9 to 15 byte transfers lengths

Joel Stanley joel at jms.id.au
Thu Jul 30 09:41:25 AEST 2020


On Wed, 29 Jul 2020 at 20:45, Eddie James <eajames at linux.ibm.com> wrote:
>
> From: Brad Bishop <bradleyb at fuzziesquirrel.com>
>
> The trailing <len> - 8 bytes of transfer data in this size range is no
> longer ignored.
>
> Signed-off-by: Eddie James <eajames at linux.ibm.com>
> Signed-off-by: Brad Bishop <bradleyb at fuzziesquirrel.com>

Phew, that's subtle :)

Fixes: bbb6b2f9865b ("spi: Add FSI-attached SPI controller driver")
Reviewed-by: Joel Stanley <joel at jms.id.au>

> ---
>  drivers/spi/spi-fsi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
> index 37a3e0f8e752..8f64af0140e0 100644
> --- a/drivers/spi/spi-fsi.c
> +++ b/drivers/spi/spi-fsi.c
> @@ -258,15 +258,15 @@ static int fsi_spi_sequence_transfer(struct fsi_spi *ctx,
>         if (loops > 1) {
>                 fsi_spi_sequence_add(seq, SPI_FSI_SEQUENCE_BRANCH(idx));
>
> -               if (rem)
> -                       fsi_spi_sequence_add(seq, rem);
> -
>                 rc = fsi_spi_write_reg(ctx, SPI_FSI_COUNTER_CFG,
>                                        SPI_FSI_COUNTER_CFG_LOOPS(loops - 1));
>                 if (rc)
>                         return rc;
>         }
>
> +       if (rem)
> +               fsi_spi_sequence_add(seq, rem);
> +
>         return 0;
>  }
>
> --
> 2.24.0
>


More information about the openbmc mailing list