* [PATCH v3 0/8] arm64: Default to 32-bit wide ZONE_DMA
@ 2020-10-14 19:12 Nicolas Saenz Julienne
2020-10-14 19:12 ` [PATCH v3 8/8] mm: Update DMA zones description Nicolas Saenz Julienne
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Saenz Julienne @ 2020-10-14 19:12 UTC (permalink / raw)
To: robh+dt, catalin.marinas, hch, ardb, linux-kernel
Cc: robin.murphy, linux-arm-kernel, linux-rpi-kernel, jeremy.linton,
iommu, devicetree, Nicolas Saenz Julienne, linux-acpi, linux-mm
Using two distinct DMA zones turned out to be problematic. Here's an
attempt go back to a saner default.
I tested this on both a RPi4 and QEMU.
---
Changes since v2:
- Introduce Ard's patch
- Improve OF dma-ranges parsing function
- Add unit test for OF function
- Address small changes
- Move crashkernel reservation later in boot process
Changes since v1:
- Parse dma-ranges instead of using machine compatible string
Ard Biesheuvel (1):
arm64: mm: Set ZONE_DMA size based on early IORT scan
Nicolas Saenz Julienne (7):
arm64: mm: Move reserve_crashkernel() into mem_init()
arm64: mm: Move zone_dma_bits initialization into zone_sizes_init()
of/address: Introduce of_dma_get_max_cpu_address()
of: unittest: Add test for of_dma_get_max_cpu_address()
dma-direct: Turn zone_dma_bits default value into a define
arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges
mm: Update DMA zones description
arch/arm64/include/asm/processor.h | 1 +
arch/arm64/mm/init.c | 20 ++++++------
drivers/acpi/arm64/iort.c | 51 ++++++++++++++++++++++++++++++
drivers/of/address.c | 42 ++++++++++++++++++++++++
drivers/of/unittest.c | 20 ++++++++++++
include/linux/acpi_iort.h | 4 +++
include/linux/dma-direct.h | 3 ++
include/linux/mmzone.h | 5 +--
include/linux/of.h | 7 ++++
kernel/dma/direct.c | 2 +-
10 files changed, 143 insertions(+), 12 deletions(-)
--
2.28.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3 8/8] mm: Update DMA zones description
2020-10-14 19:12 [PATCH v3 0/8] arm64: Default to 32-bit wide ZONE_DMA Nicolas Saenz Julienne
@ 2020-10-14 19:12 ` Nicolas Saenz Julienne
2020-10-15 5:40 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Saenz Julienne @ 2020-10-14 19:12 UTC (permalink / raw)
To: robh+dt, catalin.marinas, hch, ardb, linux-kernel, Andrew Morton
Cc: robin.murphy, linux-arm-kernel, linux-rpi-kernel, jeremy.linton,
iommu, devicetree, Nicolas Saenz Julienne, linux-mm
The default behavior for arm64 changed, so reflect that.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
---
include/linux/mmzone.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index fb3bf696c05e..4ee2306351b9 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -363,8 +363,9 @@ enum zone_type {
* - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
* the specific device.
*
- * - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
- * lower 4G.
+ * - arm64 uses a single 4GB ZONE_DMA, except on the Raspberry Pi 4,
+ * in which ZONE_DMA covers the first GB and ZONE_DMA32 the rest of
+ * the lower 4GB.
*
* - powerpc only uses ZONE_DMA, the size, up to 2G, may vary
* depending on the specific device.
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v3 8/8] mm: Update DMA zones description
2020-10-14 19:12 ` [PATCH v3 8/8] mm: Update DMA zones description Nicolas Saenz Julienne
@ 2020-10-15 5:40 ` Christoph Hellwig
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2020-10-15 5:40 UTC (permalink / raw)
To: Nicolas Saenz Julienne
Cc: robh+dt, catalin.marinas, hch, ardb, linux-kernel, Andrew Morton,
robin.murphy, linux-arm-kernel, linux-rpi-kernel, jeremy.linton,
iommu, devicetree, linux-mm
On Wed, Oct 14, 2020 at 09:12:10PM +0200, Nicolas Saenz Julienne wrote:
> The default behavior for arm64 changed, so reflect that.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
> include/linux/mmzone.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index fb3bf696c05e..4ee2306351b9 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -363,8 +363,9 @@ enum zone_type {
> * - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
> * the specific device.
> *
> - * - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
> - * lower 4G.
> + * - arm64 uses a single 4GB ZONE_DMA, except on the Raspberry Pi 4,
> + * in which ZONE_DMA covers the first GB and ZONE_DMA32 the rest of
> + * the lower 4GB.
Honestly I think this comment just needs to go away. We can't really list
every setup in a comment in common code.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-15 5:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-14 19:12 [PATCH v3 0/8] arm64: Default to 32-bit wide ZONE_DMA Nicolas Saenz Julienne
2020-10-14 19:12 ` [PATCH v3 8/8] mm: Update DMA zones description Nicolas Saenz Julienne
2020-10-15 5:40 ` 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).