Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2639569rdb; Wed, 4 Oct 2023 07:18:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSR90mv8N7nIHONSzRXjOrVNzk4A3pzNIl3c92+p0ICwEggl7tI3r700quAuyA46PtlbLe X-Received: by 2002:a05:6a20:9189:b0:153:b16e:8db1 with SMTP id v9-20020a056a20918900b00153b16e8db1mr2733983pzd.10.1696429122698; Wed, 04 Oct 2023 07:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696429122; cv=none; d=google.com; s=arc-20160816; b=tMQD/N2gnBighyEHkfPX+KDX5f4iC/7ccmtFfOGOgd1AYj485yidPy78qCOscQbWH+ YMz+d8FTYuYn6I7C9By19Sj6CbsXpFwt1+6x9yQVlTFQY2sDmoYdjlRLwThwDqcPveRw 2MomEHGRb4xWC+fm0PaGk8Wvx5zgxmUxyyGKQAak/lbVCPTtr6xKouQErq5KxIjS+DDL 1jzjRPxesLs44kdddhFSXY/LTujPcpiOkxARdxJxmrUT0LiMcYh5NP97nazr9GRh+sWW 93TOCW8KaGxItepio7th949NR//uQExkY6IS1aFHTBOSGif9I6htREye/WN9WUxc5PrH A8/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PLk1N4BSEe2UI5Uem9/jBayQvfZVMyA7hfUIdLtmDd0=; fh=F/iYIvHhSfA8IBWb+RxSemvO0WMeNJ6Jj4D08hF2Cao=; b=pQYXNj3ICshsBOnqkfIT5uQJBIgbm69xD9PaKfzFKyAYidv0Bx4q6tFjaznOqWNiVp ix4dJfYSlRAe9hukgwXMohsGvVncs4iPvOsvsfaIcOEAxZ9JoYiKkV06e0rQh41rUdly KDpvY+5IeF+vOtDQI0v2qOtP8mrQwAVUaZUZodUVmL4PH8VVYdjSZCaefy2/Q0zHr61A GYyEbTmOnmzrMjPD4bX9ig5bWT4H4rX6XaXK1vbtusdDCJ9aLz69lha4drrrbs7sGHkX f+ZUAAjVTsqg4fa/GtIX52H286AoWvTCL/3hO3jFfosf0bpGwUUOTQMEdQjEujQuQVdh VcHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id z1-20020a63c041000000b0057cbd803b37si3851068pgi.463.2023.10.04.07.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E6278826B44D; Wed, 4 Oct 2023 07:18:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242900AbjJDOSh (ORCPT + 99 others); Wed, 4 Oct 2023 10:18:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242692AbjJDOSc (ORCPT ); Wed, 4 Oct 2023 10:18:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58743AB; Wed, 4 Oct 2023 07:18:28 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C5C7DA7; Wed, 4 Oct 2023 07:19:06 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8454B3F59C; Wed, 4 Oct 2023 07:18:24 -0700 (PDT) Message-ID: Date: Wed, 4 Oct 2023 15:18:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 0/6] RISC-V: Add eMMC support for TH1520 boards Content-Language: en-GB To: Icenowy Zheng , "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, =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexandre Ghiti , Linux-MM References: <20230921-th1520-mmc-v1-0-49f76c274fb3@baylibre.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:18:41 -0700 (PDT) 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. >>>> >>>> Since this is a regression, what's proper fix? any suggestion is >>>> appreciated. >> >> I think the answer is to not select DMA_GLOBAL_POOL, since that is >> only > > 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. > > 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. Oh wow, is that really a thing? In that case, either you just can't support this platform in a multi-platform kernel, or someone needs to do some fiddly work in dma-direct to a) introduce the notion of an optional global pool, and b) make it somehow cope with DMA_DIRECT_REMAP being enabled but non-functional. Thanks, Robin.