All of lore.kernel.org
 help / color / mirror / Atom feed
* SDMA read/write pointer location issue
@ 2022-04-26 15:52 Ryan Wilkins
  0 siblings, 0 replies; only message in thread
From: Ryan Wilkins @ 2022-04-26 15:52 UTC (permalink / raw)
  To: xenomai

We are running Linux 4.9 under Xenomai 3.0.10 on an i.MX7D rev.5 v71 processor.
The SDMA engine is used to transfer data from main memory to and from the SAI interface.
The main memory buffer is around 40 kByte in size and the DMA uses it as a ring buffer for the data transfer.
In order to know where the DMA is currently reading or writing data inside this buffer, an interrupt is generated whenever 576 bytes of data have been transferred. The interrupt routine then updates a suitable buffer pointer which is used by our software.
The interrupt occurs on average every 250 µsec and is handled by a regular non-realtime Linux interrupt routine.

This works but there is a problem: The DMA interrupt and consequently the buffer pointer update is sometimes delayed for quite some time.  Occasionally, there is no interrupt for more than 2 msec, followed by nine interrupts in quick succession to make up for the delay.

We have no evidence that interrupts are ever lost. However, the delayed update of the buffer pointer causes problems in our software.

One idea we had was to read the current DMA read/write address directly from the SDMA hardware, rather than relying on the interrupt. We were unsuccessfully looking at the file imx-sdma.c in order to find this information.

In summary, we need to know the DMA's read/write address when the interrupt is triggered, with no or very little delay.

Any pointers would be greatly appreciated.  Thank you!

Ryan Wilkins



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-26 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 15:52 SDMA read/write pointer location issue Ryan Wilkins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.