[PATCH v2 4/8] iommu/tegra: gart: Remove pr_fmt and clean up includes

2018-08-04 Thread Dmitry Osipenko
Remove unneeded headers inclusion and sort the headers in alphabet order. Remove pr_fmt macro since there is no pr_*() in the code and it doesn't affect dev_*() functions. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 17 + 1 file changed, 5 insertions(+), 12

[PATCH v2 3/8] iommu/tegra: gart: Clean up drivers module code

2018-08-04 Thread Dmitry Osipenko
GART driver is built-in, hence it can't be unloaded and the module removal code is never used. This patch merely removes the dead code and makes GART driver explicitly built-in by dropping the drivers bind/unbind sysfs attributes. Lastly disallow to defer drivers probing, since it's a core driver

[PATCH v2 7/8] iommu: Introduce iotlb_sync_map callback

2018-08-04 Thread Dmitry Osipenko
Introduce iotlb_sync_map() callback that is invoked in the end of iommu_map(). This new callback allows IOMMU drivers to avoid syncing after mapping of each contiguous chunk and sync only when the whole mapping is completed, optimizing performance of the mapping operation. Signed-off-by: Dmitry

[PATCH v2 8/8] iommu/tegra: gart: Optimize mapping / unmapping performance

2018-08-04 Thread Dmitry Osipenko
Currently GART writes one page entry at a time. More optimal would be to aggregate the writes and flush BUS buffer in the end, this gives map/unmap 10-40% performance boost (depending on size of mapping) in comparison to flushing after each page entry update. Signed-off-by: Dmitry Osipenko ---

[PATCH v2 6/8] iommu/tegra: gart: Ignore devices without IOMMU phandle in DT

2018-08-04 Thread Dmitry Osipenko
GART can't handle all devices, hence ignore devices that aren't related to GART. IOMMU phandle must be explicitly assign to devices in the device tree. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git

[PATCH v2 5/8] iommu/tegra: gart: Clean up driver probe errors handling

2018-08-04 Thread Dmitry Osipenko
Properly clean up allocated resources on the drivers probe failure and remove unneeded checks. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/tegra-gart.c

[PATCH v2 0/8] Tegra GART driver clean up and optimization

2018-08-04 Thread Dmitry Osipenko
Hello, This patch-series makes GART driver one step closer to become actually usable by addressing the following: 1. Thierry noticed that Memory Controller driver uses registers that belong to GART in [0] and for now MC driver only reports the fact of GART's page fault. The first two

[PATCH v2 1/8] memory: tegra: Provide facility for integration with the GART driver

2018-08-04 Thread Dmitry Osipenko
In order to report clients name and access direction on GART's page fault, MC driver need to access GART registers. Add facility that provides access to the GART. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 26 +++--- include/soc/tegra/mc.h| 13

[PATCH v2 2/8] iommu/tegra: gart: Provide access to Memory Controller driver

2018-08-04 Thread Dmitry Osipenko
GART contain registers needed by the Memory Controller driver, provide access to the MC driver by utilizing its GART-integration facility. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 23 +++ 1 file changed, 23 insertions(+) diff --git