spidev behavior is different from TX2 and TX1 when using ioctl

TLDR; I think there might be a bug in the spidev ioctl for multiple transactions.

I wrote a userland application that interfaces with an IMU over SPI using spidev.

Everything worked fine on the TX1 but when I tried to run the same application on the TX2 the application didn’t run.

I attached a logic analyzer to the SPI Bus and observed the behavior on the TX1 and the TX2 is different.

When I use a ‘spi_ioc_transfer’ structure for a read/write transactions and call the ‘ioctl(SPI_DEVICE, SPI_IOC_MESSAGE(1), &spi_ioc_transfer)’ the TX1 and TX2 behaved differently.

The difference between the two platform is the ‘cs_change’ member.

On the TX1 when cs_change is set to ‘1’ the driver will drive the select line low for each of the two transactions. When it is set to ‘0’ the select line will stay low for the entire transaction.

On the TX2 the behavior of the cs_change is reversed.

I just looked up it up in the kernel source, specifically under 'kernel/inlcude/uapi/linux/spi/spidev.h

cs_change: ‘True to deselect the device before starting the next transfer.’

Dave

Thanks for your report. We need time to clarify it.