* [PATCH v3 0/2] arm64: Fix CMA/crashkernel reservation @ 2019-11-07 9:56 Nicolas Saenz Julienne 2019-11-07 9:56 ` [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory Nicolas Saenz Julienne 0 siblings, 1 reply; 7+ messages in thread From: Nicolas Saenz Julienne @ 2019-11-07 9:56 UTC (permalink / raw) To: catalin.marinas, linux-kernel Cc: Nicolas Saenz Julienne, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel As pointed out by Qian Cai[1] the series enabling ZONE_DMA in arm64 breaks CMA/crashkernel reservations on large devices, as it changed its default placement. After discussing it with Catalin Marinas we're restoring the old behavior. The Raspberry Pi 4, being the only device that needs CMA and crashkernel in ZONE_DMA will explicitly do so trough it's device tree. [1] https://lkml.org/lkml/2019/10/21/725 --- Changes since v1: - Move CMA area registration into bcm2711.dtsi Changes since v1: - s/Raspberry Pi/bcm2711 in bcm2711.dtsi Nicolas Saenz Julienne (2): ARM: dts: bcm2711: force CMA into first GB of memory arm64: mm: reserve CMA and crashkernel in ZONE_DMA32 arch/arm/boot/dts/bcm2711.dtsi | 20 ++++++++++++++++++++ arch/arm64/mm/init.c | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) -- 2.23.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-07 9:56 [PATCH v3 0/2] arm64: Fix CMA/crashkernel reservation Nicolas Saenz Julienne @ 2019-11-07 9:56 ` Nicolas Saenz Julienne 2019-11-07 11:20 ` Catalin Marinas 0 siblings, 1 reply; 7+ messages in thread From: Nicolas Saenz Julienne @ 2019-11-07 9:56 UTC (permalink / raw) To: catalin.marinas, linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, Stefan Wahren Cc: Nicolas Saenz Julienne, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel arm64 places the CMA in ZONE_DMA32, which is not good enough for the Raspberry Pi 4 since it contains peripherals that can only address the first GB of memory. Explicitly place the CMA into that area. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> --- Changes since v1: - Move into bcm2711.dtsi Changes since v1: - s/Raspberry Pi/bcm2711 arch/arm/boot/dts/bcm2711.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index ac83dac2e6ba..667658497898 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -12,6 +12,26 @@ interrupt-parent = <&gicv2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <1>; + ranges; + + /* + * arm64 reserves the CMA by default somewhere in ZONE_DMA32, + * that's not good enough for bcm2711 as some devices can + * only address the lower 1G of memory (ZONE_DMA). + */ + linux,cma { + compatible = "shared-dma-pool"; + size = <0x2000000>; /* 32MB */ + alloc-ranges = <0x0 0x00000000 0x40000000>; + reusable; + linux,cma-default; + }; + }; + + soc { /* * Defined ranges: -- 2.23.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-07 9:56 ` [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory Nicolas Saenz Julienne @ 2019-11-07 11:20 ` Catalin Marinas 2019-11-07 17:59 ` Florian Fainelli 0 siblings, 1 reply; 7+ messages in thread From: Catalin Marinas @ 2019-11-07 11:20 UTC (permalink / raw) To: Nicolas Saenz Julienne Cc: linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, Stefan Wahren, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel Hi Nicolas, On Thu, Nov 07, 2019 at 10:56:10AM +0100, Nicolas Saenz Julienne wrote: > diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi > index ac83dac2e6ba..667658497898 100644 > --- a/arch/arm/boot/dts/bcm2711.dtsi > +++ b/arch/arm/boot/dts/bcm2711.dtsi > @@ -12,6 +12,26 @@ > > interrupt-parent = <&gicv2>; > > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <1>; > + ranges; > + > + /* > + * arm64 reserves the CMA by default somewhere in ZONE_DMA32, > + * that's not good enough for bcm2711 as some devices can > + * only address the lower 1G of memory (ZONE_DMA). > + */ > + linux,cma { > + compatible = "shared-dma-pool"; > + size = <0x2000000>; /* 32MB */ > + alloc-ranges = <0x0 0x00000000 0x40000000>; > + reusable; > + linux,cma-default; > + }; > + }; > + > + > soc { > /* > * Defined ranges: Sorry, I just realised I can't merge this as it depends on a patch that's only in -next: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support"). I'll queue the second patch in the series to fix the regression introduces by the ZONE_DMA patches and, AFAICT, the dts update can be queued independently. -- Catalin ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-07 11:20 ` Catalin Marinas @ 2019-11-07 17:59 ` Florian Fainelli 2019-11-07 19:09 ` Stefan Wahren 0 siblings, 1 reply; 7+ messages in thread From: Florian Fainelli @ 2019-11-07 17:59 UTC (permalink / raw) To: Catalin Marinas, Nicolas Saenz Julienne Cc: linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, Stefan Wahren, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel On 11/7/19 3:20 AM, Catalin Marinas wrote: > Hi Nicolas, > > On Thu, Nov 07, 2019 at 10:56:10AM +0100, Nicolas Saenz Julienne wrote: >> diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi >> index ac83dac2e6ba..667658497898 100644 >> --- a/arch/arm/boot/dts/bcm2711.dtsi >> +++ b/arch/arm/boot/dts/bcm2711.dtsi >> @@ -12,6 +12,26 @@ >> >> interrupt-parent = <&gicv2>; >> >> + reserved-memory { >> + #address-cells = <2>; >> + #size-cells = <1>; >> + ranges; >> + >> + /* >> + * arm64 reserves the CMA by default somewhere in ZONE_DMA32, >> + * that's not good enough for bcm2711 as some devices can >> + * only address the lower 1G of memory (ZONE_DMA). >> + */ >> + linux,cma { >> + compatible = "shared-dma-pool"; >> + size = <0x2000000>; /* 32MB */ >> + alloc-ranges = <0x0 0x00000000 0x40000000>; >> + reusable; >> + linux,cma-default; >> + }; >> + }; >> + >> + >> soc { >> /* >> * Defined ranges: > > Sorry, I just realised I can't merge this as it depends on a patch > that's only in -next: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi > 4 support"). > > I'll queue the second patch in the series to fix the regression > introduces by the ZONE_DMA patches and, AFAICT, the dts update can be > queued independently. I will take it directly, unless you have more stuff coming Stefan? -- Florian ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-07 17:59 ` Florian Fainelli @ 2019-11-07 19:09 ` Stefan Wahren 2019-11-14 20:35 ` Florian Fainelli 0 siblings, 1 reply; 7+ messages in thread From: Stefan Wahren @ 2019-11-07 19:09 UTC (permalink / raw) To: Florian Fainelli, Catalin Marinas, Nicolas Saenz Julienne Cc: linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel Am 07.11.19 um 18:59 schrieb Florian Fainelli: > On 11/7/19 3:20 AM, Catalin Marinas wrote: >> Hi Nicolas, ... >> Sorry, I just realised I can't merge this as it depends on a patch >> that's only in -next: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi >> 4 support"). >> >> I'll queue the second patch in the series to fix the regression >> introduces by the ZONE_DMA patches and, AFAICT, the dts update can be >> queued independently. > I will take it directly, unless you have more stuff coming Stefan? Please take. Thanks Stefan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-07 19:09 ` Stefan Wahren @ 2019-11-14 20:35 ` Florian Fainelli 2019-11-15 9:02 ` Nicolas Saenz Julienne 0 siblings, 1 reply; 7+ messages in thread From: Florian Fainelli @ 2019-11-14 20:35 UTC (permalink / raw) To: Stefan Wahren, Catalin Marinas, Nicolas Saenz Julienne Cc: linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel On 11/7/19 11:09 AM, Stefan Wahren wrote: > > Am 07.11.19 um 18:59 schrieb Florian Fainelli: >> On 11/7/19 3:20 AM, Catalin Marinas wrote: >>> Hi Nicolas, > ... >>> Sorry, I just realised I can't merge this as it depends on a patch >>> that's only in -next: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi >>> 4 support"). >>> >>> I'll queue the second patch in the series to fix the regression >>> introduces by the ZONE_DMA patches and, AFAICT, the dts update can be >>> queued independently. >> I will take it directly, unless you have more stuff coming Stefan? > Please take. Thanks I picked up v2 because it had your explicit Acked-by tag, but amended in a similar way to what Nicolas did, except s/Raspberry Pi 4/BCM2711/: https://github.com/Broadcom/stblinux/commit/d98a8dbdaec628f5c993cc711ba9ab98fe909f0f neither of you will probably mind me having done that. -- Florian ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory 2019-11-14 20:35 ` Florian Fainelli @ 2019-11-15 9:02 ` Nicolas Saenz Julienne 0 siblings, 0 replies; 7+ messages in thread From: Nicolas Saenz Julienne @ 2019-11-15 9:02 UTC (permalink / raw) To: Florian Fainelli, Stefan Wahren, Catalin Marinas Cc: linux-kernel, Rob Herring, Mark Rutland, Eric Anholt, devicetree, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel [-- Attachment #1: Type: text/plain, Size: 1039 bytes --] On Thu, 2019-11-14 at 12:35 -0800, Florian Fainelli wrote: > On 11/7/19 11:09 AM, Stefan Wahren wrote: > > Am 07.11.19 um 18:59 schrieb Florian Fainelli: > > > On 11/7/19 3:20 AM, Catalin Marinas wrote: > > > > Hi Nicolas, > > ... > > > > Sorry, I just realised I can't merge this as it depends on a patch > > > > that's only in -next: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi > > > > 4 support"). > > > > > > > > I'll queue the second patch in the series to fix the regression > > > > introduces by the ZONE_DMA patches and, AFAICT, the dts update can be > > > > queued independently. > > > I will take it directly, unless you have more stuff coming Stefan? > > Please take. Thanks > > I picked up v2 because it had your explicit Acked-by tag, but amended in > a similar way to what Nicolas did, except s/Raspberry Pi 4/BCM2711/: > > https://github.com/Broadcom/stblinux/commit/d98a8dbdaec628f5c993cc711ba9ab98fe909f0f > > neither of you will probably mind me having done that. All good, thanks! [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-11-15 9:02 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-11-07 9:56 [PATCH v3 0/2] arm64: Fix CMA/crashkernel reservation Nicolas Saenz Julienne 2019-11-07 9:56 ` [PATCH v3 1/2] ARM: dts: bcm2711: force CMA into first GB of memory Nicolas Saenz Julienne 2019-11-07 11:20 ` Catalin Marinas 2019-11-07 17:59 ` Florian Fainelli 2019-11-07 19:09 ` Stefan Wahren 2019-11-14 20:35 ` Florian Fainelli 2019-11-15 9:02 ` Nicolas Saenz Julienne
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).