Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2706578rdb; Wed, 4 Oct 2023 09:04:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhtFoutQ5d+vg/hMsfq4GZ1yVO7UfZDMFnKwfUTbi7JP0DpzRtWh/9Hpm2xSewjDZzTDpy X-Received: by 2002:aa7:88ca:0:b0:68e:2af1:b193 with SMTP id k10-20020aa788ca000000b0068e2af1b193mr3221656pff.28.1696435455994; Wed, 04 Oct 2023 09:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696435455; cv=none; d=google.com; s=arc-20160816; b=ZB5nFORlUUy/svEAkfY1bFUQ38eugN3K8uHgQk89Gzn9YkjnwBwCsFwjd2+Z3ABNgI zAhULwNNwG4JIr8IQqaoFblpZx2nXbrfARhVabp3nLKp84K4W+i/xyL8X/j4/VPwSRgd IL82MI9vKeRMO8YAZWCt1Zlv9k/d6WnF9FYRsvSWImvK0mnRGLN0PQGEM6d2yiQiIQ+1 pdFkiT1YHhZUavxyR4ce0/gv61nAoXN0dGfX5l+7GHC/OmxTqIjQPMrhg4bifQlfUgGT t8Ex9vrxGUy6Xgt5VRS08gIMT+RrQgxVk5PvIiuUZVmANb4B7fOaggGAqQByl+/Dvpd3 /zFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MABqfnWSdAh1rkdR5ORe/BqnN4/f/y3PtSz94ONAKI4=; fh=UX493PbUWKSfZkOghp7sj07Rro5YwHdSrt0s/wSmtxo=; b=pzC0FsLeqJVgSBRGJq/yzdnKUk95rJpA2AGcAxP+j7T0ZB/AGOocyWRO8PVq0m7tx7 3+gSmnaPTDUmazOSj52RtqnX5i+vzEjSb2o4A90hWK6fAPjjdkpoiHfT6/yeFxs1C8FB RDr+Udg68mxc5Z0VpsELc6vKi4wnVD4oqqKO2CG8c9dMjuVqx3nnq9Vas4kZbG63jR65 bYSTzbbuQoW2e+EAJTCXW4WgVvbTx9jqDIqUxjxT3Dm8czpOCzTK/K93c04iw0atLIaN VMgy95pShP3PJKIajszr6m18kK5MMXsfkSDQV4BN1H6Wun8HzywEjLk2XVDwz9PD7mt0 EkFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LjSut4t1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c12-20020a056a00248c00b00690f62927casi4188913pfv.178.2023.10.04.09.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LjSut4t1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 67220801B322; Wed, 4 Oct 2023 09:04:08 -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 S242499AbjJDQEJ (ORCPT + 99 others); Wed, 4 Oct 2023 12:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233686AbjJDQEI (ORCPT ); Wed, 4 Oct 2023 12:04:08 -0400 Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F94D7; Wed, 4 Oct 2023 09:04:04 -0700 (PDT) Received: by mail-vk1-xa36.google.com with SMTP id 71dfb90a1353d-496d3e18f19so4420e0c.2; Wed, 04 Oct 2023 09:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696435443; x=1697040243; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MABqfnWSdAh1rkdR5ORe/BqnN4/f/y3PtSz94ONAKI4=; b=LjSut4t1cnfDnGSXSwLhY061TRdkVHDsJwmFsEwsOT7/K5L5A7wBxWtCK9lZ47o6Oq n12FtYl4KruRwOSXk2CSd5SKuKuodTk6zaRqplngDQ3bjF1w7rg9flSYSJsQ3encgAZA rCrF404dq7drul805knb8QQwqTTGXyskXPMUiK+j66D6++vbtIsf4ByOeR86BFkR7IaC HqRGIlRMS9NVw3EqZedecraSAJ10K11OEMcfQOuu2vRuQX6iLzt0FyqREkTe0idWac+U MZQ2fuNHdd+9k7NBgGTkshTt6fYXsZAEXBnKI9dh6s3OyKtNSbhSMO5MBt5cz0y0oNlJ EgEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696435443; x=1697040243; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MABqfnWSdAh1rkdR5ORe/BqnN4/f/y3PtSz94ONAKI4=; b=Wp3YGeEzSX27zDxmozlkHVac33F47CBbX1vI56SHLsZ0X0IZeGJ926htapXZiiHFp4 MKo8+kI8GxTCxu66a3b0u/sh7v2ry5SBL3Bk6eOabtWYiAxlPEGpTbEPvZnA3BIMgWd4 XwxRWlbGWBuxCAsi2lSwn7QzSGpw3CAoyj6YcfrTVeBes2pLlJRygh8i7SniuC6zGOGY FDMYpUxUC42ZB8d0qjAqIpBOR55hQn4uTMoVTTGOd53S5/x/V940/63peB+3QtYzVdvL hAcODmRnAtuKY69sQt0p6x0gZ2l1yMPcz+sbObIXkx40M3aT3ImBQb9/w02WzZc0X+Kp R5sg== X-Gm-Message-State: AOJu0Yy2FVoULxH72Ll8WUy3Or/yHhJ3LyprpbbRRghScMtsj3Gex0dp p6JVt/RWPEIVAUOxctZZ27qA95XgDF5uW8nSGv8= X-Received: by 2002:a1f:4ac2:0:b0:49a:3537:881e with SMTP id x185-20020a1f4ac2000000b0049a3537881emr2263379vka.13.1696435443340; Wed, 04 Oct 2023 09:04:03 -0700 (PDT) MIME-Version: 1.0 References: <20230921-th1520-mmc-v1-0-49f76c274fb3@baylibre.com> In-Reply-To: From: "Lad, Prabhakar" Date: Wed, 4 Oct 2023 17:03:36 +0100 Message-ID: Subject: Re: [PATCH 0/6] RISC-V: Add eMMC support for TH1520 boards To: Robin Murphy Cc: Geert Uytterhoeven , Arnd Bergmann , Icenowy Zheng , Jisheng Zhang , 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 , Fabrizio Castro Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 09:04:08 -0700 (PDT) On Wed, Oct 4, 2023 at 3:18=E2=80=AFPM Robin Murphy = wrote: > > 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, Looking at the code [0] we do have compile time check for CONFIG_DMA_GLOBAL_POOL irrespective of this being present in DT or not, instead if we make it compile time and runtime check ie either check for DT node or see if pool is available and only then proceed for allocation form this pool. What are your thoughts on this? [0] https://elixir.bootlin.com/linux/v6.6-rc4/source/kernel/dma/direct.c#L2= 38 > and b) make it somehow cope with DMA_DIRECT_REMAP being > enabled but non-functional. > DMA_DIRECT_REMAP config option is selected by NONCOHERENET config option an= yway. Cheers, Prabhakar