Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-17 Thread Kenneth Lee
On Mon, Sep 17, 2018 at 08:37:45AM -0400, Jerome Glisse wrote: > Date: Mon, 17 Sep 2018 08:37:45 -0400 > From: Jerome Glisse > To: Kenneth Lee > CC: Kenneth Lee , Herbert Xu > , k...@vger.kernel.org, Jonathan Corbet > , Greg Kroah-Hartman , Joerg > Roedel , linux-...@vger.kernel.org, Sanjay Ku

Re: [PATCH v16 2/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device

2018-09-17 Thread Vivek Gautam
Hi Robin, On Fri, Sep 7, 2018 at 3:52 PM Vivek Gautam wrote: > > On Fri, Sep 7, 2018 at 3:22 PM Tomasz Figa wrote: > > > > On Fri, Sep 7, 2018 at 6:38 PM Vivek Gautam > > wrote: > > > > > > Hi Tomasz, > > > > > > > > > On 9/7/2018 2:46 PM, Tomasz Figa wrote: > > > > Hi Vivek, > > > > > > > > O

Explicit IOVA management from a PCIe endpoint driver

2018-09-17 Thread Stephen Warren
Joerg, Christoph, Marek, Robin, I believe that the driver for our PCIe endpoint controller hardware will need to explicitly manage its IOVA space more than current APIs allow. I'd like to discuss how to make that possible. First some background on our hardware: NVIDIA's Xavier SoC contains a

Re: [PATCH v5 13/23] iommu: introduce device fault report API

2018-09-17 Thread Jacob Pan
On Fri, 14 Sep 2018 15:24:41 +0200 Auger Eric wrote: > Hi Jacob, > > On 5/11/18 10:54 PM, Jacob Pan wrote: > > Traditionally, device specific faults are detected and handled > > within their own device drivers. When IOMMU is enabled, faults such > > as DMA related transactions are detected by IO

[PATCH 8/9] swiotlb: add support for non-coherent DMA

2018-09-17 Thread Christoph Hellwig
Handle architectures that are not cache coherent directly in the main swiotlb code. This involves two related changes: - call arch_sync_dma_for_{device,cpu} in all the right places from the various dma_map/unmap/sync methods when the device is non-coherent - call arch_dma_{alloc,free} for de

[PATCH 9/9] arm64: use the generic swiotlb_dma_ops

2018-09-17 Thread Christoph Hellwig
Now that the generic swiotlb code supports non-coherent DMA we can switch to it for arm64. For that we need to refactor the existing alloc/free/mmap/pgprot helpers to be used as the architecture hooks, and implement the standard arch_sync_dma_for_{device,cpu} hooks for cache maintaincance in the s

[PATCH 6/9] swiotlb: use swiotlb_map_page in swiotlb_map_sg_attrs

2018-09-17 Thread Christoph Hellwig
No need to duplicate the code - map_sg is equivalent to map_page for each page in the scatterlist. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/

[PATCH 7/9] swiotlb: refactor swiotlb_map_page

2018-09-17 Thread Christoph Hellwig
Remove the somewhat useless map_single function, and replace it with a swiotlb_bounce_page handler that handles everything related to actually bouncing a page. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 77 +--- 1 file changed, 36 insertio

[PATCH 5/9] swiotlb: merge swiotlb_unmap_page and unmap_single

2018-09-17 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 11dbcd80b4a6..15335f3a1bf3 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -765,9 +765,9

[PATCH 4/9] swiotlb: remove the overflow buffer

2018-09-17 Thread Christoph Hellwig
Like all other dma mapping drivers just return an error code instead of an actual memory buffer. The reason for the overflow buffer was that at the time swiotlb was invented there was no way to check for dma mapping errors, but this has long been fixed. Signed-off-by: Christoph Hellwig --- arch

[PATCH 3/9] swiotlb: do not panic on mapping failures

2018-09-17 Thread Christoph Hellwig
All properly written drivers now have error handling in the dma_map_single / dma_map_page callers. As swiotlb_tbl_map_single already prints a useful warning when running out of swiotlb pool swace we can also remove swiotlb_full entirely as it serves no purpose now. Signed-off-by: Christoph Hellwi

[PATCH 1/9] swiotlb: remove a pointless comment

2018-09-17 Thread Christoph Hellwig
This comments describes an aspect of the map_sg interface that isn't even exploited by swiotlb. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 4f8a6dbf0b60..9062b14bc7f4 100644 -

[PATCH 2/9] swiotlb: mark is_swiotlb_buffer static

2018-09-17 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/swiotlb.h | 1 - kernel/dma/swiotlb.c| 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 965be92c33b5..7ef541ce8f34 100644 --- a/include/linux/swiotlb.h +++ b/include/l

move swiotlb noncoherent dma support from arm64 to generic code

2018-09-17 Thread Christoph Hellwig
Hi all, this series starts with various swiotlb cleanups, then adds support for non-cache coherent devices to the generic swiotlb support, and finally switches arm64 to use the generic code. Given that this series depends on patches in the dma-mapping tree, or pending for it I've also published a

Re: [PATCH v2 0/3] iommu: Avoid DMA ops domain refcount contention

2018-09-17 Thread Christoph Hellwig
On Fri, Sep 14, 2018 at 01:48:59PM +0100, Will Deacon wrote: > > As far as merging goes, I don't mind at all whether this goes via IOMMU, > > or via dma-mapping provided Joerg's happy to ack it. > > I think it makes most sense for Joerg to take this series via his tree. FYI, I have WIP patches to

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-17 Thread Jerome Glisse
On Mon, Sep 17, 2018 at 04:39:40PM +0800, Kenneth Lee wrote: > On Sun, Sep 16, 2018 at 09:42:44PM -0400, Jerome Glisse wrote: > > So i want to summarize issues i have as this threads have dig deep into > > details. For this i would like to differentiate two cases first the easy > > one when relying

Re: [PATCH v2 0/3] iommu: Avoid DMA ops domain refcount contention

2018-09-17 Thread John Garry
On 14/09/2018 13:48, Will Deacon wrote: Hi Robin, Hi Robin, I just spoke with Dongdong and we will test this version also so that we may provide a "Tested-by" tag. Thanks, John On Wed, Sep 12, 2018 at 04:24:11PM +0100, Robin Murphy wrote: John raised the issue[1] that we have some unnec

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-17 Thread Kenneth Lee
On Sun, Sep 16, 2018 at 09:42:44PM -0400, Jerome Glisse wrote: > Date: Sun, 16 Sep 2018 21:42:44 -0400 > From: Jerome Glisse > To: Kenneth Lee > CC: Jonathan Corbet , Herbert Xu > , "David S . Miller" , > Joerg Roedel , Alex Williamson > , Kenneth Lee , Hao > Fang , Zhou Wang , Zaibo Xu > ,

[PATCH] kernel/dma: Fix panic caused by passing cma to command line

2018-09-17 Thread zhe.he
From: He Zhe early_cma does not check input argument before passing it to simple_strtoull. The argument would be a NULL pointer if "cma", without its value, is set in command line and thus causes the following panic. PANIC: early exception 0xe3 IP 10:a3e9db8d error 0 cr2 0x0 [0.0

[PATCH] kernel/dma: Fix panic caused by passing swiotlb to command line

2018-09-17 Thread zhe.he
From: He Zhe setup_io_tlb_npages does not check input argument before passing it to isdigit. The argument would be a NULL pointer if "swiotlb", without its value, is set in command line and thus causes the following panic. PANIC: early exception 0xe3 IP 10:bb9b8e9f error 0 cr2 0x0 [0

Re: [PATCH v2] drivers/vfio: Allow type-1 IOMMU instantiation with all ARM/ARM64 IOMMUs

2018-09-17 Thread Simon Horman
On Thu, Sep 13, 2018 at 03:15:29PM +0200, Geert Uytterhoeven wrote: > Currently the type-1 IOMMU instantiation depends on "ARM_SMMU || > ARM_SMMU_V3", while it applies to other ARM/ARM64 platforms with an > IOMMU (e.g. Renesas VMSA-compatible IPMMUs). > > Instead of extending the list of IOMMU typ