On Sat, Apr 13, 2019 at 08:24:14PM +0200, Noralf Trønnes wrote:
> @@ -844,6 +816,17 @@ static int bcm2835_spi_prepare_message(struct spi_master 
> *master,
>       struct spi_device *spi = msg->spi;
>       struct bcm2835_spi *bs = spi_master_get_devdata(master);
>       u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS);
> +     int ret;
> +
> +     /*
> +      * DMA transfers are limited to 16 bit (0 to 65535 bytes) by the SPI HW
> +      * due to DLEN. Split up transfers (32-bit FIFO aligned) if the limit is
> +      * exceeded.
> +      */
> +     ret = spi_split_transfers_maxsize(master, msg, 65532,
> +                                       GFP_KERNEL | GFP_DMA);
> +     if (ret)
> +             return ret;

This looks much better than the previous version because
spi_split_transfers_maxsize() is now used as a library function
by an individual driver, rather than something that is inflicted
on *all* drivers (midlayer fallacy).

Of course the performance is suboptimal compared to an approach
which transmits the sglist in portions which are < 65535 each,
but we can move to that later.

In case it helps,
Reviewed-by: Lukas Wunner <lu...@wunner.de>

Thanks,

Lukas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to