Re: [PATCH v1 3/4] iommu/tegra: gart: Constify number of GART pages

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 11:07:21PM +0300, Dmitry Osipenko wrote: > GART has a fixed aperture size, hence the number of pages is constant. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c | 14 -- > 1 file changed, 8 insertions(+), 6

[PATCH 6/6 v3] arm64: dts: ls208xa: comply with the iommu map binding for fsl_mc

2018-04-27 Thread Nipun Gupta
fsl-mc bus support the new iommu-map property. Comply to this binding for fsl_mc bus. Signed-off-by: Nipun Gupta --- arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH 2/6 v3] iommu: of: make of_pci_map_rid() available for other devices too

2018-04-27 Thread Nipun Gupta
iommu-map property is also used by devices with fsl-mc. This patch moves the of_pci_map_rid to generic location, so that it can be used by other busses too. 'of_pci_map_rid' is renamed here to 'of_map_rid' and there is no functional change done in the API. Signed-off-by: Nipun Gupta

[PATCH 5/6 v3] bus: fsl-mc: supoprt dma configure for devices on fsl-mc bus

2018-04-27 Thread Nipun Gupta
Signed-off-by: Nipun Gupta --- drivers/bus/fsl-mc/fsl-mc-bus.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 5d8266c..624828b 100644 ---

[PATCH 0/6 v3] Support for fsl-mc bus and its devices in SMMU

2018-04-27 Thread Nipun Gupta
This patchset defines IOMMU DT binding for fsl-mc bus and adds support in SMMU for fsl-mc bus. This patch series is dependent on patset: https://patchwork.kernel.org/patch/10317337/ These patches - Define property 'iommu-map' for fsl-mc bus (patch 1) - Integrates the fsl-mc bus with the SMMU

Re: [PATCH v1 2/4] iommu/tegra: gart: Fix gart_iommu_unmap()

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 11:07:20PM +0300, Dmitry Osipenko wrote: > It must return the number of unmapped bytes on success, returning 0 means > that unmapping failed and in result only one page is unmapped. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c |

[PATCH 4/6 v3] iommu: arm-smmu: Add support for the fsl-mc bus

2018-04-27 Thread Nipun Gupta
Implement bus specific support for the fsl-mc bus including registering arm_smmu_ops and bus specific device add operations. Signed-off-by: Nipun Gupta --- drivers/iommu/arm-smmu.c | 7 +++ drivers/iommu/iommu.c| 21 + include/linux/fsl/mc.h |

[PATCH 3/6 v3] iommu: support iommu configuration for fsl-mc devices

2018-04-27 Thread Nipun Gupta
Signed-off-by: Nipun Gupta --- drivers/iommu/of_iommu.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index ea9ecef..3687882 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c

[PATCH 1/6 v3] Docs: dt: add fsl-mc iommu-map device-tree binding

2018-04-27 Thread Nipun Gupta
The existing IOMMU bindings cannot be used to specify the relationship between fsl-mc devices and IOMMUs. This patch adds a generic binding for mapping fsl-mc devices to IOMMUs, using iommu-map property. Signed-off-by: Nipun Gupta ---

Re: [PATCH v1 4/4] iommu/tegra: gart: Optimize map/unmap

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 11:07:22PM +0300, Dmitry Osipenko wrote: > Currently GART writes one page entry at a time. More optimal would be to > aggregate the writes and flush BUS buffer in the end, this gives map/unmap > 10-40% (depending on size of mapping) performance boost compared to a >

Re: [PATCH v1 1/4] iommu/tegra: gart: Add debugging facility

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 11:07:19PM +0300, Dmitry Osipenko wrote: > Page mapping could overwritten by an accident (a bug). We can catch this > case by checking 'VALID' bit of GART's page entry prior to mapping of a > page. Since that check introduces a small performance impact, it should be >

Re: [PATCH v1 4/4] iommu/tegra: gart: Optimize map/unmap

2018-04-27 Thread Dmitry Osipenko
On 27.04.2018 13:02, Thierry Reding wrote: > On Mon, Apr 09, 2018 at 11:07:22PM +0300, Dmitry Osipenko wrote: >> Currently GART writes one page entry at a time. More optimal would be to >> aggregate the writes and flush BUS buffer in the end, this gives map/unmap >> 10-40% (depending on size of

Re: [PATCH v1 4/4] iommu/tegra: gart: Optimize map/unmap

2018-04-27 Thread Robin Murphy
Hi Thierry, On 27/04/18 11:02, Thierry Reding wrote: On Mon, Apr 09, 2018 at 11:07:22PM +0300, Dmitry Osipenko wrote: Currently GART writes one page entry at a time. More optimal would be to aggregate the writes and flush BUS buffer in the end, this gives map/unmap 10-40% (depending on size of

RE: [PATCH v3 1/2] dma-mapping: move dma configuration to bus infrastructure

2018-04-27 Thread Nipun Gupta
> -Original Message- > From: Christoph Hellwig [mailto:h...@lst.de] > Sent: Monday, April 23, 2018 6:27 PM > To: Nipun Gupta > Cc: robin.mur...@arm.com; h...@lst.de; li...@armlinux.org.uk; > gre...@linuxfoundation.org; m.szyprow...@samsung.com; >

Re: [PATCH 1/6 v3] Docs: dt: add fsl-mc iommu-map device-tree binding

2018-04-27 Thread Rob Herring
On Fri, Apr 27, 2018 at 03:57:01PM +0530, Nipun Gupta wrote: > The existing IOMMU bindings cannot be used to specify the relationship > between fsl-mc devices and IOMMUs. This patch adds a generic binding for > mapping fsl-mc devices to IOMMUs, using iommu-map property. > > Signed-off-by: Nipun

Re: [PATCH 2/6 v3] iommu: of: make of_pci_map_rid() available for other devices too

2018-04-27 Thread Rob Herring
On Fri, Apr 27, 2018 at 03:57:02PM +0530, Nipun Gupta wrote: > iommu-map property is also used by devices with fsl-mc. This > patch moves the of_pci_map_rid to generic location, so that it > can be used by other busses too. > > 'of_pci_map_rid' is renamed here to 'of_map_rid' and there is no >

Re: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-27 Thread Jean-Philippe Brucker
On 23/04/18 21:43, Jacob Pan wrote: [...] >> The last name is a bit unfortunate. Since the Arm architecture uses >> the name "context" for what a PASID points to, "Device cache" would >> suit us better but it's not important. >> > or call it device context cache. actually so far context cache is

Re: [PATCH 0/6 v3] Support for fsl-mc bus and its devices in SMMU

2018-04-27 Thread Christoph Hellwig
On Fri, Apr 27, 2018 at 03:57:00PM +0530, Nipun Gupta wrote: > This patchset defines IOMMU DT binding for fsl-mc bus and adds > support in SMMU for fsl-mc bus. > > This patch series is dependent on patset: > https://patchwork.kernel.org/patch/10317337/ Which still needs to be resent against

[PATCH 4/3] dma-debug: remove CONFIG_HAVE_DMA_API_DEBUG

2018-04-27 Thread Christoph Hellwig
There is no arch specific code required for dma-debug, so there is no need to opt into the support either. Signed-off-by: Christoph Hellwig --- .../io/dma-api-debug/arch-support.txt | 31 --- arch/Kconfig | 3 --

RE: [PATCH v4 05/22] iommu: introduce iommu invalidate API function

2018-04-27 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Saturday, April 28, 2018 2:08 AM > > [...] > >> If this corresponds to QI_GRAN_ALL_ALL in patch 9, the comment should > >> be "Cache of all PASIDs"? Or maybe "all entries for all PASIDs"? Is it > >> different from

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

2018-04-27 Thread Nipun Gupta
With each bus implementing its own DMA configuration callback, there is no need for bus to explicitly have force_dma in its global structure. This patch modifies of_dma_configure API to accept an input parameter which specifies if implicit DMA configuration is required even when it is not

[PATCH v4 1/2] dma-mapping: move dma configuration to bus infrastructure

2018-04-27 Thread Nipun Gupta
It is bus specific aspect to map a given device on the bus and relevant firmware description of its DMA configuration. So, this change introduces 'dma_configure' as bus callback giving flexibility to busses for implementing its own dma configuration function. The change eases the addition of new