diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2025-08-22 13:56:27 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2025-09-16 17:06:42 +0200 |
commit | f8d9e56aeb87ce82ce8636cd176cc59b69aa0e41 (patch) | |
tree | 0fce5617c0062bdd7e64a0ab3e00408e9d900feb /rust/helpers/irq.c | |
parent | d515503f3c8a8475b2f78782534aad09722904e1 (diff) |
i3c: master: Add helpers for DMA mapping and bounce buffer handling
Some I3C controllers such as MIPI I3C HCI may pad the last DWORD (32-bit)
with stale data from the RX FIFO in DMA transfers if the receive length
is not DWORD aligned and when the device DMA is IOMMU mapped.
In such a case, a properly sized bounce buffer is required in order to
avoid possible data corruption. In a review discussion, proposal was to
have a common helpers in I3C core for DMA mapping and bounce buffer
handling.
Drivers may use the helper i3c_master_dma_map_single() to map a buffer
for a DMA transfer. It internally allocates a bounce buffer if buffer is
not DMA'able or when the driver requires it for a transfer.
Helper i3c_master_dma_unmap_single() does the needed cleanups and
data copying from the bounce buffer.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250822105630.2820009-2-jarkko.nikula@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'rust/helpers/irq.c')
0 files changed, 0 insertions, 0 deletions