* 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; 11+ 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] 11+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2012-02-13 5:40 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
@ 2012-02-13 7:31 ` Kyungmin Park
2012-02-13 15:05 ` Marek Szyprowski
1 sibling, 0 replies; 11+ 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] 11+ messages in thread
* RE: linux-next: build failure after merge of the dma-mapping tree
2012-02-13 5:40 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
2012-02-13 7:31 ` Kyungmin Park
@ 2012-02-13 15:05 ` Marek Szyprowski
1 sibling, 0 replies; 11+ 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] 11+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2024-05-08 8:51 ` Alexander Lobakin
@ 2024-05-08 13:45 ` Christoph Hellwig
0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2024-05-08 13:45 UTC (permalink / raw)
To: Alexander Lobakin
Cc: Christoph Hellwig, Stephen Rothwell, Linux Kernel Mailing List,
Linux Next Mailing List
On Wed, May 08, 2024 at 10:51:28AM +0200, Alexander Lobakin wrote:
> I'm verry sorry for that. I had 2 trees, one with const get_dma_addr()
> and dma-for-next without const, and didn't check it compiles after
> rebasing >_<
>
> net-next already has this const. We could leave it as in your attached
> patch, but then there'll be a trivial conflict when merging with
> net-next. Or I can send an incremental quick fix for dma-for-next, but
> then 2 commits (one in your tree and one in net-next) will have these
> changes duplicated.
> What do you think?
Let's just add the const annoations after the trees are merged into
Linus' tree. Nothing really wrong with not having them right now.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2024-05-08 6:51 ` Christoph Hellwig
@ 2024-05-08 8:51 ` Alexander Lobakin
2024-05-08 13:45 ` Christoph Hellwig
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Lobakin @ 2024-05-08 8:51 UTC (permalink / raw)
To: Christoph Hellwig, Stephen Rothwell
Cc: Linux Kernel Mailing List, Linux Next Mailing List
From: Christoph Hellwig <hch@lst.de>
Date: Wed, 8 May 2024 08:51:02 +0200
> On Wed, May 08, 2024 at 09:16:31AM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the dma-mapping tree, today's linux-next build (x86_64
>> allmodconfig) failed like this:
>
> Thanks. I'll fold in the patch below to drop two consts for now.
> Alexander, if you want to pass the consts through we'll also need to
> modify page_pool_get_dma_addr, which looks doable. If you want that,
> please send an incremental patch.
I'm verry sorry for that. I had 2 trees, one with const get_dma_addr()
and dma-for-next without const, and didn't check it compiles after
rebasing >_<
net-next already has this const. We could leave it as in your attached
patch, but then there'll be a trivial conflict when merging with
net-next. Or I can send an incremental quick fix for dma-for-next, but
then 2 commits (one in your tree and one in net-next) will have these
changes duplicated.
What do you think?
>
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 8836aaaf23855f..4f9d1bd7f4d187 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -399,7 +399,7 @@ static struct page *__page_pool_get_cached(struct page_pool *pool)
> }
>
> static void __page_pool_dma_sync_for_device(const struct page_pool *pool,
> - const struct page *page,
> + struct page *page,
> u32 dma_sync_size)
> {
> #if defined(CONFIG_HAS_DMA) && defined(CONFIG_DMA_NEED_SYNC)
> @@ -413,7 +413,7 @@ static void __page_pool_dma_sync_for_device(const struct page_pool *pool,
>
> static __always_inline void
> page_pool_dma_sync_for_device(const struct page_pool *pool,
> - const struct page *page,
> + struct page *page,
> u32 dma_sync_size)
> {
> if (pool->dma_sync && dma_dev_need_sync(pool->p.dev))
Thanks,
Olek
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: linux-next: build failure after merge of the dma-mapping tree
2024-05-07 23:16 Stephen Rothwell
@ 2024-05-08 6:51 ` Christoph Hellwig
2024-05-08 8:51 ` Alexander Lobakin
0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2024-05-08 6:51 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Christoph Hellwig, Alexander Lobakin, Linux Kernel Mailing List,
Linux Next Mailing List
On Wed, May 08, 2024 at 09:16:31AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
Thanks. I'll fold in the patch below to drop two consts for now.
Alexander, if you want to pass the consts through we'll also need to
modify page_pool_get_dma_addr, which looks doable. If you want that,
please send an incremental patch.
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 8836aaaf23855f..4f9d1bd7f4d187 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -399,7 +399,7 @@ static struct page *__page_pool_get_cached(struct page_pool *pool)
}
static void __page_pool_dma_sync_for_device(const struct page_pool *pool,
- const struct page *page,
+ struct page *page,
u32 dma_sync_size)
{
#if defined(CONFIG_HAS_DMA) && defined(CONFIG_DMA_NEED_SYNC)
@@ -413,7 +413,7 @@ static void __page_pool_dma_sync_for_device(const struct page_pool *pool,
static __always_inline void
page_pool_dma_sync_for_device(const struct page_pool *pool,
- const struct page *page,
+ struct page *page,
u32 dma_sync_size)
{
if (pool->dma_sync && dma_dev_need_sync(pool->p.dev))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* linux-next: build failure after merge of the dma-mapping tree
@ 2024-05-07 23:16 Stephen Rothwell
2024-05-08 6:51 ` Christoph Hellwig
0 siblings, 1 reply; 11+ messages in thread
From: Stephen Rothwell @ 2024-05-07 23:16 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Alexander Lobakin, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
Hi all,
After merging the dma-mapping tree, today's linux-next build (x86_64
allmodconfig) failed like this:
net/core/page_pool.c: In function '__page_pool_dma_sync_for_device':
net/core/page_pool.c:406:54: error: passing argument 1 of 'page_pool_get_dma_addr' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
406 | dma_addr_t dma_addr = page_pool_get_dma_addr(page);
| ^~~~
In file included from net/core/page_pool.c:13:
include/net/page_pool/helpers.h:373:62: note: expected 'struct page *' but argument is of type 'const struct page *'
373 | static inline dma_addr_t page_pool_get_dma_addr(struct page *page)
| ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors
Caused by commit
8bf4d7154d4c ("page_pool: check for DMA sync shortcut earlier")
I have used the dma-mapping tree from next-20240507 for today.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 11+ 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; 11+ 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] 11+ messages in thread
* Re: 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
1 sibling, 0 replies; 11+ 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] 11+ messages in thread
* Re: 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:59 ` Stephen Rothwell
2020-11-27 9:33 ` Christoph Hellwig
1 sibling, 1 reply; 11+ 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] 11+ messages in thread
* 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; 11+ 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] 11+ messages in thread
end of thread, other threads:[~2024-05-08 13:45 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-13 5:40 linux-next: build failure after merge of the dma-mapping tree Stephen Rothwell
2012-02-13 7:31 ` Kyungmin Park
2012-02-13 15:05 ` Marek Szyprowski
2020-11-27 6:58 Stephen Rothwell
2020-11-27 9:21 ` Christoph Hellwig
2020-11-27 9:59 ` Stephen Rothwell
2020-11-27 9:33 ` Christoph Hellwig
2024-05-07 23:16 Stephen Rothwell
2024-05-08 6:51 ` Christoph Hellwig
2024-05-08 8:51 ` Alexander Lobakin
2024-05-08 13:45 ` Christoph Hellwig
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).