Re: [PATCH 1/3] hexagon: remove the sync_single_for_cpu DMA operation

2018-08-06 Thread Christoph Hellwig
On Tue, Jul 31, 2018 at 05:22:29PM +0200, Christoph Hellwig wrote: > On Wed, Jul 25, 2018 at 06:39:27AM +0200, Christoph Hellwig wrote: > > On Tue, Jul 24, 2018 at 10:29:48PM -0500, Richard Kuo wrote: > > > Patch series looks good. Definitely appreciate the cleanup. > > > > > > I can take it thro

Re: [RFC PATCH 3/7] vfio: add spimdev support

2018-08-06 Thread Alex Williamson
On Mon, 6 Aug 2018 09:34:28 -0700 "Raj, Ashok" wrote: > On Mon, Aug 06, 2018 at 09:49:40AM -0600, Alex Williamson wrote: > > On Mon, 6 Aug 2018 09:40:04 +0800 > > Kenneth Lee wrote: > > > > > > 1. It supports thousands of processes. Take zip accelerator as an > > > example, any > > > applica

Re: [RFC PATCH 3/7] vfio: add spimdev support

2018-08-06 Thread Raj, Ashok
On Mon, Aug 06, 2018 at 09:49:40AM -0600, Alex Williamson wrote: > On Mon, 6 Aug 2018 09:40:04 +0800 > Kenneth Lee wrote: > > > > 1. It supports thousands of processes. Take zip accelerator as an example, > > any > > application need data compression/decompression will need to interact with > >

Re: [RFC PATCH 3/7] vfio: add spimdev support

2018-08-06 Thread Alex Williamson
On Mon, 6 Aug 2018 09:40:04 +0800 Kenneth Lee wrote: > On Thu, Aug 02, 2018 at 12:43:27PM -0600, Alex Williamson wrote: > > Date: Thu, 2 Aug 2018 12:43:27 -0600 > > From: Alex Williamson > > To: Cornelia Huck > > CC: Kenneth Lee , "Tian, Kevin" > > , Kenneth Lee , Jonathan Corbet > > , Herber

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

2018-08-06 Thread Jerome Glisse
On Mon, Aug 06, 2018 at 11:12:52AM +0800, Kenneth Lee wrote: > On Fri, Aug 03, 2018 at 10:39:44AM -0400, Jerome Glisse wrote: > > On Fri, Aug 03, 2018 at 11:47:21AM +0800, Kenneth Lee wrote: > > > On Thu, Aug 02, 2018 at 10:22:43AM -0400, Jerome Glisse wrote: > > > > On Thu, Aug 02, 2018 at 12:05:5

[PATCH] iommu/omap: Fix cache flushes on L2 table entries

2018-08-06 Thread Ralf Goebel
The base address used for DMA operations on the second-level table did incorrectly include the offset for the table entry. The offset was then added again which lead to incorrect behavior. Operations on the L1 table are not affected. The calculation of the base address is changed to point to the

Re: [PATCH] iommu/rockchip: Handle errors returned from PM framework

2018-08-06 Thread Heiko Stuebner
Hi Marc, Am Sonntag, 5. August 2018, 14:46:16 CEST schrieb Marc Zyngier: > pm_runtime_get_if_in_use can fail: either PM has been disabled > altogether (-EINVAL), or the device hasn't been enabled yet (0). > Sadly, we ignore the first case at the moment, and end up treating > it as if we had receiv

Re: [PATCH] iommu/rockchip: Handle errors returned from PM framework

2018-08-06 Thread Marc Zyngier
Hi Heiko, On 06/08/18 13:09, Heiko Stuebner wrote: > Hi Marc, > > Am Sonntag, 5. August 2018, 14:46:16 CEST schrieb Marc Zyngier: >> pm_runtime_get_if_in_use can fail: either PM has been disabled >> altogether (-EINVAL), or the device hasn't been enabled yet (0). >> Sadly, we ignore the first cas

[PATCH 1/1] iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout

2018-08-06 Thread Zhen Lei
The condition "(int)(VAL - sync_idx) >= 0" to break loop in function __arm_smmu_sync_poll_msi requires that sync_idx must be increased monotonously according to the sequence of the CMDs in the cmdq. But ".msidata = atomic_inc_return_relaxed(&smmu->sync_nr)" is not protected by spinlock, so the fol

[PATCH v4 3/5] iommu/io-pgtable-arm: add support for non-strict mode

2018-08-06 Thread Zhen Lei
To support the non-strict mode, now we only tlbi and sync for the strict mode. But for the non-leaf case, always follow strict mode. Signed-off-by: Zhen Lei --- drivers/iommu/io-pgtable-arm.c | 27 ++- drivers/iommu/io-pgtable.h | 3 +++ 2 files changed, 21 insertion

[PATCH v4 5/5] iommu/arm-smmu-v3: add bootup option "arm_iommu"

2018-08-06 Thread Zhen Lei
Add a bootup option to make the system manager can choose which mode to be used. The default mode is strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 9 + drivers/iommu/arm-smmu-v3.c | 17 - 2 files changed, 25 ins

[PATCH v4 4/5] iommu/arm-smmu-v3: add support for non-strict mode

2018-08-06 Thread Zhen Lei
Dynamically choose strict or non-strict mode for page table config based on the iommu domain type. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 2f1

[PATCH v4 2/5] iommu/dma: add support for non-strict mode

2018-08-06 Thread Zhen Lei
1. Save the related domain pointer in struct iommu_dma_cookie, make iovad capable call domain->ops->flush_iotlb_all to flush TLB. 2. During the iommu domain initialization phase, base on domain->non_strict field to check whether non-strict mode is supported or not. If so, call init_iova_fl

[PATCH v4 1/5] iommu/arm-smmu-v3: fix the implementation of flush_iotlb_all hook

2018-08-06 Thread Zhen Lei
.flush_iotlb_all can not just wait for previous tlbi operations to be completed, but should also invalid all TLBs of the related domain. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-v3.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-v3

[PATCH v4 0/5] add non-strict mode support for arm-smmu-v3

2018-08-06 Thread Zhen Lei
v3 -> v4: 1. Add a new member "non_strict" in struct iommu_domain to mark whether that domain use non-strict mode or not. This can help us to remove the capability which was added in prior version. 2. Add a new quirk IO_PGTABLE_QUIRK_NON_STRICT, so that we can get "strict mode" in io-pgtab

Re: [RFC PATCH 1/7] vfio/spimdev: Add documents for WarpDrive framework

2018-08-06 Thread Pavel Machek
Hi! > WarpDrive is a common user space accelerator framework. Its main component > in Kernel is called spimdev, Share Parent IOMMU Mediated Device. It exposes spimdev is really unfortunate name. It looks like it has something to do with SPI, but it does not. > +++ b/Documentation/warpdrive/war

Re: [PATCH v2 0/7] Stop losing firmware-set DMA masks

2018-08-06 Thread Arnd Bergmann
On Mon, Aug 6, 2018 at 2:08 PM Christoph Hellwig wrote: > > On Mon, Aug 06, 2018 at 12:01:34PM +0200, Arnd Bergmann wrote: > > There are a few subtle corner cases here, in particular in which cases > > the new dma_set_mask() behavior on arm64 reports success or > > failure when truncating the mask

Re: [PATCH v2 0/7] Stop losing firmware-set DMA masks

2018-08-06 Thread Christoph Hellwig
On Mon, Aug 06, 2018 at 12:01:34PM +0200, Arnd Bergmann wrote: > There are a few subtle corner cases here, in particular in which cases > the new dma_set_mask() behavior on arm64 reports success or > failure when truncating the mask to the bus_dma_mask. Going forward my plan was to make dma_set_ma

Re: [PATCH v2 0/7] Stop losing firmware-set DMA masks

2018-08-06 Thread Arnd Bergmann
On Tue, Jul 31, 2018 at 1:30 PM Robin Murphy wrote: > On 29/07/18 13:32, Arnd Bergmann wrote: > > On Tue, Jul 24, 2018 at 12:16 AM, Robin Murphy wrote: > > Thanks a lot for working on this, this has bugged me for many years, > > and I've discussed possible solutions with lots of people over time