[PATCH] iommu/io-pgtable-arm: Allow non-coherent masters to use system cache

2020-12-23 Thread Sai Prakash Ranjan
commit ecd7274fb4cd ("iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag") removed unused IOMMU_SYS_CACHE_ONLY prot flag and along with it went the memory type setting required for the non-coherent masters to use system cache. Now that system cache support for GPU is added, we will need to mark the

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-23 Thread kernel test robot
Hi "Isaac, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on iommu/next] [also build test WARNING on soc/for-next xlnx/master linus/master v5.10 next-20201223] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patc

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-23 Thread Georgi Djakov
Hi Isaac, On 22.12.20 2:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as this increases the footprint of the io-pgtable code, as well as prevents io-pgtable formats from being built as

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-23 Thread isaacm
On 2020-12-23 05:44, Robin Murphy wrote: On 2020-12-22 19:54, isa...@codeaurora.org wrote: On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not

[RFC PATCH 1/2] dt-bindings: iommu: add bindings for sprd iommu

2020-12-23 Thread Chunyan Zhang
From: Chunyan Zhang This patch only adds bindings to support display iommu, support for others would be added once finished tests with those devices, such as Image codec(jpeg) processor, a few signal processors, including VSP(video), GSP(graphic), ISP(image), and camera CPP, etc. Signed-off-by:

Re: [PATCH v2 1/7] iommu/io-pgtable: Introduce dynamic io-pgtable fmt registration

2020-12-23 Thread Robin Murphy
On 2020-12-22 19:54, isa...@codeaurora.org wrote: On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The io-pgtable code constructs an array of init functions for each page table format at compile time. This is not ideal, as this increases the footprint of

Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

2020-12-23 Thread Robin Murphy
On 2020-12-22 19:49, isa...@codeaurora.org wrote: On 2020-12-22 11:27, Robin Murphy wrote: On 2020-12-22 00:44, Isaac J. Manjarres wrote: The SMMU driver depends on the availability of the ARM LPAE and ARM V7S io-pgtable format code to work properly. In preparation Nit: we don't really

Re: [PATCH v3 6/7] iommu/mediatek: Gather iova in iommu_unmap to achieve tlb sync once

2020-12-23 Thread Robin Murphy
On 2020-12-23 08:56, Tomasz Figa wrote: On Wed, Dec 16, 2020 at 06:36:06PM +0800, Yong Wu wrote: In current iommu_unmap, this code is: iommu_iotlb_gather_init(_gather); ret = __iommu_unmap(domain, iova, size, _gather); iommu_iotlb_sync(domain, _gather); We could gather

Re: [PATCH v2 3/3] iommu/vt-d: Fix ineffective devTLB invalidation for subdevices

2020-12-23 Thread Lu Baolu
Hi Yi, On 2020/12/23 14:27, Liu Yi L wrote: iommu_flush_dev_iotlb() is called to invalidate caches on device. It only loops the devices which are full-attached to the domain. For sub-devices, this is ineffective. This results in invalid caching entries left on the device. Fix it by adding loop

Re: [PATCH v3 6/7] iommu/mediatek: Gather iova in iommu_unmap to achieve tlb sync once

2020-12-23 Thread Tomasz Figa
On Wed, Dec 16, 2020 at 06:36:06PM +0800, Yong Wu wrote: > In current iommu_unmap, this code is: > > iommu_iotlb_gather_init(_gather); > ret = __iommu_unmap(domain, iova, size, _gather); > iommu_iotlb_sync(domain, _gather); > > We could gather the whole iova range in

Re: [PATCH v3 1/7] iommu: Move iotlb_sync_map out from __iommu_map

2020-12-23 Thread Christoph Hellwig
On Wed, Dec 16, 2020 at 06:36:01PM +0800, Yong Wu wrote: > In the end of __iommu_map, It alway call iotlb_sync_map. > This patch moves iotlb_sync_map out from __iommu_map since it is > unnecessary to call this for each sg segment especially iotlb_sync_map > is flush tlb all currently. > >

Re: [PATCH v5 18/27] iommu/mediatek: Add power-domain operation

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:53PM +0800, Yong Wu wrote: > In the previous SoC, the M4U HW is in the EMI power domain which is > always on. the latest M4U is in the display power domain which may be > turned on/off, thus we have to add pm_runtime interface for it. > > When the engine work, the

Re: [PATCH v5 17/27] iommu/mediatek: Add pm runtime callback

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:52PM +0800, Yong Wu wrote: > This patch adds pm runtime callback. > > In pm runtime case, all the registers backup/restore and bclk are > controlled in the pm_runtime callback, then pm_suspend is not needed in > this case. > > runtime PM is disabled when suspend,

Re: [PATCH v5 16/27] iommu/mediatek: Add device link for smi-common and m4u

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:51PM +0800, Yong Wu wrote: > In the lastest SoC, M4U has its special power domain. thus, If the engine > begin to work, it should help enable the power for M4U firstly. > Currently if the engine work, it always enable the power/clocks for > smi-larbs/smi-common. This

Re: [PATCH v5 06/27] dt-bindings: mediatek: Add binding for mt8192 IOMMU

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:41PM +0800, Yong Wu wrote: > This patch adds decriptions for mt8192 IOMMU and SMI. > > mt8192 also is MTK IOMMU gen2 which uses ARM Short-Descriptor translation > table format. The M4U-SMI HW diagram is as below: > > EMI >

Re: [PATCH v5 15/27] iommu/mediatek: Add fail handle for sysfs_add and device_register

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:50PM +0800, Yong Wu wrote: > Add fail handle for iommu_device_sysfs_add and iommu_device_register. > > Fixes: b16c0170b53c ("iommu/mediatek: Make use of iommu_device_register > interface") > Signed-off-by: Yong Wu > --- > drivers/iommu/mtk_iommu.c | 13

Re: [PATCH v5 09/27] iommu/io-pgtable-arm-v7s: Extend PA34 for MediaTek

2020-12-23 Thread Tomasz Figa
On Wed, Dec 09, 2020 at 04:00:44PM +0800, Yong Wu wrote: > MediaTek extend the bit5 in lvl1 and lvl2 descriptor as PA34. > > Signed-off-by: Yong Wu > Acked-by: Will Deacon > Reviewed-by: Robin Murphy > --- > drivers/iommu/io-pgtable-arm-v7s.c | 9 +++-- > drivers/iommu/mtk_iommu.c

Re: [PATCH v5 04/27] dt-bindings: memory: mediatek: Add domain definition

2020-12-23 Thread Tomasz Figa
Hi Yong, On Wed, Dec 09, 2020 at 04:00:39PM +0800, Yong Wu wrote: > In the latest SoC, there are several HW IP require a sepecial iova > range, mainly CCU and VPU has this requirement. Take CCU as a example, > CCU require its iova locate in the range(0x4000_ ~ 0x43ff_). Is this really a