e checked inside of vm_unmapped_area() so
> that this flag does not have to be handled individually by each
> architecture.
Tested-by: Jiaxun Yang
Tested on MIPS VA 48 system, fixed pointer tagging on mozjs!
Thanks!
[...]
--
- Jiaxun
oport (Microsoft)
Reviewed-by: Jiaxun Yang
MIPS should go arch_numa at some point as well.
Thanks
- Jiaxun
> ---
> arch/mips/include/asm/mach-loongson64/mmzone.h | 4 ++--
> arch/mips/loongson64/numa.c| 8
> 2 files changed, 6 insertions(+), 6 deletion
> 2023年4月1日 10:15,Jiaxun Yang 写道:
>
> Hi all,
>
> This series split out second half of my previous series
> "[PATCH 0/4] MIPS DMA coherence fixes".
>
> It intends to use dma_default_coherent to determine the default coherency of
> devicetree probed
As for now all arches have dma_default_coherent reflecting default
DMA coherency for of devices, so there is no need to have a standalone
config option.
Signed-off-by: Jiaxun Yang
Reviewed-by: Rob Herring
Acked-by: Michael Ellerman (powerpc)
---
v3: Squash setting ARCH_DMA_DEFAULT_COHERENT
Provide a kconfig option to allow arches to manipulate default
value of dma_default_coherent in Kconfig.
Signed-off-by: Jiaxun Yang
---
v3: Add comments
---
kernel/dma/Kconfig | 7 +++
kernel/dma/mapping.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/dma
dma_default_coherent was decleared unconditionally at kernel/dma/mapping.c
but only decleared when any of non-coherent options is enabled in
dma-map-ops.h.
Guard the declaration in mapping.c with non-coherent options and provide
a fallback definition.
Signed-off-by: Jiaxun Yang
---
v3: Style
Squash setting ARCH_DMA_DEFAULT_COHERENT into PATCH 4
- Setting ARCH_DMA_DEFAULT_COHERENT for PowerPC
v4:
- Drop first patch
Jiaxun Yang (3):
dma-mapping: Provide a fallback dma_default_coherent
dma-mapping: Provide CONFIG_ARCH_DMA_DEFAULT_COHERENT
of: address: Always use dma_default_coher
> 2023年3月28日 08:45,Thomas Bogendoerfer 写道:
>
> On Tue, Mar 28, 2023 at 03:18:12AM +0200, Christoph Hellwig wrote:
>> On Fri, Mar 24, 2023 at 09:17:38AM +0000, Jiaxun Yang wrote:
>>>>
>>>> Is patch a 6.3 candidate or should all of it go into 6.
> 2023年3月23日 21:39,Christoph Hellwig 写道:
>
> On Thu, Mar 23, 2023 at 09:07:31PM +0000, Jiaxun Yang wrote:
>>
>>
>>> 2023年3月23日 07:29,Christoph Hellwig 写道:
>>>
>>> The series looks fine to me. How should we merge it?
>>
>&
> 2023年3月23日 07:29,Christoph Hellwig 写道:
>
> The series looks fine to me. How should we merge it?
Perhaps go through dma-mapping tree?
Thanks
- Jiaxun
As for now all arches have dma_default_coherent reflecting default
DMA coherency for of devices, so there is no need to have a standalone
config option.
Signed-off-by: Jiaxun Yang
---
v3: Squash setting ARCH_DMA_DEFAULT_COHERENT into this patch.
---
arch/powerpc/Kconfig | 2 +-
arch/riscv
Provide a kconfig option to allow arches to manipulate default
value of dma_default_coherent in Kconfig.
Signed-off-by: Jiaxun Yang
---
v3: Add comments
---
kernel/dma/Kconfig | 7 +++
kernel/dma/mapping.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/dma
dma_default_coherent was decleared unconditionally at kernel/dma/mapping.c
but only decleared when any of non-coherent options is enabled in
dma-map-ops.h.
Guard the declaration in mapping.c with non-coherent options and provide
a fallback definition.
Signed-off-by: Jiaxun Yang
---
v3: Style
T_COHERENT into PATCH 4
- Setting ARCH_DMA_DEFAULT_COHERENT for PowerPC
Jiaxun Yang (4):
of: address: Fix default coherency for MIPS
dma-mapping: Provide a fallback dma_default_coherent
dma-mapping: Provide CONFIG_ARCH_DMA_DEFAULT_COHERENT
of: address: Always use dma_default_coherent for de
DT-based MIPS doesn't use OF_DMA_DEFAULT_COHERENT, but
might override the system-wide default at runtime.
Use dma_default_coherent to override default coherence for
MIPS.
Signed-off-by: Jiaxun Yang
---
drivers/of/address.c | 8
1 file changed, 8 insertions(+)
diff --git a/drive
> 2023年3月1日 13:06,Christoph Hellwig 写道:
>
>> - select OF_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
>
> Doesn't powerpc need to select CONFIG_ARCH_DMA_DEFAULT_COHERENT now,
> or even better should be doing that in the patch adding that
> symbol?
If I read the code correctly for powerpc OF_D
will
be true, so it still matches present behavior.
Note for RISCV: dma_default_coherent is set to true in this series.
Signed-off-by: Jiaxun Yang
---
arch/powerpc/Kconfig | 1 -
arch/riscv/Kconfig | 1 -
drivers/of/Kconfig | 4
drivers/of/address.c | 10 +-
4 files changed
For riscv our assumption is unless a device states it is non-coherent,
we take it to be DMA coherent.
Select ARCH_DMA_DEFAULT_COHERENT to ensure dma_default_coherent
is always initialized to true.
Signed-off-by: Jiaxun Yang
---
arch/riscv/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff
Provide a kconfig option to allow arches to manipulate default
value of dma_default_coherent in Kconfig.
Signed-off-by: Jiaxun Yang
---
kernel/dma/Kconfig | 3 +++
kernel/dma/mapping.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/Kconfig b/kernel/dma
dma_default_coherent was decleared unconditionally at kernel/dma/mapping.c
but only decleared when any of non-coherent options is enabled in dma-map-ops.h.
Guard the declaration in mapping.c with non-coherent options and provide
a fallback definition.
Signed-off-by: Jiaxun Yang
---
include
DT-based MIPS doesn't use OF_DMA_DEFAULT_COHERENT, but
might override the system-wide default at runtime.
Use dma_default_coherent to override default coherence for
MIPS.
Signed-off-by: Jiaxun Yang
---
drivers/of/address.c | 8
1 file changed, 8 insertions(+)
diff --git a/drive
oncoherent, dma_default_coherent is a fixed
value set by arch code. It's defaulted to false for most archs except RISC-V.
Thanks
- Jiaxun
---
v2:
- Add PATCH 1 to help with backporting
- Use Kconfig option to set dma_default_coherent
Jiaxun Yang (5):
of: address: Fix default coherency
> 2023年2月22日 17:24,Robin Murphy 写道:
[...]
>
> AFAICS, all you should actually need is a single self-contained addition
> here, something like:
>
> + /*
> + * DT-based MIPS doesn't use OF_DMA_DEFAULT_COHERENT, but
> + * might override the system-wide default at runtime.
> + */
> +#if def
> 2023年2月22日 16:02,Conor Dooley 写道:
>
> On Wed, Feb 22, 2023 at 03:55:19PM +0000, Jiaxun Yang wrote:
>>
>>
>>> 2023年2月22日 14:50,Conor Dooley 写道:
>>>
>>> On Wed, Feb 22, 2023 at 01:37:11PM +, Jiaxun Yang wrote:
>>>> For riscv
> 2023年2月22日 14:50,Conor Dooley 写道:
>
> On Wed, Feb 22, 2023 at 01:37:11PM +0000, Jiaxun Yang wrote:
>> For riscv our assumption is unless a device states it is non-coherent,
>> we take it to be DMA coherent.
>>
>> For devicetree probed devices that have been
.
Signed-off-by: Jiaxun Yang
---
arch/powerpc/Kconfig | 1 -
arch/riscv/Kconfig | 1 -
drivers/of/Kconfig | 4
drivers/of/address.c | 2 +-
4 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2c9cdf1d8761..c67e5da714f7 100644
For riscv our assumption is unless a device states it is non-coherent,
we take it to be DMA coherent.
For devicetree probed devices that have been true since very begining
with OF_DMA_DEFAULT_COHERENT selected.
Signed-off-by: Jiaxun Yang
---
arch/riscv/kernel/setup.c | 3 +++
1 file changed, 3
dma_default_coherent was decleared unconditionally at kernel/dma/mapping.c
but only decleared when any of non-coherent options is enabled in dma-map-ops.h.
Guard the declaration in mapping.c with non-coherent options and provide
a fallback definition.
Signed-off-by: Jiaxun Yang
---
include
oncoherent, dma_default_coherent is a fixed
value set by arch code. It's defaulted to false for most archs except RISC-V.
Thanks
- Jiaxun
Jiaxun Yang (3):
dma-mapping: Provide a fallback dma_default_coherent
riscv: Set dma_default_coherent to true
of: address: Use dma_default_cohere
> 2023年2月22日 12:55,Robin Murphy 写道:
>
> On 2023-02-21 19:55, Jiaxun Yang wrote:
>>> 2023年2月21日 19:46,Robin Murphy 写道:
>>>
>>> On 2023-02-21 18:15, Jiaxun Yang wrote:
>>>>> 2023年2月21日 17:54,Christoph Hellwig 写道:
>>>>>
>
> 2023年2月21日 17:58,Christoph Hellwig 写道:
>
> On Tue, Feb 21, 2023 at 12:46:10PM +0000, Jiaxun Yang wrote:
>> dma_default_coherent can be useful for determine default coherency
>> even on arches without noncoherent support.
>
> How?
I just want to make this symbol
> 2023年2月21日 19:46,Robin Murphy 写道:
>
> On 2023-02-21 18:15, Jiaxun Yang wrote:
>>> 2023年2月21日 17:54,Christoph Hellwig 写道:
>>>
>>> Can you explain the motivation here? Also why riscv patches are at
>>> the end of a mips fіxes series?
>> Ah
> 2023年2月21日 18:14,Conor Dooley 写道:
>
> On Tue, Feb 21, 2023 at 12:46:12PM +0000, Jiaxun Yang wrote:
>> For RISCV we always assume devices are DMA coherent.
>
> "Always assume", I'm not keen on that wording as it is unclear as to
> whether you are sugge
> 2023年2月21日 17:58,Christoph Hellwig 写道:
>
> On Tue, Feb 21, 2023 at 12:46:11PM +0000, Jiaxun Yang wrote:
>> Provide a kconfig option to allow arches to manipulate default
>> value of dma_default_coherent in Kconfig.
>
> I don't see the win
> 2023年2月21日 17:54,Christoph Hellwig 写道:
>
> Can you explain the motivation here? Also why riscv patches are at
> the end of a mips fіxes series?
Ah sorry for any confusion.
So the main purpose of this patch is to fix MIPS’s broken per-device coherency.
To be more precise, we want to be abl
Jiaxun Yang (7):
MIPS: Remove DMA_PERDEV_COHERENT
MIPS: Always select ARCH_HAS_SYNC_DMA_FOR_CPU for noncoherent
platforms
MIPS: c-r4k: Always install dma flush functions
dma-mapping: Always provide dma_default_coherent
dma-mapping: Provide CONFIG_ARCH_DMA_DEFAULT_COHERENT
riscv
dma_default_coherent can be useful for determine default coherency
even on arches without noncoherent support.
Signed-off-by: Jiaxun Yang
---
include/linux/dma-map-ops.h | 1 +
kernel/dma/mapping.c| 4
2 files changed, 5 insertions(+)
diff --git a/include/linux/dma-map-ops.h b
Provide a kconfig option to allow arches to manipulate default
value of dma_default_coherent in Kconfig.
Signed-off-by: Jiaxun Yang
---
kernel/dma/Kconfig | 3 +++
kernel/dma/mapping.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/Kconfig b/kernel/dma
dma_default_coherent
at early boot.
Note for PowerPC: CONFIG_OF_DMA_DEFUALT_COHERENT was only selected when
CONFIG_NOT_COHERENT_CACHE is false, in this case dma_default_coherent will
be ture, so we don't need to select CONFIG_ARCH_DMA_DEFAULT_COHERENT for
PowerPC.
Signed-off-by: Jiaxun Yang
---
arch/po
As nowadays DMA coherence is managed per device, it is possible
to have a system that is defaulted to coherent dma but still
have noncoherent device that needs to use those flush functions.
Just install them unconditionally.
Signed-off-by: Jiaxun Yang
---
arch/mips/mm/c-r4k.c | 12
For RISCV we always assume devices are DMA coherent.
Select ARCH_DMA_DEFAULT_COHERENT to ensure dev->dma_conherent
is always initialized to true.
Signed-off-by: Jiaxun Yang
---
arch/riscv/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
in
As now we are telling the necessity of post DMA flush per CPU type,
there is no need to select ARCH_HAS_SYNC_DMA_FOR_CPU on per platform
bias, just select it unconditionally and we can sort it at runtime.
Signed-off-by: Jiaxun Yang
---
arch/mips/Kconfig | 9 +
1 file changed, 1
As now we are always managing DMA coherence on per dev bias,
there is no need to have such option. And it's not selected
by any platform.
Signed-off-by: Jiaxun Yang
---
arch/mips/Kconfig | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/mips/Kconfig b/arch
43 matches
Mail list logo