Hi Will,
Could you provide feedback on this V2 patch set? Your early feedback and
direction on how to Tegra194 SMMU driver into upstream would be highly
appreciated.
Thanks,
-KR
-Original Message-
From: Krishna Reddy
Sent: Wednesday, October 31, 2018 4:49 PM
To: will.dea...@arm.com; ro
On Wed, Nov 14, 2018 at 03:13:11PM +0100, Christoph Hellwig wrote:
> Does the patch below make a difference for you? Assigning an
> address to the S/G list is the only functional difference I could
> spot. Drivers really should never look at the S/G list on an
> error return, but..
And that was
Does the patch below make a difference for you? Assigning an
address to the S/G list is the only functional difference I could
spot. Drivers really should never look at the S/G list on an
error return, but..
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 75c82f050c9e..a896f46d0c3
- The ppc32 case of dma_nommu_dma_supported already was a no-op, and the
64-bit case came to the same conclusion as dma_direct_supported, so
replace it with the generic version.
- supports CMA
- Note that the cache maintainance in the existing code is a bit odd
as it implements both t
There is no need to provide anything but get_arch_dma_ops to
. More the remaining declarations to
and drop all the includes.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-mapping.h| 29 ---
arch/powerpc/include/asm/iommu.h | 10 +++
This function is only used by the Cell iommu code, which can keep track
if it is using the iommu internally just as good.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/pci.h | 2 --
arch/powerpc/kernel/pci-common.c| 6 --
arch/powerpc/platforms/cell/iommu.c | 17 ++
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are
the only places that should know about it.
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
arch/powerpc/include/asm/dma-direct.h | 8 ++--
arch/powerpc/include/asm/dma-mapping.h | 16
There is no good reason for this helper, just opencode it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-mapping.h| 6 --
arch/powerpc/kernel/pci-common.c | 2 +-
arch/powerpc/platforms/cell/iommu.c | 4 ++--
arch/powerpc/platforms/powernv/pci-ioda.c |
We need to compare the last byte in the dma range and not the one after it
for the bus_dma_mask, just like we do for the regular dma_mask. Fix this
cleanly by merging the two comparisms into one.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-direct.h | 8 ++--
1 file cha
swiotlb will only bounce buffer the effectice dma address for the device
is smaller than the actual DMA range. Instead of flipping between the
swiotlb and nommu ops for FSL SOCs that have the second outbound window
just don't set the bus dma_mask in this case.
Signed-off-by: Christoph Hellwig
--
Use the standard portable helper instead of the powerpc specific one,
which is about to go away.
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
arch/powerpc/kernel/dma.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/dma
Unused now.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/pci-bridge.h | 2 --
arch/powerpc/kernel/dma.c | 7 ---
2 files changed, 9 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h
b/arch/powerpc/include/asm/pci-bridge.h
index aace7033fa02..a5070
The coherent cache version of this function already is functionally
identicall to the default version, and by defining the
arch_dma_coherent_to_pfn hook the same is ture for the noncoherent
version as well.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-mapping.h | 4
ar
Instead of letting the architecture supply all of dma_set_mask just
give it an additional hook selected by Kconfig.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/dma-mapping.h | 3 ---
arch/powerpc/kernel/dma-swiotlb.c | 8 +++
All iommu capable platforms now always use the iommu code with the
internal bypass, so there is not need for this magic anymore.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/Kconfig | 4 ---
arch/powerpc/kernel/dma.c | 68 ++-
2 files changed, 2 ins
Use the generic iommu bypass code instead of overriding set_dma_mask.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/powernv/pci-ioda.c | 95 ++-
1 file changed, 25 insertions(+), 70 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
b/arch/pow
The max_direct_dma_addr duplicates the bus_dma_mask field in struct
device. Use the generic field instead.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/device.h | 3 ---
arch/powerpc/include/asm/dma-direct.h | 4 +---
arch/powerpc/kernel/dma-swiotlb.c | 20 ---
The ppc_md and pci_controller_ops methods are unused now and can be
removed. The dma_nommu implementation is generic to the generic one
except for using max_pfn instead of calling into the memblock API,
and all other dma_map_ops instances implement a method of their own.
Signed-off-by: Christoph
pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely
related to it, so fsl_pci.c seems like a better place for it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/swiotlb.h | 2 --
arch/powerpc/kernel/dma-swiotlb.c | 11 ---
arch/powerpc/sysdev/fsl_pci.
The CXL code never even looks at the dma mask, so there is no good
reason for this sanity check. Remove it because it gets in the way
of the dma ops refactoring.
Signed-off-by: Christoph Hellwig
---
drivers/misc/cxl/vphb.c | 12
1 file changed, 12 deletions(-)
diff --git a/drivers
This function is completely bogus - the fact that two PCIe devices come
from the same vendor has absolutely nothing to say about the DMA
capabilities and characteristics.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++-
1 file changed,
Use the generic iommu bypass code instead of overriding set_dma_mask.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/sysdev/dart_iommu.c | 45 +++-
1 file changed, 15 insertions(+), 30 deletions(-)
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysde
These methods are optional, no need to implement no-op versions.
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
arch/powerpc/kernel/dma.c | 16
1 file changed, 16 deletions(-)
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index d6deb
Call dma_get_required_mask_pSeriesLP directly instead of dma_iommu_ops
to simply the code a bit.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/pseries/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c
b/arch/powerpc/
Add a new iommu_bypass flag to struct dev_archdata so that the dma_iommu
implementation can handle the direct mapping transparently instead of
switiching ops around. Setting of this flag is controlled by new
pci_controller_ops method.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/as
If dart_init failed we didn't have a chance to setup dma or controller
ops yet, so there is no point in resetting them.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/sysdev/dart_iommu.c | 11 +--
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/arch/powerpc/sysdev/dart_i
Use the generic iommu bypass code instead of overriding set_dma_mask.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/pseries/iommu.c | 100 +++--
1 file changed, 27 insertions(+), 73 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c
b/arch/powerp
These devices are not PCIe devices and do not have associated dma map
ops, so this is just dead code.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/powernv/pci-ioda.c | 9 -
1 file changed, 9 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
b/arch/power
Configure the dma settings at device setup time, and stop playing games
with get_pci_dma_ops. This prepares for using the common dma_configure
code later on.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/cell/iommu.c | 20 +++-
1 file changed, 11 insertions(+), 9 d
The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share
any code with the one for systems with coherent caches. Split it off
and merge it with the helpers in dma-noncoherent.c that have no other
callers.
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
ar
This gets rid of a lot of clumsy code and finally allows us to mark
dma_iommu_ops const.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-mapping.h | 2 +-
arch/powerpc/include/asm/iommu.h | 6 ++
arch/powerpc/kernel/dma-iommu.c| 7 +-
arch/powerpc/platforms/
vio_dma_mapping_ops currently does a lot of indirect calls through
dma_iommu_ops, which not only make the code harder to follow but are
also expensive in the post-spectre world. Unwind the indirect calls
by calling the ppc_iommu_* or iommu_* APIs directly applicable, or
just use the dma_iommu_* me
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
arch/powerpc/kernel/setup_32.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 81909600013a..07f7e6aaf104 100644
--- a/arch/powerpc/kernel/setup_32.c
+++
Signed-off-by: Christoph Hellwig
Acked-by: Benjamin Herrenschmidt
---
arch/powerpc/include/asm/dma-mapping.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/include/asm/dma-mapping.h
b/arch/powerpc/include/asm/dma-mapping.h
index 8fa394520af6..f2a4a7142b1e 100644
--- a/arch/po
Signed-off-by: Christoph Hellwig
---
arch/powerpc/kernel/dma-iommu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index f9fe2080ceb9..2ca6cfaebf65 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-i
Hi all,
this series switches the powerpc port to use the generic swiotlb and
noncoherent dma ops, and to use more generic code for the coherent
direct mapping, as well as removing a lot of dead code.
As this series is very large and depends on the dma-mapping tree I've
also published a git tree:
AMIGAONE select NOT_COHERENT_CACHE, so we better allow it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/Kconfig.cputype | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/Kconfig.cputype
b/arch/powerpc/platforms/Kconfig.cputype
index f4e2
Powerpc has somewhat odd usage where ZONE_DMA is used for all memory on
common 64-bit configfs, and ZONE_DMA32 is used for 31-bit schemes.
Move to a scheme closer to what other architectures use (and I dare to
say the intent of the system):
- ZONE_DMA: optionally for memory < 31-bit (64-bit embe
38 matches
Mail list logo