public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* sun6i SPI driver issue
@ 2018-03-19 15:43 Sergey Suloev
  2018-03-26 11:45 ` Maxime Ripard
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Suloev @ 2018-03-19 15:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi guys,

I have recently found a critical issue with sun6i SPI driver. It 
actually found it long time ago while using spidev but I didn't 
considered it as something important. Now it seems like a blocking issue 
that prevents using the driver in any serious application.
I have created a DRM driver for a ili9488-based display, its source is 
available here [1] and device tree overlay [2]. The driver has been 
successfully verified on RPi3, but? it is failing on sunxi: the driver 
gets loaded, display seems working but SPI transfers are periodically 
failing with error -110 (timeout). Due to the issue the picture is 
frozen and completely refreshed again from time to time.

The problem is reproduced on OrangePi PC and BananaPi M2. I am providing 
dmesg from my OrangePi PC [3].

Let know if you need any additional info.

Thanks

-------------------------------------------------------------------

[1] https://github.com/sergey-suloev/tinydrm/blob/master/ili9488.c

[2] 
https://github.com/sergey-suloev/tinydrm/blob/master/overlays/sunxi/mainline/sun8i-h3-ertft0356-drm.dts 


[3] https://pastebin.com/xYqWKcJ2

^ permalink raw reply	[flat|nested] 5+ messages in thread
* sun6i spi driver issue
@ 2018-03-24  6:42 Sergey Suloev
  2018-03-27  7:49 ` Maxime Ripard
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Suloev @ 2018-03-24  6:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

the following patch [1] isn't working on my BPi M2, OPi PC, OPi PC+. I 
have no more boards to test currently but I am sure it will fail on 
others too. As soon as the max transfer size is set to a value MORE THAN 
FIFO then most of transfers would end up with -110 (timeout).

[1] https://patchwork.kernel.org/patch/9634315/

I have reverted the patch back in my local kernel and it works well on 
all the boards mentioned. It works fine too without subtracting 1 byte 
from FIFO, i.e. one could use the code below:

static size_t sun6i_spi_max_transfer_size(struct spi_device *spi)
{
 ??????? struct sun6i_spi *sspi = spi_master_get_devdata(spi->master);

 ??????? return sspi->fifo_depth;
}

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-27  7:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 15:43 sun6i SPI driver issue Sergey Suloev
2018-03-26 11:45 ` Maxime Ripard
     [not found]   ` <1aab0d1b-cdd4-cdbc-0242-af5d180e581b@orpaltech.com>
2018-03-27  7:47     ` Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2018-03-24  6:42 sun6i spi " Sergey Suloev
2018-03-27  7:49 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox