SPI keeps sending clock and MOSI-data after Chip-Select returns to High


I’m evaluating the SPI behavior in the VF61 running Linux 4.4.21.
With the help from Toradex, I’ve been able to properly enable and configure the SPIs of the VF61.

But, here comes another question:
I’m using a Logic Analyzer (Saleae Logic16) to see the SPI data flow.
After a SPI frame, the SPI keeps sendind clock and “pulses” of data on the MOSI signal. That’s odd!
I’ve captured this situation and here is it, from the view of the Logic Analyzer:

See that the signals are properly named at the left, beginning with SPI-CLOCK, SPI - ENABLE, SPI - MOSI and SPI - MISO.
The SPI clock is configured, for this simple example, at 500 KHz.

This signals are generated from the spidev.c sample program, available in the Kernel Source (I just modified the sample data for transmission), and it is using the spidev1.0 (SPI 1, CS 0).

This same behavior is observed when using others SPIs, like SPI0, SPI2 and even the SPI3.

This is a known issue?

That is nothing that can compromise our work, because the SPI only work on CS low.
But that is odd, don’t you think?

Thanks for your attention!

This is a known issue with the SPI DMA implementation. We have the fixes ready and they are under internal review. We expect to commit the fixes to our 4.4-next git branch next week. In the meanwhile, you may use the entry

dma-names = " ", " ";

in the dspi node which will disable DMA and use EOQ mode which should work correctly.


I’ll try that as soon as possible.

Another thing:
If I change the dma-names to this pattern in the SPI0, SPI1, SPI2 and SPI3 nodes, is there any chance I’d get a kernel panic in the usage of the SPIs?

It should only be required for DSPI0 and DSPI1. DSPI2 and DSPI3 do not have DMA entries defined. See here. But do you see a kernel panic on introducing dma-names?

@andrecurvello Fixes for SPI DMA are now available in the latest 4.4-next branch with the latest 7 commits. To test please make sure to remove

 dma-names = " ", " ";

if present, as advised earlier. Note that we now enable DMA by default for DSPI2 and DSPI3 as well.