SPI lock-up with zero-length transfers
Nicolas Saenz Julienne
nsaenzjulienne at suse.de
Thu Jan 28 09:33:29 EST 2021
On Thu, 2021-01-28 at 14:26 +0000, Phil Elwell wrote:
> Hi,
>
> Commit [1] - an optimisation of the PIO transfers loops of spi-bcm2835
> - causes lockups if a zero-length transfer is attempted. The commit
> message says that "[t]he blind and counted loops are always called
> with nonzero count", which is technically true but ignores the fact
> that count can be reduced to zero before entering the loop if tfr->len
> is zero.
>
> A workaround has been added in the raspberrypi/linux repo that
> explicitly checks for zero-length transfers in
> bcm2835_spi_transfer_one, but perhaps it would be better to catch this
> degenerate case in the common framework code - I'm not an SPI expert.
Me neither to be honest, but I'll have a look at it. Thanks for the heads-up.
Regards,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-rpi-kernel/attachments/20210128/6efa1560/attachment.sig>
More information about the linux-rpi-kernel
mailing list