Message ID | 20231004150856.2540-1-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp209452vqb; Wed, 4 Oct 2023 08:21:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0WpUiYMdIHdncMl6mimaAXlFm1N1fi/eWNdLmX08FDd/LS/ZebRA0SFf0IbKhHkOEOCDC X-Received: by 2002:a17:90a:868c:b0:26b:6a2f:7d96 with SMTP id p12-20020a17090a868c00b0026b6a2f7d96mr2281054pjn.18.1696432917352; Wed, 04 Oct 2023 08:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696432917; cv=none; d=google.com; s=arc-20160816; b=UUssJHgJa39Cy2YVT9KE7v6zU0XAZBl3SHtTupsbU1t1T8ccLuaz+fmQ0igP8PGMC+ tkF0i5zU9ZDh2Z8dbbqtIST+ZN32hoLSOKfDW2BjMnCB+GLjDRwI5K6gYuR1eYlkQiyb 5aYifOKzPfipAFeO3FrdIdMgoi1LDyUcsZyxh23URukmmGlThU+OYez53jqijrgmDWF4 07MusJs+DqoAZwbf0M5LlvOFXL1cNDOK+UTvgp8QoJhqfaH2IjsailaAUSLOQ5IDI2qW 3zrQI12B/t6Yw0TP/FWqIXBnr5CltAcLGzSS455Wb/NB3pUNdYA5/JrtGTkMpRq0V5Ei tBQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RkLXf5km4NNAHzx/SKboF7qBqNcXeR5Tp8NbdugqZA8=; fh=M11BRpyM9r9nUa6OPmbPXuP9fwpMciuT6a+xhlIFsHk=; b=TQFMGb2uur5V2C4xDgkbWT0j0J4fcG1YQEpWWYq8bb/919ZnfoDVFl+7vpqDsZBzJH XPbUPZd6heYMb7NQyicyFi1mQJiQlOeU7T69F+TCGsnVij1TkDf4SXistaWAGrd160iZ SDcRyzQ4TqZpW/tSCW5EAFYz+nFFPEpCY/wEZPDNb+uGEk3VogPFOW9crGXPND3FkZ03 wrSDD+1sRxw04cwPK3EWMETuxXdLoa2u1fra0u73Z0FL/pHs6BLmH2DrgMg/4WcqSGY8 MmFJwHieCIGxwsGshJYgMYphZWe0XhA4s+jxjqbVc4bRCmvRgTmMuAm38glG4vDFufUK yUAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Chh7oeJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id lx13-20020a17090b4b0d00b0026839b09526si1842279pjb.96.2023.10.04.08.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 08:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Chh7oeJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C0B7B81A9B42; Wed, 4 Oct 2023 08:21:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233553AbjJDPVY (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Wed, 4 Oct 2023 11:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233478AbjJDPVU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 11:21:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1C7BF; Wed, 4 Oct 2023 08:21:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 714F4C433C8; Wed, 4 Oct 2023 15:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696432873; bh=BR+PVMz/ReRBIlT1fOhImOYNK5ZWPSxCh5WYYcVu/ys=; h=From:To:Cc:Subject:Date:From; b=Chh7oeJ+A4mln+ikBhojpHDOIhJBfLVXn5Ws6cF1qsi1LuJhWKt/H7zp4KUGfv5aH YKMR9ORLbYksk1FP9WZZhXKgAdFi4hNuEq5rAZ54KOAtbsXqdMc67AbjSA1LjWeHL7 RuUViLrYsPxjUFx6ewqpeTIXS0RNvGaS8WwAdxXRiCi6RKDBhdlSBGuIPXoxWdXWd1 WosubUYRotDeRfR0r8ekOLw7Q4NSQ6JlSEbrLb/NTb5bTJ9YssmeBVLu9e1tVDlVld tCNRqw7X+vWOMQ14fHTv7mcQghtrG8ql6dTzkgZiVpSzlnKoUGutzwuFjKzqzpFqmj bSvA3bz3Hgrqw== From: Jisheng Zhang <jszhang@kernel.org> To: Geert Uytterhoeven <geert+renesas@glider.be>, Magnus Damm <magnus.damm@gmail.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Robin Murphy <robin.murphy@arm.com>, Christoph Hellwig <hch@lst.de>, Drew Fustini <dfustini@baylibre.com> Subject: [PATCH] soc: renesas: make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE Date: Wed, 4 Oct 2023 23:08:56 +0800 Message-Id: <20231004150856.2540-1-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 08:21:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778838842753065043 X-GMAIL-MSGID: 1778838842753065043 |
Series |
soc: renesas: make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
|
|
Commit Message
Jisheng Zhang
Oct. 4, 2023, 3:08 p.m. UTC
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.
Reported-by: Drew Fustini <dfustini@baylibre.com>
Closes: https://lore.kernel.org/linux-riscv/ZRuamJuShOnvP1pr@x1/
Fixes: 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/soc/renesas/Kconfig | 1 +
1 file changed, 1 insertion(+)
Comments
On 04/10/2023 4:08 pm, Jisheng Zhang wrote: > 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. FWIW, Reviewed-by: Robin Murphy <robin.murphy@arm.com> > Reported-by: Drew Fustini <dfustini@baylibre.com> > Closes: https://lore.kernel.org/linux-riscv/ZRuamJuShOnvP1pr@x1/ > Fixes: 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC") > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > drivers/soc/renesas/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig > index 5a75ab64d1ed..12040ce116a5 100644 > --- a/drivers/soc/renesas/Kconfig > +++ b/drivers/soc/renesas/Kconfig > @@ -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
On Wed, Oct 04, 2023 at 11:08:56PM +0800, Jisheng Zhang wrote: > 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. > > Reported-by: Drew Fustini <dfustini@baylibre.com> > Closes: https://lore.kernel.org/linux-riscv/ZRuamJuShOnvP1pr@x1/ > Fixes: 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC") > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > drivers/soc/renesas/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig > index 5a75ab64d1ed..12040ce116a5 100644 > --- a/drivers/soc/renesas/Kconfig > +++ b/drivers/soc/renesas/Kconfig > @@ -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 > -- > 2.40.1 > Tested-by: Drew Fustini <dfustini@baylibre.com> 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
On Wed, Oct 4, 2023 at 4:21 PM Jisheng Zhang <jszhang@kernel.org> wrote: > > 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. > > Reported-by: Drew Fustini <dfustini@baylibre.com> > Closes: https://lore.kernel.org/linux-riscv/ZRuamJuShOnvP1pr@x1/ > Fixes: 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC") > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > drivers/soc/renesas/Kconfig | 1 + > 1 file changed, 1 insertion(+) > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Cheers, Prabhakar > diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig > index 5a75ab64d1ed..12040ce116a5 100644 > --- a/drivers/soc/renesas/Kconfig > +++ b/drivers/soc/renesas/Kconfig > @@ -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 > -- > 2.40.1 >
On Wed, Oct 4, 2023 at 5:21 PM Jisheng Zhang <jszhang@kernel.org> wrote: > 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. > > Reported-by: Drew Fustini <dfustini@baylibre.com> > Closes: https://lore.kernel.org/linux-riscv/ZRuamJuShOnvP1pr@x1/ > Fixes: 484861e09f3e ("soc: renesas: Kconfig: Select the required configs for RZ/Five SoC") > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> 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
diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig index 5a75ab64d1ed..12040ce116a5 100644 --- a/drivers/soc/renesas/Kconfig +++ b/drivers/soc/renesas/Kconfig @@ -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