SPRZ452I july 2018 – may 2023 AM6526 , AM6528 , AM6546 , AM6548
RINGACC, UDMA: RINGACC and UDMA Ring State Interoperability Issue after Channel Teardown
AM65x SR 1.0
The Ring Accelerator (RINGACC) and the Unified DMA Controller (UDMA) each maintain their own state information about rings (queues). However, when a ring is reset in the RINGACC, the UDMA is unaware of this operation and its state information for that ring is not reset. As a result, the UDMA may believe a ring still has valid pending entries, while the RINGACC does not, and will potentially read invalid information from a recently reset and enabled ring.
Resetting a ring is a required operation (following DMA channel teardown operations and before re-enabling the DMA channels) when re-configuring an existing ring for another purpose (that is changing the ring mode, DMA channels, channel type, etc.).
The software workaround is to use the ring-mode doorbell functionality to cause the UDMA occupancy counter for a given ring to increment and wrap back to 0. Since a ring’s UDMA occupancy counter is 21-bits wide, and the highest doorbell ring count that can be written per register write is 127, the workaround requires a maximum of ((2**22) / 127) = 33,027 writes to the doorbell register. Note that a negative value cannot be used as the doorbell ring count value as the UDMA ignores negative values (a negative doorbell ring count value is seen by the UDMA as a ring pop count of abs(value) elements which it ignores in its ring state accounting).
To implement the software workaround, the following sequence should be used:
This will ultimately reset the UDMA state information for a ring so that the RINGACC and UDMA are both in the same reset state for that ring. This workaround must be executed only when the DMA channels associated with the ring are disabled.