* linux-next: build failure after merge of the dma-mapping tree
@ 2020-11-27 6:58 Stephen Rothwell
2020-11-27 9:21 ` Christoph Hellwig
2020-11-27 9:33 ` Christoph Hellwig
0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2020-11-27 6:58 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Alexey Kardashevskiy, Michael Ellerman,
Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 3133 bytes --]
Hi all,
After merging the dma-mapping tree, today's linux-next build (powerpc64
allnoconfig) failed like this:
In file included from include/linux/dma-direct.h:10,
from arch/powerpc/kernel/dma-iommu.c:9:
include/linux/dma-map-ops.h:328:41: error: expected identifier or '(' before numeric constant
328 | #define arch_dma_map_page_direct(d, a) (0)
| ^
arch/powerpc/kernel/dma-iommu.c:16:6: note: in expansion of macro 'arch_dma_map_page_direct'
16 | bool arch_dma_map_page_direct(struct device *dev, phys_addr_t addr)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dma-map-ops.h:329:43: error: expected identifier or '(' before numeric constant
329 | #define arch_dma_unmap_page_direct(d, a) (0)
| ^
arch/powerpc/kernel/dma-iommu.c:26:6: note: in expansion of macro 'arch_dma_unmap_page_direct'
26 | bool arch_dma_unmap_page_direct(struct device *dev, dma_addr_t dma_handle)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dma-map-ops.h:330:42: error: expected identifier or '(' before numeric constant
330 | #define arch_dma_map_sg_direct(d, s, n) (0)
| ^
arch/powerpc/kernel/dma-iommu.c:34:6: note: in expansion of macro 'arch_dma_map_sg_direct'
34 | bool arch_dma_map_sg_direct(struct device *dev, struct scatterlist *sg,
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/dma-map-ops.h:331:44: error: expected identifier or '(' before numeric constant
331 | #define arch_dma_unmap_sg_direct(d, s, n) (0)
| ^
arch/powerpc/kernel/dma-iommu.c:51:6: note: in expansion of macro 'arch_dma_unmap_sg_direct'
51 | bool arch_dma_unmap_sg_direct(struct device *dev, struct scatterlist *sg,
| ^~~~~~~~~~~~~~~~~~~~~~~~
Caused by commit
4e52b96ac85c ("powerpc/dma: Fallback to dma_ops when persistent memory present")
I have applied the following patch for today.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 27 Nov 2020 17:49:28 +1100
Subject: [PATCH] powerpc/dma: fix for "powerpc/dma: Fallback to dma_ops when
persistent memory present"
Fixes: 4e52b96ac85c ("powerpc/dma: Fallback to dma_ops when persistent memory present")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/dma-iommu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index c724548ca295..6364311eb6e9 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -10,6 +10,8 @@
#include <linux/pci.h>
#include <asm/iommu.h>
+#ifdef CONFIG_ARCH_HAS_DMA_MAP_DIRECT
+
#define can_map_direct(dev, addr) \
((dev)->bus_dma_limit >= phys_to_dma((dev), (addr)))
@@ -64,6 +66,7 @@ bool arch_dma_unmap_sg_direct(struct device *dev, struct scatterlist *sg,
return true;
}
+#endif /* CONFIG_ARCH_HAS_DMA_MAP_DIRECT */
/*
* Generic iommu implementation
--
2.29.2
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2020-11-27 6:58 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
@ 2020-11-27 9:21 ` Christoph Hellwig
2020-11-27 9:59 ` Stephen Rothwell
2020-11-27 9:33 ` Christoph Hellwig
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-11-27 9:21 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Christoph Hellwig, Alexey Kardashevskiy, Michael Ellerman,
Linux Kernel Mailing List, Linux Next Mailing List
On Fri, Nov 27, 2020 at 05:58:01PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next build (powerpc64
> allnoconfig) failed like this:
I'm looking into fixing this now, but how do you generate a powerpc64
allnoconfig? My attempts so far either create a ppc32 one or fail entirely.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2020-11-27 6:58 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
2020-11-27 9:21 ` Christoph Hellwig
@ 2020-11-27 9:33 ` Christoph Hellwig
1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-11-27 9:33 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Christoph Hellwig, Alexey Kardashevskiy, Michael Ellerman,
Linux Kernel Mailing List, Linux Next Mailing List
I fixed this as shown:
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index c724548ca295c0..111249fd619de8 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -10,6 +10,7 @@
#include <linux/pci.h>
#include <asm/iommu.h>
+#ifdef CONFIG_ARCH_HAS_DMA_MAP_DIRECT
#define can_map_direct(dev, addr) \
((dev)->bus_dma_limit >= phys_to_dma((dev), (addr)))
@@ -64,6 +65,7 @@ bool arch_dma_unmap_sg_direct(struct device *dev, struct scatterlist *sg,
return true;
}
+#endif /* CONFIG_ARCH_HAS_DMA_MAP_DIRECT */
/*
* Generic iommu implementation
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2020-11-27 9:21 ` Christoph Hellwig
@ 2020-11-27 9:59 ` Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2020-11-27 9:59 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Alexey Kardashevskiy, Michael Ellerman,
Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
Hi Christoph,
On Fri, 27 Nov 2020 10:21:37 +0100 Christoph Hellwig <hch@lst.de> wrote:
>
> On Fri, Nov 27, 2020 at 05:58:01PM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the dma-mapping tree, today's linux-next build (powerpc64
> > allnoconfig) failed like this:
>
> I'm looking into fixing this now, but how do you generate a powerpc64
> allnoconfig? My attempts so far either create a ppc32 one or fail entirely.
echo CONFIG_PPC64=y >tmp_conf
KCONFIG_ALLCONFIG=tmp_conf make ARCH=powerpc allnoconfig
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: linux-next: build failure after merge of the dma-mapping tree
2012-02-13 5:40 Stephen Rothwell
2012-02-13 7:31 ` Kyungmin Park
@ 2012-02-13 15:05 ` Marek Szyprowski
1 sibling, 0 replies; 7+ messages in thread
From: Marek Szyprowski @ 2012-02-13 15:05 UTC (permalink / raw)
To: 'Stephen Rothwell', 'Kyungmin Park'
Cc: linux-next, linux-kernel
Hi Stephen,
On Monday, February 13, 2012 6:40 AM Stephen Rothwell wrote:
> After merging the dma-mapping tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
(snipped)
I'm sorry for the problems. I've updated patches to fix these issues, as
well as similar problems with MIPS and Hexagon architecture.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2012-02-13 5:40 Stephen Rothwell
@ 2012-02-13 7:31 ` Kyungmin Park
2012-02-13 15:05 ` Marek Szyprowski
1 sibling, 0 replies; 7+ messages in thread
From: Kyungmin Park @ 2012-02-13 7:31 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Marek Szyprowski, linux-next, linux-kernel
Hi,
It's maybe missing modify arch/powerpc/kernel/vio.c at that time.
following patch will fix it.
Thank you,
Kyungmin Park
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 8b08629..b12a77a 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -487,7 +487,7 @@ static void vio_cmo_balance(struct work_struct *work)
}
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 8b08629..b12a77a 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -487,7 +487,7 @@ static void vio_cmo_balance(struct work_struct *work)
}
static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t flag)
+ dma_addr_t *dma_handle, gfp_t flag, struct dma_attrs *attrs)
{
struct vio_dev *viodev = to_vio_dev(dev);
void *ret;
@@ -497,7 +497,7 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev
return NULL;
}
- ret = dma_iommu_ops.alloc_coherent(dev, size, dma_handle, flag);
+ ret = dma_iommu_ops.alloc(dev, size, dma_handle, flag, attrs);
if (unlikely(ret == NULL)) {
vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE));
atomic_inc(&viodev->cmo.allocs_failed);
@@ -507,11 +507,11 @@ static void *vio_dma_iommu_alloc_coherent(struct device *d
}
static void vio_dma_iommu_free_coherent(struct device *dev, size_t size,
- void *vaddr, dma_addr_t dma_handle)
+ void *vaddr, dma_addr_t dma_handle, struct dma_attrs *attrs)
{
struct vio_dev *viodev = to_vio_dev(dev);
- dma_iommu_ops.free_coherent(dev, size, vaddr, dma_handle);
+ dma_iommu_ops.free(dev, size, vaddr, dma_handle, attrs);
vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE));
}
@@ -612,8 +612,8 @@ static u64 vio_dma_get_required_mask(struct device *dev)
}
struct dma_map_ops vio_dma_mapping_ops = {
- .alloc_coherent = vio_dma_iommu_alloc_coherent,
- .free_coherent = vio_dma_iommu_free_coherent,
+ .alloc = vio_dma_iommu_alloc_coherent,
+ .free = vio_dma_iommu_free_coherent,
.map_sg = vio_dma_iommu_map_sg,
.unmap_sg = vio_dma_iommu_unmap_sg,
.map_page = vio_dma_iommu_map_page,
On 2/13/12, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> arch/powerpc/kernel/vio.c: In function 'vio_dma_iommu_alloc_coherent':
> arch/powerpc/kernel/vio.c:500:21: error: 'struct dma_map_ops' has no member
> named 'alloc_coherent'
> arch/powerpc/kernel/vio.c: In function 'vio_dma_iommu_free_coherent':
> arch/powerpc/kernel/vio.c:514:15: error: 'struct dma_map_ops' has no member
> named 'free_coherent'
> arch/powerpc/kernel/vio.c: At top level:
> arch/powerpc/kernel/vio.c:615:2: error: unknown field 'alloc_coherent'
> specified in initializer
> arch/powerpc/kernel/vio.c:615:2: error: initialization from incompatible
> pointer type [-Werror]
> arch/powerpc/kernel/vio.c:615:2: error: (near initialization for
> 'vio_dma_mapping_ops.alloc') [-Werror]
> arch/powerpc/kernel/vio.c:616:2: error: unknown field 'free_coherent'
> specified in initializer
> arch/powerpc/kernel/vio.c:616:2: error: initialization from incompatible
> pointer type [-Werror]
> arch/powerpc/kernel/vio.c:616:2: error: (near initialization for
> 'vio_dma_mapping_ops.free') [-Werror]
>
> I have dropped the dma-mapping tree for today.
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* linux-next: build failure after merge of the dma-mapping tree
@ 2012-02-13 5:40 Stephen Rothwell
2012-02-13 7:31 ` Kyungmin Park
2012-02-13 15:05 ` Marek Szyprowski
0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2012-02-13 5:40 UTC (permalink / raw)
To: Marek Szyprowski, Kyungmin Park; +Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]
Hi all,
After merging the dma-mapping tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:
arch/powerpc/kernel/vio.c: In function 'vio_dma_iommu_alloc_coherent':
arch/powerpc/kernel/vio.c:500:21: error: 'struct dma_map_ops' has no member named 'alloc_coherent'
arch/powerpc/kernel/vio.c: In function 'vio_dma_iommu_free_coherent':
arch/powerpc/kernel/vio.c:514:15: error: 'struct dma_map_ops' has no member named 'free_coherent'
arch/powerpc/kernel/vio.c: At top level:
arch/powerpc/kernel/vio.c:615:2: error: unknown field 'alloc_coherent' specified in initializer
arch/powerpc/kernel/vio.c:615:2: error: initialization from incompatible pointer type [-Werror]
arch/powerpc/kernel/vio.c:615:2: error: (near initialization for 'vio_dma_mapping_ops.alloc') [-Werror]
arch/powerpc/kernel/vio.c:616:2: error: unknown field 'free_coherent' specified in initializer
arch/powerpc/kernel/vio.c:616:2: error: initialization from incompatible pointer type [-Werror]
arch/powerpc/kernel/vio.c:616:2: error: (near initialization for 'vio_dma_mapping_ops.free') [-Werror]
I have dropped the dma-mapping tree for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-27 9:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 6:58 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
2020-11-27 9:21 ` Christoph Hellwig
2020-11-27 9:59 ` Stephen Rothwell
2020-11-27 9:33 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2012-02-13 5:40 Stephen Rothwell
2012-02-13 7:31 ` Kyungmin Park
2012-02-13 15:05 ` Marek Szyprowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).