[PATCH v3 2/2] iommu/arm-smmu: Add support for Adreno GPU pagetable formats

2019-08-07 Thread Jordan Crouse
Add support for an Adreno GPU variant of the arm-smmu device to enable a special pagetable format that enables TTBR1 and leaves TTBR0 free to be switched by the GPU hardware. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-)

[PATCH v3 1/2] iommu/io-pgtable-arm: Add support for ARM_ADRENO_GPU_LPAE io-pgtable format

2019-08-07 Thread Jordan Crouse
Add a new sub-format ARM_ADRENO_GPU_LPAE to set up TTBR0 and TTBR1 for use by the Adreno GPU. This will allow The GPU driver to map global buffers in the TTBR1 and leave the TTBR0 configured but unset and free to be changed dynamically by the GPU. Signed-off-by: Jordan Crouse ---

[PATCH v3 0/2] iommu/arm-smmu: Split pagetable support

2019-08-07 Thread Jordan Crouse
(Sigh, resend. I freaked out my SMTP server) This is part of an ongoing evolution for enabling split pagetable support for arm-smmu. Previous versions can be found [1]. In the discussion for v2 Robin pointed out that this is a very Adreno specific use case and that is exactly true. Not only do

[PATCH v3 1/2] iommu/io-pgtable-arm: Add support for ARM_ADRENO_GPU_LPAE io-pgtable format

2019-08-07 Thread Jordan Crouse
Add a new sub-format ARM_ADRENO_GPU_LPAE to set up TTBR0 and TTBR1 for use by the Adreno GPU. This will allow The GPU driver to map global buffers in the TTBR1 and leave the TTBR0 configured but unset and free to be changed dynamically by the GPU. Signed-off-by: Jordan Crouse ---

[PATCH v3 0/2] iommu/arm-smmu: Split pagetable support

2019-08-07 Thread Jordan Crouse
This is part of an ongoing evolution for enabling split pagetable support for arm-smmu. Previous versions can be found [1]. In the discussion for v2 Robin pointed out that this is a very Adreno specific use case and that is exactly true. Not only do we want to configure and use a pagetable in the

Re: Regression due to d98849aff879 (dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code)

2019-08-07 Thread Lucas Stach
Am Dienstag, den 06.08.2019, 17:44 +0200 schrieb Christoph Hellwig: > On Tue, Aug 06, 2019 at 04:06:58PM +0200, Lucas Stach wrote: > > > > dma_direct_free_pages() then needs the same check, as otherwise the cpu > > address is treated as a cookie instead of a real address and the > > encryption

Re: [RFC,v3 7/9] media: platform: Add Mediatek ISP P1 device driver

2019-08-07 Thread Tomasz Figa
On Wed, Aug 7, 2019 at 11:11 AM Jungo Lin wrote: > > Hi, Tomasz: > > On Tue, 2019-08-06 at 18:47 +0900, Tomasz Figa wrote: > > Hi Jungo, > > > > On Fri, Jul 26, 2019 at 4:24 PM Jungo Lin wrote: > > > > > > Hi, Tomasz: > > > > > > On Thu, 2019-07-25 at 18:23 +0900, Tomasz Figa wrote: > > > > .Hi

Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*

2019-08-07 Thread Shawn Anastasio via iommu
On 8/7/19 8:04 AM, Christoph Hellwig wrote: Actually it is typical modern Linux style to just provide a prototype and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it. I see. Also, like Will mentioned earlier, the function name isn't entirely accurate anymore. I second the

Re: [PATCH v3 hmm 10/11] drm/amdkfd: use mmu_notifier_put

2019-08-07 Thread Jason Gunthorpe
On Tue, Aug 06, 2019 at 11:47:44PM +, Kuehling, Felix wrote: > On 2019-08-06 19:15, Jason Gunthorpe wrote: > > From: Jason Gunthorpe > > > > The sequence of mmu_notifier_unregister_no_release(), > > mmu_notifier_call_srcu() is identical to mmu_notifier_put() with the > > free_notifier

[PATCH 6/8] iommu/omap: introduce new API for runtime suspend/resume control

2019-08-07 Thread Tero Kristo via iommu
From: Suman Anna This patch adds the support for the OMAP IOMMUs to be suspended during the auto suspend/resume of the OMAP remoteproc devices. The remote processors are auto suspended after a certain time of idle or inactivity period. This is done by introducing two new API,

[PATCH 8/8] iommu/omap: remove pm_runtime_irq_safe flag for OMAP IOMMUs

2019-08-07 Thread Tero Kristo via iommu
This is not needed for anything, and prevents proper PM transitions for parent devices which is bad in case of ti-sysc; this effectively kills PM completely. Thus, remove the flag. Signed-off-by: Tero Kristo --- drivers/iommu/omap-iommu.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH 7/8] iommu/omap: add support for late attachment of iommu devices

2019-08-07 Thread Tero Kristo via iommu
Current implementation of OMAP IOMMU enforces strict ordering of device probe, initiated by iommu and followed by remoteproc later. This doesn't work too well with the new setup done with ti-sysc changes which may have the devices probed at pretty much any order. To overcome this limitation, if

[PATCH 3/8] iommu/omap: streamline enable/disable through runtime pm callbacks

2019-08-07 Thread Tero Kristo via iommu
From: Suman Anna The OMAP IOMMU devices are typically present within the respective client processor subsystem and have their own dedicated hard-reset line. Enabling an IOMMU requires the reset line to be deasserted and the clocks to be enabled before programming the necessary IOMMU registers.

[PATCH 1/8] iommu/omap: fix boot issue on remoteprocs with AMMU/Unicache

2019-08-07 Thread Tero Kristo via iommu
From: Suman Anna Support has been added to the OMAP IOMMU driver to fix a boot hang issue on OMAP remoteprocs with AMMU/Unicache, caused by an improper AMMU/Unicache state upon initial deassertion of the processor reset. The issue is described in detail in the next three paragraphs. All the

[PATCH 0/8] iommu/omap: misc fixes

2019-08-07 Thread Tero Kristo via iommu
Hi Joerg, Here are a few fixes for OMAP IOMMU. These are mostly towards getting runtime PM support functional again for the IOMMU. -Tero -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

[PATCH 5/8] iommu/omap: Add system suspend/resume support

2019-08-07 Thread Tero Kristo via iommu
From: Suman Anna The MMU registers for the remote processors lose their context in Open Switch Retention (OSWR) or device OFF modes. Hence, the context of the IOMMU needs to be saved before it is put into any of these lower power state (OSWR/OFF) and restored before it is powered up to ON again.

[PATCH 4/8] iommu/omap: add logic to save/restore locked TLBs

2019-08-07 Thread Tero Kristo via iommu
From: Suman Anna The MMUs provide a mechanism to lock TLB entries to avoid eviction and fetching of frequently used page table entries. These TLBs lose context when the MMUs are turned OFF. Add the logic to save and restore these locked TLBS during suspend and resume respectively. There are no

fix default dma_mmap_* pgprot v3

2019-08-07 Thread Christoph Hellwig
Hi all, As Shawn pointed out we've had issues with the dma mmap pgprots ever since the dma_common_mmap helper was added beyong the initial architectures - we default to uncached mappings, but for devices that are DMA coherent, or if the DMA_ATTR_NON_CONSISTENT is set (and supported) this can lead

[PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*

2019-08-07 Thread Christoph Hellwig
All the way back to introducing dma_common_mmap we've defaulted to mark the pages as uncached. But this is wrong for DMA coherent devices. Later on DMA_ATTR_WRITE_COMBINE also got incorrect treatment as that flag is only treated special on the alloc side for non-coherent devices. Introduce a new

[PATCH 2/2] MIPS: remove support for DMA_ATTR_WRITE_COMBINE

2019-08-07 Thread Christoph Hellwig
Mips uses the KSEG1 kernel memory segment to map dma coherent allocations for non-coherent devices as uncacheable, and does not have any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation path. Thus supporting DMA_ATTR_WRITE_COMBINE in dma_mmap_attrs will lead to multiple

Re: [PATCH] dma-mapping: fix page attributes for dma_mmap_*

2019-08-07 Thread Christoph Hellwig
On Tue, Aug 06, 2019 at 05:45:03PM +0100, Russell King - ARM Linux admin wrote: > We could have used a different approach, making all IO writes contain > a "drain write buffer" instruction, and map DMA memory as "buffered", > but as there were no Linux barriers defined to order memory accesses >

Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*

2019-08-07 Thread Christoph Hellwig
On Tue, Aug 06, 2019 at 09:39:06PM +0200, Shawn Anastasio wrote: >> -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT >> pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot, >> unsigned long attrs); >> -#else >> -# define arch_dma_mmap_pgprot(dev, prot, attrs)