Skip to content

Clean up exposure of arch-internal code

Heiko Stübner linux-arm-kernel linux-arm-msm linux-iommu linux-tegra 1 version New

Get series with b4
b4 am 1879037.GgHtQQQr5L@diego

Versions newest first

  1. v1 Latest0 of 18 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 18 patches the cover letter announces are in this archive.

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/18] Clean up exposure of arch-internal code

Am Montag, 27. Juli 2015, 15:13:13 schrieb Joerg Roedel:

Quoted 1 line

[+ Heiko for comment on Rockchip IOMMU]

adding also Daniel Kurtz and Tomasz Figa who did most of the iommu stuff if I remember correctly.

While I'm not this versed in the iommu world I see the issue Russell pointed out, as especially the cache flushes won't work like this on arm64, which uses the same iommu on the rk3368.

I'll also try to understand what this does and what needs to be done to the Rockchip iommu, but I guess that'll still take a bit.

Quoted 50 lines · Russell King - ARM Linux
Quoted 49 lines

This series of patches attempts to clean up the use of architecture internal functions in drivers, and removes some functions from view in the asm/ headers. I'm also considering whether we need to add some linker magic to hide symbols when building the built-in.o files.

This was triggered by 3rd party drivers "going under the covers" of the DMA API and calling the dmac_*() functions directly, a practice which I have always refused to allow. This also breaks module building (which is the big hint that they're doing something wrong.)

However, it also came to light that various drivers are using __cpuc_* functions directly, which are non-portable, and is another instance of "going under the covers" and tinkering with what should be kept as architecture implementation details.

This series addresses some of these points. It:

(a) moves dmac_map_area() and dmac_unmap_area() prototypes out of

asm/cacheflush.h and into arch/arm/mm.

(b) provide a secure_flush() call for the Qualcomm secure monitor

code.

(c) stop tegra smmu driver(s) from using __cpuc_flush_dcache_area,

something which necessitates additional complexity to deal with the ARM vs ARM64 differences. It should be using the DMA API. However, the Tegra SMMU driver is in really bad shape, and this isn't a simple conversion - it requires a lot of additional fixes to bring the code up to scratch.

It leaves the Rockchip IOMMU driver for the time being, but that is also something which needs cleaning up in the same way as the Tegra SMMU driver.

 arch/arm/include/asm/cacheflush.h |  21 ++-
 arch/arm/include/asm/glue-cache.h |   2 -
 arch/arm/mm/dma-mapping.c         |   1 +
 arch/arm/mm/dma.h                 |  32 ++++
 drivers/firmware/qcom_scm-32.c    |   4 +-
 drivers/iommu/tegra-smmu.c        | 297
 ++++++++++++++++++++++++-------------- drivers/memory/tegra/tegra114.c  
 |  17 ---
 drivers/memory/tegra/tegra124.c   |  30 ----
 drivers/memory/tegra/tegra30.c    |  17 ---
 include/soc/tegra/mc.h            |   7 -
 10 files changed, 242 insertions(+), 186 deletions(-)