Re: use generic DMA mapping code in powerpc V4

2019-01-02 Thread Christoph Hellwig
Hi Christian, happy new year and I hope you had a few restful deays off. I've pushed a new tree to: git://git.infradead.org/users/hch/misc.git powerpc-dma.6 Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/powerpc-dma.6 Which has been rebased to the latests Linus

Re: [PATCH 02/15] swiotlb: remove dma_mark_clean

2019-01-02 Thread Christoph Hellwig
On Wed, Jan 02, 2019 at 01:53:33PM -0800, Tony Luck wrote: > On Fri, Dec 7, 2018 at 11:08 AM Christoph Hellwig wrote: > > > > Instead of providing a special dma_mark_clean hook just for ia64, switch > > ia64 to use the normal arch_sync_dma_for_cpu hooks instead. > > > > This means that we now also

Re: [PATCH 02/15] swiotlb: remove dma_mark_clean

2019-01-02 Thread Tony Luck
On Fri, Dec 7, 2018 at 11:08 AM Christoph Hellwig wrote: > > Instead of providing a special dma_mark_clean hook just for ia64, switch > ia64 to use the normal arch_sync_dma_for_cpu hooks instead. > > This means that we now also set the PG_arch_1 bit for pages in the > swiotlb buffer, which isn't s

Re: [PATCH 1/1] iova: Allow compiling the library without IOMMU support

2019-01-02 Thread Laurent Pinchart
Hi Sakari, Thank you for the patch. On Wednesday, 2 January 2019 23:16:57 EET Sakari Ailus wrote: > Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage > the device's own virtual address space while not implementing the IOMMU > API. Why is that ? Could the IPU3 IOMMU be imp

[PATCH 1/1] iova: Allow compiling the library without IOMMU support

2019-01-02 Thread Sakari Ailus
Drivers such as the Intel IPU3 ImgU driver use the IOVA library to manage the device's own virtual address space while not implementing the IOMMU API. Currently the IOVA library is only compiled if the IOMMU support is enabled, resulting into a failure during linking due to missing symbols. Fix th

Re: [RFC v2] iommu/vt-d: Allow iommu_domain_alloc to allocate IOMMU_DOMAIN_DMA

2019-01-02 Thread James Sewart via iommu
Bump > On 5 Dec 2018, at 17:19, James Sewart wrote: > > Hey, > > There exists an issue in the logic used to determine domain association > with devices. Currently the driver uses find_or_alloc_domain to either > reuse an existing domain or allocate a new one if one isn’t found. Domains > sho

Re: iommu_intel or i915 regression in 4.18, 4.19.12 and drm-tip

2019-01-02 Thread Joonas Lahtinen
Quoting Eric Wong (2018-12-27 13:49:48) > I just got a used Thinkpad X201 (Core i5 M 520, Intel QM57 > chipset) and hit some kernel panics while trying to view > image/animation-intensive stuff in Firefox (X11) unless I use > "iommu_intel=igfx_off". > > With Debian stable backport kernels, "linux-

Re: [PATCH v5 09/20] iommu/mediatek: Refine protect memory definition

2019-01-02 Thread Yong Wu
On Wed, 2019-01-02 at 14:23 +0800, Nicolas Boichat wrote: > On Tue, Jan 1, 2019 at 11:58 AM Yong Wu wrote: > > > > The protect memory setting is a little different in the different SoCs. > > In the register REG_MMU_CTRL_REG(0x110), the TF_PROT(translation fault > > protect) shift bit is normally 4

Re: [PATCH v5 18/20] iommu/mediatek: Fix VLD_PA_RANGE register backup when suspend

2019-01-02 Thread Yong Wu
On Wed, 2019-01-02 at 14:54 +0800, Nicolas Boichat wrote: > On Tue, Jan 1, 2019 at 11:59 AM Yong Wu wrote: > > > > The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB > > mode support for mt2712. this patch add it. > > > > Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate

Re: [PATCH v5 11/20] iommu/mediatek: Move vld_pa_rng into plat_data

2019-01-02 Thread Yong Wu
On Wed, 2019-01-02 at 14:45 +0800, Nicolas Boichat wrote: > On Tue, Jan 1, 2019 at 11:58 AM Yong Wu wrote: > > > > Both mt8173 and mt8183 don't have this vld_pa_rng(valid physical address > > range) register while mt2712 have. Move it into the plat_data. > > > > Signed-off-by: Yong Wu > > --- > >

[PATCH 5/5] dma-mapping: remove a few unused exports

2019-01-02 Thread Christoph Hellwig
Now that the slow path DMA API calls are implemented out of line a few helpers only used by them don't need to be exported anymore. Signed-off-by: Christoph Hellwig --- kernel/dma/coherent.c | 2 -- kernel/dma/debug.c| 2 -- 2 files changed, 4 deletions(-) diff --git a/kernel/dma/coherent.c

various DMA mapping fixes for 4.21-rc1

2019-01-02 Thread Christoph Hellwig
Hi all, this series fixes up some fallout from the changes in this merge window. Patch 1 ensures dma-debug works correctly with the merge map_page / map_single implementation, patch 4 makes sure the DMA API calls are properly stubbed out for COMPILE_TEST builds on UML. Patches 2 and 3 make patch

[PATCH 3/5] dma-mapping: remove dmam_{declare, release}_coherent_memory

2019-01-02 Thread Christoph Hellwig
These functions have never been used. Signed-off-by: Christoph Hellwig --- Documentation/driver-model/devres.txt | 1 - include/linux/dma-mapping.h | 19 - kernel/dma/mapping.c | 55 --- 3 files changed, 75 deletions(-) diff --git a/Do

[PATCH 1/5] dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs

2019-01-02 Thread Christoph Hellwig
And also switch the way we implement the unmap side around to stay consistent. This ensures dma-debug works again because it records which function we used for mapping to ensure it is also used for unmapping, and also reduces further code duplication. Last but not least this also officially allow

[PATCH 2/5] dma-mapping: implement dmam_alloc_coherent using dmam_alloc_attrs

2019-01-02 Thread Christoph Hellwig
dmam_alloc_coherent is just the default no-flags case of dmam_alloc_attrs, so take advantage of this similar to the non-managed version. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 20 --- kernel/dma/mapping.c| 39 ---

[PATCH 4/5] dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA

2019-01-02 Thread Christoph Hellwig
This avoids link failures in drivers using the DMA API, when they are compiled for user mode Linux with CONFIG_COMPILE_TEST=y. Fixes: 356da6d0cd ("dma-mapping: bypass indirect calls for dma-direct") Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 255 +++---