Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2665284rdb; Wed, 4 Oct 2023 08:01:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4F5w5roozfEXThPQ4LWbfqLxjHif34LoIoXRhkmErQk9uINsLaOre2MifvlXNvUSCkB6Z X-Received: by 2002:a05:6a00:3916:b0:693:3f7a:eec2 with SMTP id fh22-20020a056a00391600b006933f7aeec2mr2842635pfb.29.1696431671566; Wed, 04 Oct 2023 08:01:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696431671; cv=pass; d=google.com; s=arc-20160816; b=bb7XmdqoyYhdT1xQWoydpeOtnIVBiWF/iQAYm9IHbGdiqZCBBAg2zk0UAcKl35R3H3 VSi37RfMhTV3Yr0iKpmyfkF8WNBrRtw5H7e0u8TYjhFdebb/HCKiBvwHKlHnOhzyOxFj K6mGQ5/GWUZdEiqgARn0MFMlV21d4WT4yuoC59A7WigSYqFSlLBjQ1AsCKe3hy6kLqpd MAlhKlRY5RrLPMzAAeUZpMGm6nRQqtGBQPJta4/jhD9VryOWSp6nEveJ9kxfx+yiYxx/ 2J3zTfXkuwm1QIzYh2j3LBlsQ5eFGg4BqnVulrC4smddXWf1z+XF2m1dMqnC6I6nUtP2 n+kA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:organization:references:in-reply-to:date :cc:to:from:subject:message-id:dkim-signature; bh=LdPMaLjHlfUS0gHSy+2qt31lLyAWmRO7wmsNvzL4OAA=; fh=cHilxHoIEMHNJUbI4lkm5wPouVXZGtNbBYRZzXecGsk=; b=v5qO5RwkPcVp72QSQRW3WU/8+PsIv5CGA5RGqQRDOI0jtmJAc/42D+DrMWImSBLAeB r3RP0HR6EewPngnseVc0yxBUWdXjfy5PURBthK3iugyzPNh499qx9RHcfJYIpsxWuvCi Z7UpBfApu9JL8VsNCPXskgAUoRqOoWcjHGEybJ3zUqQdRhd6lwwJM6Y2QsKDVaeWiVTG jfCQ6uvclkkPN5AONJgog1w63/CRjO5o06G2fHpicplUe5QmXeAYD9zeSRSbvjpU5g4Q bew+6DBL8dOydIjlpdXPwwIjiwuEKubzT9X76+8pq6f0B5Da8gnMStVtwsG5HAMMuXz1 mXXA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@icenowy.me header.s=zmail2 header.b=eR+gxRYU; arc=pass (i=1 spf=pass spfdomain=icenowy.me dkim=pass dkdomain=icenowy.me dmarc=pass fromdomain=icenowy.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=icenowy.me Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id s29-20020a056a00179d00b00690bc2ac50asi4156574pfg.246.2023.10.04.08.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 08:01:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@icenowy.me header.s=zmail2 header.b=eR+gxRYU; arc=pass (i=1 spf=pass spfdomain=icenowy.me dkim=pass dkdomain=icenowy.me dmarc=pass fromdomain=icenowy.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=icenowy.me Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A38EB81C0C10; Wed, 4 Oct 2023 08:00:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233279AbjJDO7n (ORCPT + 99 others); Wed, 4 Oct 2023 10:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233192AbjJDO7n (ORCPT ); Wed, 4 Oct 2023 10:59:43 -0400 Received: from sender3-op-o18.zoho.com (sender3-op-o18.zoho.com [136.143.184.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FBD59B; Wed, 4 Oct 2023 07:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696431543; cv=none; d=zohomail.com; s=zohoarc; b=gMNoEli4g2cQmjpcvCqiTd0zYxrBPMD7THOpvqCJHuBCjFTHlL9bRpK1PpNn9VxWIMRRvOWFj/81OVWtua0txKV9ePNxYJz/s9wa8Qqwc1qR17pt+ONK2llQh9jXO0O5o9UxpU03SAa1SuhE8GBIMYh9hcJmZxEeC1MxpTxWMWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696431543; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=LdPMaLjHlfUS0gHSy+2qt31lLyAWmRO7wmsNvzL4OAA=; b=RndgPiKwFgWEQvELvUjLB4YgihwR+6RtVkQGlc1vQeTytOl0qwkq5Grh5h9Q9vBuNH3GrYJZrJs9ZSIAeB86tKLvEloWPMRDz0OLeCPIvzRfZ1ZFefbdsUggu3U4WAAyjQNBpKAKOZ4d/EhXai85OdmlZj5xQXKqxiKnUt5F3uM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=icenowy.me; spf=pass smtp.mailfrom=uwu@icenowy.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1696431543; s=zmail2; d=icenowy.me; i=uwu@icenowy.me; h=Message-ID:Subject:Subject:From:From:To:To:Cc:Cc:Date:Date:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:MIME-Version:Message-Id:Reply-To; bh=LdPMaLjHlfUS0gHSy+2qt31lLyAWmRO7wmsNvzL4OAA=; b=eR+gxRYUfLByktnwDoAwm9lPs4BfVqK07dHUdshqDxQX2gRuSzUu3NFgPnhbxYRc rMLb8eGiorRLyOJ6xgw3daXcyMGY2mq886CEGxS+toWYQzUc2hAtqYhDWbylPy5cyru lULRYYaZaMkWc4UCNNbRIi8ttEPo1CXM5swK74Bcscl9OZ3+MlpilTGcqSMFxaV0HNR VmMkv2V9QlRvVB2a9wjbrBQ02AP5OmGfA642uz3IbHTtbREbkub7MO2+IpvBJ9yECtI PK3T9xtDX4OVUyarYMIkSfRjEgR286oGWKYn3eTMHyjiFuQ29v0YbqYHFSlrN6FjeGg xCr+bBBG+w== Received: from edelgard.fodlan.icenowy.me (120.85.98.65 [120.85.98.65]) by mx.zohomail.com with SMTPS id 1696431540266745.8094566529361; Wed, 4 Oct 2023 07:59:00 -0700 (PDT) Message-ID: <12ea9707f8c45dc398eb20f303aba9ecc7624455.camel@icenowy.me> Subject: Re: [PATCH 0/6] RISC-V: Add eMMC support for TH1520 boards From: Icenowy Zheng To: Robin Murphy , "Lad, Prabhakar" , Jisheng Zhang Cc: Drew Fustini , Christoph Hellwig , Lad Prabhakar , Robert Nelson , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Jason Kridner , Xi Ruoyao , Han Gao , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, =?ISO-8859-1?Q?Bj=F6rn_T=F6pel?= , Alexandre Ghiti , Linux-MM Date: Wed, 04 Oct 2023 22:58:52 +0800 In-Reply-To: References: <20230921-th1520-mmc-v1-0-49f76c274fb3@baylibre.com> Organization: Anthon Open-Source Community Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 08:00:04 -0700 (PDT) =E5=9C=A8 2023-10-04=E6=98=9F=E6=9C=9F=E4=B8=89=E7=9A=84 15:18 +0100=EF=BC= =8CRobin Murphy=E5=86=99=E9=81=93=EF=BC=9A > On 04/10/2023 3:02 pm, Icenowy Zheng wrote: > [...] > > > > > I believe commit 484861e09f3e ("soc: renesas: Kconfig: Select > > > > > the > > > > > required configs for RZ/Five SoC") can cause regression on > > > > > all > > > > > non-dma-coherent riscv platforms with generic defconfig. This > > > > > is > > > > > a common issue. The logic here is: generic riscv defconfig > > > > > selects > > > > > 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. > > > > >=20 > > > > > Since this is a regression, what's proper fix? any suggestion > > > > > is > > > > > appreciated. > > >=20 > > > I think the answer is to not select DMA_GLOBAL_POOL, since that > > > is > > > only > >=20 > > Well I think for RISC-V, it's not NOMMU only but applicable for > > every > > core that does not support Svpbmt or vendor-specific alternatives, > > because the original RISC-V priv spec does not define memory > > attributes > > in page table entries. > >=20 > > For the Renesas/Andes case I think a pool is set by OpenSBI with > > vendor-specific M-mode facility and then passed in DT, and the S- > > mode > > (which MMU is enabled in) just sees fixed memory attributes, in > > this > > case I think DMA_GLOBAL_POOL is needed. >=20 > Oh wow, is that really a thing? In that case, either you just can't=20 > support this platform in a multi-platform kernel, or someone needs to > do=20 Well, considering RZ/Five enables some spec-non-conformant local memory (which bypasses MMU) that makes even running generic user space binaries not so viable (PIE ones may still run, but those built to be on the default fixed location of binutils will conflict with the MMU- bypassing local memory), not supporting it in a multi-platform kernel doesn't look like a big deal. > some fiddly work in dma-direct to a) introduce the notion of an > optional=20 > global pool, and b) make it somehow cope with DMA_DIRECT_REMAP being=20 > enabled but non-functional. >=20 > Thanks, > Robin.