From: Petr Vorel <hidden> Date: 2022-12-26 18:55:31
From: Petr Vorel <redacted>
smem_region has a different region on downstream than on msm8994, it's
defined as 150 MiB [1]:
[ 0.000000] Linux version 3.10.73-g65a266a (buildkite-agent@lineageos-buildkite) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Feb 24 10:43:08 UTC 2020
[ 0.000000] CPU: AArch64 Processor [410fd033] revision 3
[ 0.000000] Machine: LGE MSM8992 BULLHEAD rev-1.01
[ 0.000000] cma: Found secure_region@0, memory base 0x0000000000000000, size 150 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found qsecom_region@0, memory base 0x0000000000000000, size 4 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found audio_region@0, memory base 0x0000000000000000, size 4 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found removed_regions@0, memory base 0x0000000000000000, size 34 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found cont_splash_mem@0, memory base 0x0000000000000000, size 12 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found peripheral_region@0, memory base 0x0000000000000000, size 28 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found modem_region@0, memory base 0x0000000000000000, size 100 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found ramoops_region@1ff00000, memory base 0x0000000000000000, size 0 MiB, limit 0x0000000000000000
[ 0.000000] cma: CMA: reserved 152 MiB at 0x0000000000000000 for secure_mem
[ 0.000000] cma: CMA: reserved 4 MiB at 0x0000000000000000 for qseecom_mem
[ 0.000000] cma: CMA: reserved 4 MiB at 0x0000000000000000 for audio_mem
[ 0.000000] cma: CMA: reserved 34 MiB at 0x0000000000000000 for memory_hole
[ 0.000000] cma: CMA: reserved 12 MiB at 0x0000000000000000 for cont_splash_mem
[ 0.000000] cma: CMA: reserved 28 MiB at 0x0000000000000000 for peripheral_mem
[ 0.000000] cma: CMA: reserved 100 MiB at 0x0000000000000000 for modem_mem
[ 0.000000] cma: CMA: reserved 0 MiB at 0x0000000000000000 for ramoops_mem
[ 0.000000] cma: CMA: reserved 16 MiB at 0x0000000000000000 for default region
[ 0.000000] PERCPU: Embedded 15 pages/cpu @0000000000000000 s38912 r0 d22528 u61440
But that conflicts with cont_splash_mem and cont_splash_mem:
[ 0.000000] Linux version 6.1.1 (pevik@dell5510) (aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for De2
[ 0.000000] Machine model: LG Nexus 5X rev 1.01
...
[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'smem_region@0': base 0x0000000000000000, size 150 MiB
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] smem_region@0 (0x0000000000000000--0x0000000009600000) overlaps with memory@3400000 (0x0000000003400000--0x000000000400000)
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] reserved@5000000 (0x0000000005000000--0x0000000007200000) overlaps with memory@7000000 (0x0000000007000000--0x000000000ca0)
1) Obviously there are more memory to be fixed, e.g. modem_mem, but
fundamental is to find out whether such a big mapping should be really
used. If yes, what is the trick downstream uses, that it allows
overlapped memory? Or memory is not really overlapping and I cannot
trust the reported value? What base and size should I define then?
Angler downstream defines crazy values for secure_mem as well [2]:
[ 0.000000] cma: Found secure_region@0, memory base 0x0000000000000000, size 300 MiB, limit 0xffffffffffffffff
But then in mainline is defined just 2 MiB at 106 MiB:
smem_mem: smem_region@6a00000 {
reg = <0 0x06a00000 0 0x200000>;
no-map;
};
=> should I use just 2 MiB region? But at what base?
2) Is mpss_mem equivalent of downstream modem_mem [3]?
Kind regards,
Petr
[1] https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-7.0.0_r0.17/arch/arm/boot/dts/qcom/msm8992.dtsi#278
[2] https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-7.0.0_r0.17/arch/arm/boot/dts/qcom/msm8994.dtsi#272
[3] https://android.googlesource.com/kernel/msm.git/+/android-7.0.0_r0.17/arch/arm64/boot/dts/lge/msm8992-bullhead.dtsi#148
Not-Yet-Signed-off-by: Petr Vorel [off-list ref]
Signed-off-by: Petr Vorel <redacted>
---
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -12,8 +12,9 @@#include"pm8994.dtsi"#include"pmi8994.dtsi"-/* cont_splash_mem has different memory mapping */+/* different memory mapping *//delete-node/&cont_splash_mem;+/delete-node/&smem_mem;/* disabled on downstream, conflicts with cont_splash_mem *//delete-node/&dfps_data_mem;
From: Petr Vorel <hidden> Date: 2022-12-26 18:58:16
From: Petr Vorel <redacted>
It's disabled on downstream [1] thus not shown on downstream dmesg.
Removing it fixes warnings on v6.1:
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] dfps_data_mem@3400000 (0x0000000003400000--0x0000000003401000) overlaps with memory@3400000 (0x0000000003400000--0x0000000004600000)
[1] https://android.googlesource.com/kernel/msm.git/+/android-7.0.0_r0.17/arch/arm64/boot/dts/lge/msm8992-bullhead.dtsi#137
Fixes: 976d321f32dc ("arm64: dts: qcom: msm8992: Make the DT an overlay on top of 8994")
Signed-off-by: Petr Vorel <redacted>
---
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 3 +++
1 file changed, 3 insertions(+)
@@ -15,6 +15,9 @@/* cont_splash_mem has different memory mapping *//delete-node/&cont_splash_mem;+/* disabled on downstream, conflicts with cont_splash_mem */+/delete-node/&dfps_data_mem;+/{model="LG Nexus 5X";compatible="lg,bullhead","qcom,msm8992";
From: Konrad Dybcio <hidden> Date: 2022-12-27 11:26:18
On 26.12.2022 19:54, Petr Vorel wrote:
From: Petr Vorel <redacted>
Original google firmware reports 12 MiB:
[ 0.000000] cma: Found cont_splash_mem@0, memory base 0x0000000003400000, size 12 MiB, limit 0xffffffffffffffff
which is actually 12*1024*1024 = 0xc00000.
This matches the aosp source [1]:
&cont_splash_mem {
reg = <0 0x03400000 0 0xc00000>;
};
Fixes: 3cb6a271f4b0 ("arm64: dts: qcom: msm8992-bullhead: Fix cont_splash_mem mapping")
Fixes: 976d321f32dc ("arm64: dts: qcom: msm8992: Make the DT an overlay on top of 8994")
[1] https://android.googlesource.com/kernel/msm.git/+/android-7.0.0_r0.17/arch/arm64/boot/dts/lge/msm8992-bullhead.dtsi#141
Signed-off-by: Petr Vorel <redacted>
---
Reviewed-by: Konrad Dybcio <redacted>
Konrad
quoted hunk
Hi,
I'm sorry for introducing a regression.
Kind regards,
Petr
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Konrad Dybcio <hidden> Date: 2022-12-27 11:26:55
On 26.12.2022 19:54, Petr Vorel wrote:
From: Petr Vorel <redacted>
It's disabled on downstream [1] thus not shown on downstream dmesg.
Removing it fixes warnings on v6.1:
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] dfps_data_mem@3400000 (0x0000000003400000--0x0000000003401000) overlaps with memory@3400000 (0x0000000003400000--0x0000000004600000)
[1] https://android.googlesource.com/kernel/msm.git/+/android-7.0.0_r0.17/arch/arm64/boot/dts/lge/msm8992-bullhead.dtsi#137
Fixes: 976d321f32dc ("arm64: dts: qcom: msm8992: Make the DT an overlay on top of 8994")
Signed-off-by: Petr Vorel <redacted>
---
@@ -15,6 +15,9 @@/* cont_splash_mem has different memory mapping *//delete-node/&cont_splash_mem;+/* disabled on downstream, conflicts with cont_splash_mem */+/delete-node/&dfps_data_mem;+/{model="LG Nexus 5X";compatible="lg,bullhead","qcom,msm8992";
From: Konrad Dybcio <hidden> Date: 2022-12-27 11:29:17
On 26.12.2022 19:54, Petr Vorel wrote:
From: Petr Vorel <redacted>
smem_region has a different region on downstream than on msm8994, it's
defined as 150 MiB [1]:
[ 0.000000] Linux version 3.10.73-g65a266a (buildkite-agent@lineageos-buildkite) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Feb 24 10:43:08 UTC 2020
[ 0.000000] CPU: AArch64 Processor [410fd033] revision 3
[ 0.000000] Machine: LGE MSM8992 BULLHEAD rev-1.01
[ 0.000000] cma: Found secure_region@0, memory base 0x0000000000000000, size 150 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found qsecom_region@0, memory base 0x0000000000000000, size 4 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found audio_region@0, memory base 0x0000000000000000, size 4 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found removed_regions@0, memory base 0x0000000000000000, size 34 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found cont_splash_mem@0, memory base 0x0000000000000000, size 12 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found peripheral_region@0, memory base 0x0000000000000000, size 28 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found modem_region@0, memory base 0x0000000000000000, size 100 MiB, limit 0x0000000000000000
[ 0.000000] cma: Found ramoops_region@1ff00000, memory base 0x0000000000000000, size 0 MiB, limit 0x0000000000000000
[ 0.000000] cma: CMA: reserved 152 MiB at 0x0000000000000000 for secure_mem
[ 0.000000] cma: CMA: reserved 4 MiB at 0x0000000000000000 for qseecom_mem
[ 0.000000] cma: CMA: reserved 4 MiB at 0x0000000000000000 for audio_mem
[ 0.000000] cma: CMA: reserved 34 MiB at 0x0000000000000000 for memory_hole
[ 0.000000] cma: CMA: reserved 12 MiB at 0x0000000000000000 for cont_splash_mem
[ 0.000000] cma: CMA: reserved 28 MiB at 0x0000000000000000 for peripheral_mem
[ 0.000000] cma: CMA: reserved 100 MiB at 0x0000000000000000 for modem_mem
[ 0.000000] cma: CMA: reserved 0 MiB at 0x0000000000000000 for ramoops_mem
[ 0.000000] cma: CMA: reserved 16 MiB at 0x0000000000000000 for default region
[ 0.000000] PERCPU: Embedded 15 pages/cpu @0000000000000000 s38912 r0 d22528 u61440
But that conflicts with cont_splash_mem and cont_splash_mem:
[ 0.000000] Linux version 6.1.1 (pevik@dell5510) (aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for De2
[ 0.000000] Machine model: LG Nexus 5X rev 1.01
...
[ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'smem_region@0': base 0x0000000000000000, size 150 MiB
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] smem_region@0 (0x0000000000000000--0x0000000009600000) overlaps with memory@3400000 (0x0000000003400000--0x000000000400000)
[ 0.000000] OF: reserved mem: OVERLAP DETECTED!
[ 0.000000] reserved@5000000 (0x0000000005000000--0x0000000007200000) overlaps with memory@7000000 (0x0000000007000000--0x000000000ca0)
1) Obviously there are more memory to be fixed, e.g. modem_mem, but
fundamental is to find out whether such a big mapping should be really
used. If yes, what is the trick downstream uses, that it allows
overlapped memory? Or memory is not really overlapping and I cannot
trust the reported value? What base and size should I define then?
Angler downstream defines crazy values for secure_mem as well [2]:
[ 0.000000] cma: Found secure_region@0, memory base 0x0000000000000000, size 300 MiB, limit 0xffffffffffffffff
But then in mainline is defined just 2 MiB at 106 MiB:
smem_mem: smem_region@6a00000 {
reg = <0 0x06a00000 0 0x200000>;
no-map;
};
=> should I use just 2 MiB region? But at what base?
2) Is mpss_mem equivalent of downstream modem_mem [3]?
Kind regards,
Petr
[1] https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-7.0.0_r0.17/arch/arm/boot/dts/qcom/msm8992.dtsi#278
[2] https://android.googlesource.com/kernel/msm.git/+/refs/tags/android-7.0.0_r0.17/arch/arm/boot/dts/qcom/msm8994.dtsi#272
[3] https://android.googlesource.com/kernel/msm.git/+/android-7.0.0_r0.17/arch/arm64/boot/dts/lge/msm8992-bullhead.dtsi#148
Not-Yet-Signed-off-by: Petr Vorel [off-list ref]
Signed-off-by: Petr Vorel <redacted>
---
@@ -12,8 +12,9 @@#include"pm8994.dtsi"#include"pmi8994.dtsi"-/* cont_splash_mem has different memory mapping */+/* different memory mapping *//delete-node/&cont_splash_mem;+/delete-node/&smem_mem;/* disabled on downstream, conflicts with cont_splash_mem *//delete-node/&dfps_data_mem;