Skip to content

RFC Clean up Ion mapping/caching

Laura Abbott linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3staging: ion: Move away from the DMA APIs for cache flushingdrivers/staging/android/ion/Kconfig drivers/staging/android/ion/Makefile drivers/staging/android/ion/ion-arm.c +8 more+210 -634 replies
2/3staging: ion: Add support for syncing with DMA_BUF_IOCTL_SYNCdrivers/staging/android/ion/ion.c+13 -00 replies
3/3staging: ion: Add dma_map/dma_unmap calls to dma_buf callsdrivers/staging/android/ion/ion.c+12 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/3] Clean up Ion mapping/caching

Hi,

This series cleans up Ion a bit to be more in line with existing standards for caching and dma mapping.

The most controversial part of this is probably going to be the first patch. Ion takes quite a few liberties with how the DMA APIs are used for cache syncing. dma_sync_sg is used without calling dma_map first. There isn't a good way to get the cache synchronization with the DMA APIs. The behavior of Ion is closer to the DRM framework which uses its own private cache APIs for synchronization so I took that approach.

Assuming the approach of the first patch is appropriate, the next two patches are fairly simple. dma_buf added support for a sync ioctl. Ion has a similar ioctl already so this fixes the Ion APIs to be compatible with the dma_buf ioctl. My plan would be to put a timeline on deprecation for the old Ion sync ioctl. The map_dma_buf calls were also missing calls to the underlying DMA APIs so the final patch in the series adds the appropriate calls.

Feedback is appreciated.

Thanks,
Laura

Laura Abbott (3):
staging: ion: Move away from the DMA APIs for cache flushing
staging: ion: Add support for syncing with DMA_BUF_IOCTL_SYNC
staging: ion: Add dma_map/dma_unmap calls to dma_buf calls

 drivers/staging/android/ion/Kconfig             | 14 ++++-
 drivers/staging/android/ion/Makefile            |  3 +
 drivers/staging/android/ion/ion-arm.c           | 83 ++++++++++++++++++++++++
 drivers/staging/android/ion/ion-arm64.c         | 46 ++++++++++++++
 drivers/staging/android/ion/ion-x86.c           | 34 ++++++++++
 drivers/staging/android/ion/ion.c               | 84 +++++++++++++------------
 drivers/staging/android/ion/ion_carveout_heap.c |  5 +-
 drivers/staging/android/ion/ion_chunk_heap.c    |  7 +--
 drivers/staging/android/ion/ion_page_pool.c     |  3 +-
 drivers/staging/android/ion/ion_priv.h          | 14 ++---
 drivers/staging/android/ion/ion_system_heap.c   |  5 +-
 11 files changed, 235 insertions(+), 63 deletions(-)
 create mode 100644 drivers/staging/android/ion/ion-arm.c
 create mode 100644 drivers/staging/android/ion/ion-arm64.c
 create mode 100644 drivers/staging/android/ion/ion-x86.c
Signature · 1 line
2.5.5