* CONFIG_DMA_NOOP_OPS breaks ARM arch
@ 2017-10-16 2:27 Marian Mihailescu
2017-10-16 3:27 ` Randy Dunlap
0 siblings, 1 reply; 7+ messages in thread
From: Marian Mihailescu @ 2017-10-16 2:27 UTC (permalink / raw)
To: linux-kernel
After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops
are built only for architectures that use it.
For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot
be selected.
However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops:
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops;
}
I will let a maintainer suggest the best resolution for this :)
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 2:27 CONFIG_DMA_NOOP_OPS breaks ARM arch Marian Mihailescu @ 2017-10-16 3:27 ` Randy Dunlap 2017-10-16 3:29 ` Randy Dunlap 0 siblings, 1 reply; 7+ messages in thread From: Randy Dunlap @ 2017-10-16 3:27 UTC (permalink / raw) To: Marian Mihailescu, linux-kernel; +Cc: Bart Van Assche, iommu On 10/15/17 19:27, Marian Mihailescu wrote: > After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops > are built only for architectures that use it. > > For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot > be selected. > > However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: > > static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) > { > return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; > } > > I will let a maintainer suggest the best resolution for this :) > add Bart and iommu mailing list. -- ~Randy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 3:27 ` Randy Dunlap @ 2017-10-16 3:29 ` Randy Dunlap 2017-10-16 3:58 ` Randy Dunlap 0 siblings, 1 reply; 7+ messages in thread From: Randy Dunlap @ 2017-10-16 3:29 UTC (permalink / raw) To: Marian Mihailescu, linux-kernel; +Cc: Bart Van Assche, iommu, Vladimir Murzin On 10/15/17 20:27, Randy Dunlap wrote: > On 10/15/17 19:27, Marian Mihailescu wrote: >> After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops >> are built only for architectures that use it. >> >> For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot >> be selected. >> >> However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: >> >> static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) >> { >> return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; >> } >> >> I will let a maintainer suggest the best resolution for this :) >> > > add Bart and iommu mailing list. > and add Vladimir. -- ~Randy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 3:29 ` Randy Dunlap @ 2017-10-16 3:58 ` Randy Dunlap 2017-10-16 5:27 ` Marian Mihailescu 0 siblings, 1 reply; 7+ messages in thread From: Randy Dunlap @ 2017-10-16 3:58 UTC (permalink / raw) To: Marian Mihailescu, linux-kernel; +Cc: Bart Van Assche, iommu, Vladimir Murzin On 10/15/17 20:29, Randy Dunlap wrote: > On 10/15/17 20:27, Randy Dunlap wrote: >> On 10/15/17 19:27, Marian Mihailescu wrote: >>> After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops >>> are built only for architectures that use it. >>> >>> For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot >>> be selected. What kernel version are you looking at? I see that it is selected: --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -22,6 +22,7 @@ config ARM select CLONE_BACKWARDS select CPU_PM if (SUSPEND || CPU_IDLE) select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS + select DMA_NOOP_OPS if !MMU select EDAC_SUPPORT select EDAC_ATOMIC_SCRUB select GENERIC_ALLOCATOR That's in commit ID 1c51c429f30ea10428337f3a33c12059ba59f668 from May 24, 2017. >>> However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: >>> >>> static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) >>> { >>> return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; >>> } >>> >>> I will let a maintainer suggest the best resolution for this :) >>> >> >> add Bart and iommu mailing list. >> > > and add Vladimir. > > -- ~Randy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 3:58 ` Randy Dunlap @ 2017-10-16 5:27 ` Marian Mihailescu 2017-10-16 8:12 ` Vladimir Murzin 0 siblings, 1 reply; 7+ messages in thread From: Marian Mihailescu @ 2017-10-16 5:27 UTC (permalink / raw) To: Randy Dunlap; +Cc: linux-kernel, Bart Van Assche, iommu, Vladimir Murzin I am using 4.14-rc4 with a patch on top that includes arch/arm/include/asm/dma-mapping.h in a module. I have MMU enabled, so select DMA_NOOP_OPS if !MMU does nothing for me, and I get a compile error because dma_noop_ops is unknown. Maybe I should include linux/dma-mapping.h? Thanks for the quick reply. On Mon, Oct 16, 2017 at 2:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote: > On 10/15/17 20:29, Randy Dunlap wrote: >> On 10/15/17 20:27, Randy Dunlap wrote: >>> On 10/15/17 19:27, Marian Mihailescu wrote: >>>> After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops >>>> are built only for architectures that use it. >>>> >>>> For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot >>>> be selected. > > What kernel version are you looking at? > I see that it is selected: > > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -22,6 +22,7 @@ config ARM > select CLONE_BACKWARDS > select CPU_PM if (SUSPEND || CPU_IDLE) > select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS > + select DMA_NOOP_OPS if !MMU > select EDAC_SUPPORT > select EDAC_ATOMIC_SCRUB > select GENERIC_ALLOCATOR > > > That's in commit ID 1c51c429f30ea10428337f3a33c12059ba59f668 from May 24, 2017. > >>>> However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: >>>> >>>> static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) >>>> { >>>> return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; >>>> } >>>> >>>> I will let a maintainer suggest the best resolution for this :) >>>> >>> >>> add Bart and iommu mailing list. >>> >> >> and add Vladimir. >> >> > > > -- > ~Randy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 5:27 ` Marian Mihailescu @ 2017-10-16 8:12 ` Vladimir Murzin 2017-10-16 11:14 ` Robin Murphy 0 siblings, 1 reply; 7+ messages in thread From: Vladimir Murzin @ 2017-10-16 8:12 UTC (permalink / raw) To: Marian Mihailescu, Randy Dunlap Cc: linux-kernel, Bart Van Assche, iommu, Christoph Hellwig, Robin Murphy + Robin and Christoph On 16/10/17 06:27, Marian Mihailescu wrote: > I am using 4.14-rc4 with a patch on top that includes > arch/arm/include/asm/dma-mapping.h in a module. > > I have MMU enabled, so > select DMA_NOOP_OPS if !MMU > does nothing for me, and I get a compile error because dma_noop_ops is unknown. Can you post an error message here, please? > > Maybe I should include linux/dma-mapping.h? Where to include? In your driver or what? > > Thanks for the quick reply. with CONFIG_MMU compiler should optimise out dma_noop_ops in: return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; What toolchain are you using? Cheers Vladimir > > > On Mon, Oct 16, 2017 at 2:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote: >> On 10/15/17 20:29, Randy Dunlap wrote: >>> On 10/15/17 20:27, Randy Dunlap wrote: >>>> On 10/15/17 19:27, Marian Mihailescu wrote: >>>>> After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops >>>>> are built only for architectures that use it. >>>>> >>>>> For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot >>>>> be selected. >> >> What kernel version are you looking at? >> I see that it is selected: >> >> --- a/arch/arm/Kconfig >> +++ b/arch/arm/Kconfig >> @@ -22,6 +22,7 @@ config ARM >> select CLONE_BACKWARDS >> select CPU_PM if (SUSPEND || CPU_IDLE) >> select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS >> + select DMA_NOOP_OPS if !MMU >> select EDAC_SUPPORT >> select EDAC_ATOMIC_SCRUB >> select GENERIC_ALLOCATOR >> >> >> That's in commit ID 1c51c429f30ea10428337f3a33c12059ba59f668 from May 24, 2017. >> >>>>> However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: >>>>> >>>>> static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) >>>>> { >>>>> return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; >>>>> } >>>>> >>>>> I will let a maintainer suggest the best resolution for this :) >>>>> >>>> >>>> add Bart and iommu mailing list. >>>> >>> >>> and add Vladimir. >>> >>> >> >> >> -- >> ~Randy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: CONFIG_DMA_NOOP_OPS breaks ARM arch 2017-10-16 8:12 ` Vladimir Murzin @ 2017-10-16 11:14 ` Robin Murphy 0 siblings, 0 replies; 7+ messages in thread From: Robin Murphy @ 2017-10-16 11:14 UTC (permalink / raw) To: Marian Mihailescu Cc: Vladimir Murzin, Randy Dunlap, linux-kernel, Bart Van Assche, iommu, Christoph Hellwig On 16/10/17 09:12, Vladimir Murzin wrote: > + Robin and Christoph > > On 16/10/17 06:27, Marian Mihailescu wrote: >> I am using 4.14-rc4 with a patch on top that includes >> arch/arm/include/asm/dma-mapping.h in a module. >> >> I have MMU enabled, so >> select DMA_NOOP_OPS if !MMU >> does nothing for me, and I get a compile error because dma_noop_ops is unknown. > > Can you post an error message here, please? > >> >> Maybe I should include linux/dma-mapping.h? That is the *only* dma-mapping header you should be referring to. Including the arch/*/asm/ version directly is just broken and asking for trouble. Robin. > Where to include? In your driver or what? > >> >> Thanks for the quick reply. > > with CONFIG_MMU compiler should optimise out dma_noop_ops in: > > return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; > > What toolchain are you using? > > Cheers > Vladimir > >> >> >> On Mon, Oct 16, 2017 at 2:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote: >>> On 10/15/17 20:29, Randy Dunlap wrote: >>>> On 10/15/17 20:27, Randy Dunlap wrote: >>>>> On 10/15/17 19:27, Marian Mihailescu wrote: >>>>>> After commit 7844572c633964c864d9f32dc3f2a8ffe5d70371, dma_noop_ops >>>>>> are built only for architectures that use it. >>>>>> >>>>>> For ARM architecture, CONFIG_DMA_NOOP_OPS is not selected, and cannot >>>>>> be selected. >>> >>> What kernel version are you looking at? >>> I see that it is selected: >>> >>> --- a/arch/arm/Kconfig >>> +++ b/arch/arm/Kconfig >>> @@ -22,6 +22,7 @@ config ARM >>> select CLONE_BACKWARDS >>> select CPU_PM if (SUSPEND || CPU_IDLE) >>> select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS >>> + select DMA_NOOP_OPS if !MMU >>> select EDAC_SUPPORT >>> select EDAC_ATOMIC_SCRUB >>> select GENERIC_ALLOCATOR >>> >>> >>> That's in commit ID 1c51c429f30ea10428337f3a33c12059ba59f668 from May 24, 2017. >>> >>>>>> However, arch/arm/include/asm/dma-mapping.h is referencing dma_noop_ops: >>>>>> >>>>>> static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) >>>>>> { >>>>>> return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops; >>>>>> } >>>>>> >>>>>> I will let a maintainer suggest the best resolution for this :) >>>>>> >>>>> >>>>> add Bart and iommu mailing list. >>>>> >>>> >>>> and add Vladimir. >>>> >>>> >>> >>> >>> -- >>> ~Randy > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-10-16 11:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-10-16 2:27 CONFIG_DMA_NOOP_OPS breaks ARM arch Marian Mihailescu 2017-10-16 3:27 ` Randy Dunlap 2017-10-16 3:29 ` Randy Dunlap 2017-10-16 3:58 ` Randy Dunlap 2017-10-16 5:27 ` Marian Mihailescu 2017-10-16 8:12 ` Vladimir Murzin 2017-10-16 11:14 ` Robin Murphy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®