Hi Robin,
On Mon, Jul 30, 2018 at 12:40 PM, Ganapatrao Kulkarni
wrote:
> On Fri, Jul 27, 2018 at 9:48 PM, Robin Murphy wrote:
>> On 27/07/18 13:56, Ganapatrao Kulkarni wrote:
>> [...]
>
> did you get any chance to look in to this issue?
> i am waiting for your suggestion/patch for t
[+cc Joerg]
On Mon, Jul 30, 2018 at 09:38:42AM +0200, Christoph Hellwig wrote:
> There is nothing arch specific about PCI or dma-debug, so move this
> call to common code just after registering the bus type.
I assume that previously, even if the user set CONFIG_DMA_API_DEBUG=y
we only got PCI DMA
Hi Christoph.
On Mon, Jul 30, 2018 at 06:17:23PM +0200, Christoph Hellwig wrote:
> Switch to the generic noncoherent direct mapping implementation.
>
> This removes the previous sync_single_for_device implementation, which
> looks bogus given that no syncing is happening in the similar but more
>
The remaining implementation for coherent caches is functionally
identical to the default provided in common code.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-mapping.h | 7 ---
arch/powerpc/kernel/dma-iommu.c| 1 -
arch/powerpc/kernel/dma.c | 13
The generic dma-noncoherent code provides all that is needed by powerpc.
Note that the cache maintainance in the existing code is a bit odd
as it implements both the sync_to_device and sync_to_cpu callouts,
but never flushes caches when unmapping. This patch keeps both
directions arounds, which w
These are indentical except for additional error checking, so migrate
to the common code, and wire up the get_mapping_error method as well.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/kernel/dma.c | 32
1 file changed, 4 insertions(+), 28 deletions(-)
diff
These are identical to the arch specific ones, so remove them.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/include/asm/dma-direct.h | 4
arch/powerpc/include/asm/swiotlb.h| 2 --
arch/powerpc/kernel/dma-swiotlb.c | 28 ++-
arch/powerpc/sysdev/fsl_pci.
These methods are optional to start with, no need to implement no-op
versions.
Signed-off-by: Christoph Hellwig
---
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 511a4972560d..2cfc45acbb5
These do the same functionality as the existing helpers, but do it
simpler, and also allow the (optional) use of CMA.
Note that the swiotlb code now calls into the dma_direct code directly,
given that it doesn't work with noncoherent caches at all, and isn't called
when we have an iommu either, so
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.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/dma.c | 28 +++---
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
---
arch/powerpc/include/asm/dma-direct.h | 8 ++--
arch/powerpc/include/asm/dma-mapping.h | 16
2 files changed, 6 insertion
Use the standard portable helper instead of the powerpc specific one,
which is about to go away.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/kernel/dma-swiotlb.c | 5 ++---
arch/powerpc/kernel/dma.c | 12 ++--
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/
The requirement to disable local irqs over kmap_atomic is long gone,
so remove those calls.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/mm/dma-noncoherent.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/powerpc/mm/dma-noncoherent.c
b/arch/powerpc/mm/dma-non
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
---
arch/powerpc/include/asm/dma-mapping
Signed-off-by: Christoph Hellwig
---
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 74457485574b..3c2d093f74c7 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
Signed-off-by: Christoph Hellwig
---
arch/powerpc/kernel/dma.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index dbfc7056d7df..3939589aab04 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -286,7 +286,6 @@ const
Signed-off-by: Christoph Hellwig
---
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/powerpc/include/asm/dma-mapping.h
++
This is need for powerpc for now. Hopefully we can come up with a clean
generic implementation mid-term.
Signed-off-by: Christoph Hellwig
---
include/linux/dma-noncoherent.h | 6 ++
kernel/dma/Kconfig | 4
kernel/dma/noncoherent.c| 1 +
3 files changed, 11 insertio
For now this allows consolidating the powerpc code. In the long run
we should grow a generic implementation of dma_get_required_mask that
returns the dma mask required to avoid bounce buffering.
Signed-off-by: Christoph Hellwig
---
kernel/dma/swiotlb.c | 4
1 file changed, 4 insertions(+)
ia64 can use the generic implementation in general, and SN2 can just
override it in the dma_map_ops now.
Signed-off-by: Christoph Hellwig
---
arch/ia64/include/asm/dma-mapping.h | 2 --
arch/ia64/include/asm/machvec.h | 7 ---
arch/ia64/include/asm/machvec_init.h | 1 -
arch/ia64/in
We need to take the DMA offset and encryption bit into account when selecting
a zone. Add a helper that takes those into account and use it.
Signed-off-by: Christoph Hellwig
---
kernel/dma/direct.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/kernel/dma/
When a device has a DMA offset the dma capable result will change due
to the difference between the physical and DMA address. Take that into
account.
Signed-off-by: Christoph Hellwig
---
kernel/dma/direct.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/dma/dir
This save some duplication for ia64. In the long run this method will
need some additional work including moving over to kernel/dma, but that
will require some additional prep work, so let's do this minimal change
for now.
Signed-off-by: Christoph Hellwig
---
drivers/base/platform.c | 11 ++
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 dead code.
___
iommu mailing list
iommu@lists.linux-foundation.org
https:/
Switch to the generic noncoherent direct mapping implementation.
This removes the previous sync_single_for_device implementation, which
looks bogus given that no syncing is happening in the similar but more
important map_single case.
Signed-off-by: Christoph Hellwig
Acked-by: Sam Ravnborg
---
On 07/27/2018 05:27 PM, Tony Battersby wrote:
> On 07/27/2018 03:38 PM, Tony Battersby wrote:
>> But the bigger problem is that my first patch adds another list_head to
>> the dma_page for the avail_page_link to make allocations faster. I
>> suppose we could make the lists singly-linked instead of
On Mon, 30 Jul 2018, Christoph Hellwig wrote:
> There is nothing arch specific about PCI or dma-debug, so move this
> call to common code just after registering the bus type.
>
> Signed-off-by: Christoph Hellwig
Acked-by: Thomas Gleixner
___
iommu ma
Hi Rob,
CC Guennadi
On Fri, Jul 27, 2018 at 6:21 PM Rob Landley wrote:
> On 07/24/2018 03:21 PM, Christoph Hellwig wrote:
> > On Tue, Jul 24, 2018 at 02:01:42PM +0200, Christoph Hellwig wrote:
> >> can you review these patches to switch sh to use the generic
> >> dma-noncoherent code? All the r
On Fri, Jul 27, 2018 at 11:20:21AM -0500, Rob Landley wrote:
> Speaking of DMA:
Which really has nothing to do with the dma mapping code, which
also means I can't help you much unfortunately.
That being said sh is the last pending of the initial dma-noncoherent
conversion, I'd greatly appreciate
On Fri, Jul 27, 2018 at 11:05:48PM +0200, Sam Ravnborg wrote:
> Hi Christoph.
>
> Some observations below - nitpick and bikeshedding only.
>
> The parameter of phys_addr_t is sometimes renamed
> to use the same name as in the original prototype (good),
> and sometimes uses the old name (bad).
> T
There is nothing arch specific about PCI or dma-debug, so move this
call to common code just after registering the bus type.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/kernel/dma.c | 3 ---
arch/sh/drivers/pci/pci.c | 2 --
arch/x86/kernel/pci-dma.c | 3 ---
drivers/pci/pci-driver.c | 2
kernel/dma/Kconfig already defines NEED_DMA_MAP_STATE, just select it
from PPC64 and NOT_COHERENT_CACHE instead.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/Kconfig | 3 ---
arch/powerpc/platforms/Kconfig.cputype | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
d
All iommu drivers use the default_iommu_map_sg implementation, and there
is no good reason to ever override it. Just expose it as iommu_map_sg
directly and remove the indirection, specially in our post-spectre world
where indirect calls are horribly expensive.
Signed-off-by: Christoph Hellwig
--
On Fri, Jul 27, 2018 at 9:48 PM, Robin Murphy wrote:
> On 27/07/18 13:56, Ganapatrao Kulkarni wrote:
> [...]
did you get any chance to look in to this issue?
i am waiting for your suggestion/patch for this issue!
>>>
>>>
>>>
>>> I got as far as [1], but I wasn't sure how much I like
34 matches
Mail list logo