Re: [PATCH] swiotlb: swiotlb_{alloc,free}_buffer should depend on CONFIG_DMA_DIRECT_OPS

2018-03-23 Thread Thomas Gleixner
On Fri, 23 Mar 2018, Konrad Rzeszutek Wilk wrote: > On Fri, Mar 23, 2018 at 06:49:30PM +0100, Christoph Hellwig wrote: > > Otherwise we might get unused symbol warnings for configs that built > > swiotlb.c only for use by xen-swiotlb.c and that don't otherwise select > > CONFIG_DMA_DIRECT_OPS,

Re: [PATCH] swiotlb: swiotlb_{alloc,free}_buffer should depend on CONFIG_DMA_DIRECT_OPS

2018-03-23 Thread Konrad Rzeszutek Wilk
On Fri, Mar 23, 2018 at 06:49:30PM +0100, Christoph Hellwig wrote: > Otherwise we might get unused symbol warnings for configs that built > swiotlb.c only for use by xen-swiotlb.c and that don't otherwise select > CONFIG_DMA_DIRECT_OPS, which is possible on arm. > > Fixes: 16e73adbca76

[PATCH] swiotlb: swiotlb_{alloc, free}_buffer should depend on CONFIG_DMA_DIRECT_OPS

2018-03-23 Thread Christoph Hellwig
Otherwise we might get unused symbol warnings for configs that built swiotlb.c only for use by xen-swiotlb.c and that don't otherwise select CONFIG_DMA_DIRECT_OPS, which is possible on arm. Fixes: 16e73adbca76 ("dma/swiotlb: Remove swiotlb_{alloc,free}_coherent()") Reported-by: Stephen Rothwell

Re: [PATCH v2 2/2] drivers: remove force dma flag from buses

2018-03-23 Thread kbuild test robot
Hi Nipun, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.16-rc6 next-20180323] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v2 2/2] drivers: remove force dma flag from buses

2018-03-23 Thread kbuild test robot
Hi Nipun, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.16-rc6 next-20180323] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH 2/4] iommu/virtio: Add probe request

2018-03-23 Thread Robin Murphy
On 14/02/18 14:53, Jean-Philippe Brucker wrote: When the device offers the probe feature, send a probe request for each device managed by the IOMMU. Extract RESV_MEM information. When we encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region. This will tell other subsystems that

Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-23 Thread Robin Murphy
On 14/02/18 14:53, Jean-Philippe Brucker wrote: The virtio IOMMU is a para-virtualized device, allowing to send IOMMU requests such as map/unmap over virtio-mmio transport without emulating page tables. This implementation handles ATTACH, DETACH, MAP and UNMAP requests. The bulk of the code

RE: [PATCH v5 7/7] iommu/dma: Move PCI window region reservation back into dma specific path.

2018-03-23 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Thursday, March 22, 2018 5:22 PM > To: Alex Williamson ; Shameerali Kolothum > Thodi > Cc: eric.au...@redhat.com; pmo...@linux.vnet.ibm.com;

RE: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-23 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, March 22, 2018 6:06 PM > > > From: Robin Murphy [mailto:robin.mur...@arm.com] > > Sent: Wednesday, March 21, 2018 10:24 PM > > > > On 21/03/18 13:14, Jean-Philippe Brucker wrote: > > > On 21/03/18 06:43, Tian, Kevin wrote: > > > [...] > > >>> + > > >>>

Re: [PATCH v4 11/22] driver core: add per device iommu param

2018-03-23 Thread Greg Kroah-Hartman
On Thu, Mar 22, 2018 at 08:12:03PM -0700, Jacob Pan wrote: > DMA faults can be detected by IOMMU at device level. Adding a pointer > to struct device allows IOMMU subsystem to report relevant faults > back to the device driver for further handling. > For direct assigned device (or user space

[PATCH v8 13/14] iommu/rockchip: Add runtime PM support

2018-03-23 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to enable and disable IOMMU. Signed-off-by: Jeffy Chen

[PATCH v8 10/14] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-03-23 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy ---

[PATCH v8 14/14] iommu/rockchip: Support sharing IOMMU between masters

2018-03-23 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v8: None Changes in v7: Use iommu_group_ref_get to

[PATCH v8 09/14] dt-bindings: iommu/rockchip: Add clock property

2018-03-23 Thread Jeffy Chen
Add clock property, since we are going to control clocks in rockchip iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None

[PATCH v8 12/14] iommu/rockchip: Fix error handling in init

2018-03-23 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy --- Changes in v8: None Changes in v7: None Changes

[PATCH v8 11/14] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-03-23 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v8: None

[PATCH v8 05/14] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-03-23 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen

[PATCH v8 08/14] iommu/rockchip: Control clocks needed to access the IOMMU

2018-03-23 Thread Jeffy Chen
From: Tomasz Figa Current code relies on master driver enabling necessary clocks before IOMMU is accessed, however there are cases when the IOMMU should be accessed while the master is not running yet, for example allocating V4L2 videobuf2 buffers, which is done by the VB2

[PATCH v8 06/14] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-03-23 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen

[PATCH v8 04/14] iommu/rockchip: Fix error handling in attach

2018-03-23 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa

[PATCH v8 03/14] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-03-23 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen Acked-by: Robin Murphy --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in

[PATCH v8 02/14] iommu/rockchip: Fix error handling in probe

2018-03-23 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Acked-by: Robin Murphy --- Changes in v8: Don't introduce the additional return. Changes in v7: None Changes in v6:

[PATCH v8 01/14] iommu/rockchip: Prohibit unbind and remove

2018-03-23 Thread Jeffy Chen
Removal of IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Acked-by: Robin Murphy --- Changes in v8: Rebase on newest for-next. Changes in v7: None

[PATCH v8 00/14] iommu/rockchip: Use OF_IOMMU

2018-03-23 Thread Jeffy Chen
This series fixes some issues in rockchip iommu driver, and add of_iommu support in it. Changes in v8: Rebase on newest for-next. Don't introduce the additional return. Rename startup()/shutdown() to enable()/disable(). Do runtime PM suspend in .shutdown(). Modify