soc: renesas: make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
Subsystems (2)
PATCH 1/1 soc: renesas: make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
Drew found "CONFIG_DMA_GLOBAL_POOL=y causes ADMA buffer alloc to fail" the log looks like:
[ 3.741083] mmc0: Unable to allocate ADMA buffers - falling back to standard DMA
The logic is: generic riscv defconfig selects ARCH_RENESAS then ARCH_R9A07G043 which selects DMA_GLOBAL_POOL, which assumes all non-dma-coherent riscv platforms have a dma global pool, this assumption seems not correct. And I believe DMA_GLOBAL_POOL should not be selected by ARCH_SOCFAMILIY, instead, only ARCH under some specific conditions can select it globaly, for example NOMMU ARM and so on, because it's designed for special cases such as "nommu cases where non-cacheable memory lives in a fixed place in the physical address map" as pointed out by Robin.
Fix the issue by making ARCH_R9A07G043 (riscv version) depend on NONPORTABLE, thus generic defconfig won't select ARCH_R9A07G043 by default. And even for random config case, there will be less debug effort once we see NONPORTABLE is enabled.
--- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/soc/renesas/Kconfig +1 -0
@@ -333,6 +333,7 @@ if RISCV config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" + depends on NONPORTABLE select ARCH_RZG2L select AX45MP_L2_CACHE if RISCV_DMA_NONCOHERENT select DMA_GLOBAL_POOL
Signature · 1 line
2.40.1
Quoted 14 lines · Jisheng Zhang
Drew found "
CONFIG_DMA_GLOBAL_POOL=ycauses ADMA buffer alloc to fail" the log looks like:[ 3.741083] mmc0: Unable to allocate ADMA buffers - falling back to standard DMAThe logic is: generic riscv defconfig selects
ARCH_RENESASthenARCH_R9A07G043which selectsDMA_GLOBAL_POOL, which assumes all non-dma-coherent riscv platforms have a dma global pool, this assumption seems not correct. And I believeDMA_GLOBAL_POOLshould not be selected byARCH_SOCFAMILIY, instead, only ARCH under some specific conditions can select it globaly, for example NOMMU ARM and so on, because it's designed for special cases such as "nommu cases where non-cacheable memory lives in a fixed place in the physical address map" as pointed out by Robin.
Quoted 4 lines
Fix the issue by making
ARCH_R9A07G043(riscv version) depend on NONPORTABLE, thus generic defconfig won't selectARCH_R9A07G043by default. And even for random config case, there will be less debug effort once we see NONPORTABLE is enabled.
FWIW,
Quoted 20 lines
Reported-by Drew Fustini <[email protected]>Fixes 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC")Signed-off-by Jisheng Zhang <[email protected]>--- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/soc/renesas/Kconfig +1
-0@@ -333,6 +333,7 @@ if RISCV config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" + depends on NONPORTABLE select ARCH_RZG2L select AX45MP_L2_CACHE if RISCV_DMA_NONCOHERENT select DMA_GLOBAL_POOL
Quoted 42 lines · Jisheng Zhang
Drew found "
CONFIG_DMA_GLOBAL_POOL=ycauses ADMA buffer alloc to fail" the log looks like:[ 3.741083] mmc0: Unable to allocate ADMA buffers - falling back to standard DMAThe logic is: generic riscv defconfig selects
ARCH_RENESASthenARCH_R9A07G043which selectsDMA_GLOBAL_POOL, which assumes all non-dma-coherent riscv platforms have a dma global pool, this assumption seems not correct. And I believeDMA_GLOBAL_POOLshould not be selected byARCH_SOCFAMILIY, instead, only ARCH under some specific conditions can select it globaly, for example NOMMU ARM and so on, because it's designed for special cases such as "nommu cases where non-cacheable memory lives in a fixed place in the physical address map" as pointed out by Robin.Fix the issue by making
ARCH_R9A07G043(riscv version) depend on NONPORTABLE, thus generic defconfig won't selectARCH_R9A07G043by default. And even for random config case, there will be less debug effort once we see NONPORTABLE is enabled.Reported-by Drew Fustini <[email protected]>Fixes 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC")Signed-off-by Jisheng Zhang <[email protected]>--- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/soc/renesas/Kconfig +1
-0@@ -333,6 +333,7 @@ if RISCV config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" + depends on NONPORTABLE select ARCH_RZG2L select AX45MP_L2_CACHE if RISCV_DMA_NONCOHERENT select DMA_GLOBAL_POOLSignature · 1 line
2.40.1
With this patch, I can use the defconfig and sdhci-of-dwcmshc driver is able to use ADMA mode without needing to add shared-dma-pool to dts:
# zcat /proc/config.gz |grep DMA_GLOBAL_POOL # dtc -I fs /sys/firmware/devicetree/base/ 2>/dev/null |grep pool # dmesg |grep ADMA [ 3.910269] mmc0: SDHCI controller on ffe7080000.mmc [ffe7080000.mmc] using ADMA 64-bit
Thanks,
Drew
Quoted 20 lines · Jisheng Zhang
Drew found "
CONFIG_DMA_GLOBAL_POOL=ycauses ADMA buffer alloc to fail" the log looks like:[ 3.741083] mmc0: Unable to allocate ADMA buffers - falling back to standard DMAThe logic is: generic riscv defconfig selects
ARCH_RENESASthenARCH_R9A07G043which selectsDMA_GLOBAL_POOL, which assumes all non-dma-coherent riscv platforms have a dma global pool, this assumption seems not correct. And I believeDMA_GLOBAL_POOLshould not be selected byARCH_SOCFAMILIY, instead, only ARCH under some specific conditions can select it globaly, for example NOMMU ARM and so on, because it's designed for special cases such as "nommu cases where non-cacheable memory lives in a fixed place in the physical address map" as pointed out by Robin.Fix the issue by making
ARCH_R9A07G043(riscv version) depend on NONPORTABLE, thus generic defconfig won't selectARCH_R9A07G043by default. And even for random config case, there will be less debug effort once we see NONPORTABLE is enabled.
Quoted 8 lines
Reported-by Drew Fustini <[email protected]>Fixes 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC")Signed-off-by Jisheng Zhang <[email protected]>--- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+)
Cheers,
Prabhakar
Quoted 13 lines
drivers/soc/renesas/Kconfig +1
-1@@ -333,6 +333,7 @@ if RISCV config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" + depends on NONPORTABLE select ARCH_RZG2L select AX45MP_L2_CACHE if RISCV_DMA_NONCOHERENT select DMA_GLOBAL_POOL --
Quoted 2 lines
2.40.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 19 lines · Jisheng Zhang
Drew found "
CONFIG_DMA_GLOBAL_POOL=ycauses ADMA buffer alloc to fail" the log looks like:[ 3.741083] mmc0: Unable to allocate ADMA buffers - falling back to standard DMAThe logic is: generic riscv defconfig selects
ARCH_RENESASthenARCH_R9A07G043which selectsDMA_GLOBAL_POOL, which assumes all non-dma-coherent riscv platforms have a dma global pool, this assumption seems not correct. And I believeDMA_GLOBAL_POOLshould not be selected byARCH_SOCFAMILIY, instead, only ARCH under some specific conditions can select it globaly, for example NOMMU ARM and so on, because it's designed for special cases such as "nommu cases where non-cacheable memory lives in a fixed place in the physical address map" as pointed out by Robin.Fix the issue by making
ARCH_R9A07G043(riscv version) depend on NONPORTABLE, thus generic defconfig won't selectARCH_R9A07G043by default. And even for random config case, there will be less debug effort once we see NONPORTABLE is enabled.
Quoted 4 lines
Reported-by Drew Fustini <[email protected]>Fixes 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC")Signed-off-by Jisheng Zhang <[email protected]>
I guess this is the right thing to do until a better solution is found. I.e. will queue in renesas-fixes for v6.6.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds