Re: [RFC PATCH v2 08/10] vfio/type1: Add domain at(de)taching group helpers

2018-09-11 Thread Lu Baolu
Hi, On 09/11/2018 12:23 AM, Jean-Philippe Brucker wrote: On 30/08/2018 05:09, Lu Baolu wrote: +static int vfio_detach_aux_domain(struct device *dev, void *data) +{ + struct iommu_domain *domain = data; + + vfio_mdev_set_aux_domain(dev, NULL); + iommu_detach_device(domain, dev-

Re: [RFC PATCH v2 00/10] vfio/mdev: IOMMU aware mediated device

2018-09-11 Thread Lu Baolu
Hi, On 09/11/2018 12:22 AM, Jean-Philippe Brucker wrote: Hi, On 30/08/2018 05:09, Lu Baolu wrote: Below APIs are introduced in the IOMMU glue for device drivers to use the finer granularity translation. * iommu_capable(IOMMU_CAP_AUX_DOMAIN) - Represents the ability for supporting multiple

[PATCH v8 5/6] iommu/vt-d: Add debugfs support for Interrupt remapping

2018-09-11 Thread Sohil Mehta
Debugfs extension for Intel IOMMU to dump Interrupt remapping table entries for Interrupt remapping and Interrupt posting. The file /sys/kernel/debug/iommu/intel/ir_translation_struct provides detailed information, such as Index, Source Id, Destination Id, Vector and the IRTE values for entries wi

[PATCH v8 6/6] iommu/vt-d: Add debugfs support to show context internals

2018-09-11 Thread Sohil Mehta
Export Intel IOMMU DMA remapping internal states, such as root and context table entries in debugfs. Example of such dump in Kabylake: /sys/kernel/debug/iommu/intel/dmar_translation_struct IOMMU dmar0: Root Table Address:45699c000 Root Table Entries: Bus: 0 H: 0 L: 45699f001 Context Table Entri

[PATCH v8 3/6] iommu/vt-d: Enable base Intel IOMMU debugfs support

2018-09-11 Thread Sohil Mehta
Add a new config option CONFIG_INTEL_IOMMU_DEBUGFS and do the base enabling for Intel IOMMU debugfs. Cc: Lu Baolu Cc: Fenghua Yu Cc: Ashok Raj Cc: Jacob Pan Co-Developed-by: Gayatri Kammela Signed-off-by: Gayatri Kammela Reviewed-by: Andy Shevchenko Reviewed-by: Lu Baolu Signed-off-by: Soh

[PATCH v8 4/6] iommu/vt-d: Add debugfs support to show register contents

2018-09-11 Thread Sohil Mehta
From: Gayatri Kammela Add Intel IOMMU debugfs extension to dump all the register contents for each IOMMU device. Example: root@OTC-KBLH-01:~# cat /sys/kernel/debug/iommu/intel/iommu_regset IOMMU: dmar0 Register Base Address: fed9 NameOffset Contents VER 0x00

[PATCH v8 1/6] iommu/vt-d: Relocate struct/function declarations to its header files

2018-09-11 Thread Sohil Mehta
To reuse the static functions and the struct declarations, move them to corresponding header files and export the needed functions. Cc: Lu Baolu Cc: Fenghua Yu Cc: Jacob Pan Cc: Ashok Raj Reviewed-by: Andy Shevchenko Signed-off-by: Gayatri Kammela Signed-off-by: Sohil Mehta --- v8: Remove

[PATCH v8 2/6] iommu/vt-d: Update register definitions to VT-d 3.0 specification

2018-09-11 Thread Sohil Mehta
Add new register definitions added in the VT-d 3.0 specification. Also include registers that were missing previously. Cc: Lu Baolu Cc: Fenghua Yu Cc: Jacob Pan Cc: Ashok Raj Cc: Gayatri Kammela Signed-off-by: Sohil Mehta --- v8: Simplify and split the patches differently include/linux/in

[PATCH v8 0/6] Add Intel IOMMU debugfs support

2018-09-11 Thread Sohil Mehta
Hi All, This series aims to add debugfs support for Intel IOMMU. It exposes IOMMU registers, internal context and dumps individual table entries to help debug Intel IOMMUs. Patches 1-3 do the ground work for the following patches by reorganizing some Intel IOMMU data structures, creating a new

Re: [RFC PATCH 0/2] dma-mapping: introduce helper for setting dma_parms

2018-09-11 Thread Wolfram Sang
Hi Robin, > > od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); > > if (!od) > > return -ENOMEM; > > > > pdev->dev.dma_parms = &od->dma_parms; > > dma_set_max_seg_size(&pdev->dev, 0x3FFF); > > > > And that's all about handling dma_parms. So, on unbind, the m

Re: [RFC PATCH 0/2] dma-mapping: introduce helper for setting dma_parms

2018-09-11 Thread Robin Murphy
On 11/09/18 17:30, Wolfram Sang wrote: Hi all, commit 78c47830a5cb ("dma-debug: check scatterlist segments") triggers for Renesas hardware I look after, so thanks for pointing out we should have proper dma_parms for our DMA providers. When trying to fix it, I became a bit puzzled about the life

[RFC PATCH 1/2] dma-mapping: introduce helper for setting dma_parms

2018-09-11 Thread Wolfram Sang
Setting up dma_parms seems not so trivial because it is easy to miss that its pointer has the life cycle of its containing 'struct device' while the allocation of dma_parms usually happens during the bind/unbind life cycle. Which can lead to dangling pointers. If coding this correctly in drivers, t

[RFC PATCH 2/2] mmc: sdhi: internal_dmac: set dma_parms

2018-09-11 Thread Wolfram Sang
We have our own DMA provider, so we should set the dma_parms properly. Signed-off-by: Wolfram Sang --- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.

[RFC PATCH 0/2] dma-mapping: introduce helper for setting dma_parms

2018-09-11 Thread Wolfram Sang
Hi all, commit 78c47830a5cb ("dma-debug: check scatterlist segments") triggers for Renesas hardware I look after, so thanks for pointing out we should have proper dma_parms for our DMA providers. When trying to fix it, I became a bit puzzled about the life cycle of the pointer to dma_parms. AFAIU

Re: [PATCH] Iommu: ipmmu-vmsa: replace spin_lock_irqsave with spin_lock in ISR

2018-09-11 Thread Geert Uytterhoeven
CC linux-renesas-soc On Tue, Sep 11, 2018 at 5:01 PM jun qian wrote: > > As you are already in ISR, it is unnecessary to call spin_lock_irqsave. > > Signed-off-by: jun qian > --- > drivers/iommu/ipmmu-vmsa.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/i

[PATCH] Iommu: ipmmu-vmsa: replace spin_lock_irqsave with spin_lock in ISR

2018-09-11 Thread jun qian
As you are already in ISR, it is unnecessary to call spin_lock_irqsave. Signed-off-by: jun qian --- drivers/iommu/ipmmu-vmsa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 22b94f8a9a04..afa23d53502c 100644

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

2018-09-11 Thread Jerome Glisse
On Tue, Sep 11, 2018 at 02:40:43PM +0800, Kenneth Lee wrote: > On Mon, Sep 10, 2018 at 11:33:59PM -0400, Jerome Glisse wrote: > > On Tue, Sep 11, 2018 at 10:42:09AM +0800, Kenneth Lee wrote: > > > On Mon, Sep 10, 2018 at 10:54:23AM -0400, Jerome Glisse wrote: > > > > On Mon, Sep 10, 2018 at 11:28:0

[PATCH] iommu/fsl: fix spelling mistake pci_endpt_partioning -> pci_endpt_partitioning

2018-09-11 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in variable name Signed-off-by: Colin Ian King --- drivers/iommu/fsl_pamu_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index f089136e9c3f

Re: [PATCH] iommu/rockchip: Free irqs in shutdown handler

2018-09-11 Thread Marc Zyngier
Hi Heiko, On 27/08/18 11:56, Heiko Stuebner wrote: In the iommu's shutdown handler we disable runtime-pm which could result in the irq-handler running unclocked and since commit 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework") we warn about that fact. This can cause

Re: [PATCH 1/4] arm-nommu: don't define arch_teardown_dma_ops

2018-09-11 Thread Vladimir Murzin
On 27/08/18 09:47, Christoph Hellwig wrote: > We can just use the default implementation. > > Signed-off-by: Christoph Hellwig > --- > arch/arm/include/asm/dma-mapping.h | 2 ++ > arch/arm/mm/dma-mapping-nommu.c| 4 > 2 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/ar

Re: of_dma_request_slave_channel() failed ?

2018-09-11 Thread Geert Uytterhoeven
Hi Morimoto-san, CC asoc, dma, iommu On Tue, Sep 4, 2018 at 8:06 AM Kuninori Morimoto wrote: > Hi Renesas ML > Cc Rob > > I noticed that Sound driver is using PIO mode > on latest kernel. > > ... > rcar_sound ec50.sound: src[0] : probe error -11 > rcar_sound ec50.

[PATCH, for-4.19] dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration

2018-09-11 Thread Christoph Hellwig
The patch adding the infrastructure failed to actually add the symbol declaration, oops.. Fixes: faef87723a ("dma-noncoherent: add a arch_sync_dma_for_cpu_all hook") Signed-off-by: Christoph Hellwig --- kernel/dma/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/dma/Kconfig

Re: [PATCH v16 4/5] dt-bindings: arm-smmu: Add bindings for qcom, smmu-v2

2018-09-11 Thread Vivek Gautam
On Mon, Sep 10, 2018 at 11:32 PM Rob Herring wrote: > > On Thu, 30 Aug 2018 20:15:40 +0530, Vivek Gautam wrote: > > Add bindings doc for Qcom's smmu-v2 implementation. > > > > Signed-off-by: Vivek Gautam > > Reviewed-by: Tomasz Figa > > Tested-by: Srinivas Kandagatla > > --- > > .../devicetree

Re: [PATCH 2/5] dma-mapping: move the dma_coherent flag to struct device

2018-09-11 Thread Greg Kroah-Hartman
On Tue, Sep 11, 2018 at 08:46:36AM +0200, Christoph Hellwig wrote: > On Mon, Sep 10, 2018 at 06:13:50PM +0200, Greg Kroah-Hartman wrote: > > > +#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \ > > > +defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \ > > > +defined(CONFIG_ARCH_HAS_SYNC_DMA