From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3695C49360 for ; Mon, 14 Jun 2021 08:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE2EE61153 for ; Mon, 14 Jun 2021 08:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232578AbhFNIiV (ORCPT ); Mon, 14 Jun 2021 04:38:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:43664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbhFNIiR (ORCPT ); Mon, 14 Jun 2021 04:38:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8F7461370; Mon, 14 Jun 2021 08:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623659775; bh=gAds2DSRUgeIv4sXDXp+KcQsXS8BItWPveSU8A0iVNw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GdF8d7Nc73ERCj4tKtd+EKrDaEZ8yJ+F4aspVmBPc26cxK39nB+ihm0IMhEfiv/TU 1gVxIUDZ/DHzr4FI1RPcTRHYoY/RdE97a/vpCp2MAIcs554WO1B2fK1X0ubBbDt6Ug bqh/0hJVYLgGtx8gxV9sFUCXus7xfic8wZey1N0mya/hfKuuydHhT7oZTdqQXSwhK3 3s4Y9E3px/QQPetqjhsFsJ/RVtYbfjLAqvQIoOYAA+wiNOQwAiDkiIyP848beGgwhB TTwaL3jiAdcG+02kBU6O5ItNZ7b77cipnHWwE25PPy7w304pYBubjq75QeXYFaT6cw jjy9xl4KgeLug== Date: Mon, 14 Jun 2021 09:36:10 +0100 From: Will Deacon To: Dong Aisheng Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, dongas86@gmail.com, linux-arm-kernel@lists.infradead.org, Christoph Hellwig , Marek Szyprowski , Robin Murphy , catalin.marinas@arm.com Subject: Re: [PATCH 1/1] dma: coherent: check no-map property for arm64 Message-ID: <20210614083609.GA18701@willie-the-truck> References: <20210611131056.3731084-1-aisheng.dong@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210611131056.3731084-1-aisheng.dong@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Catalin] On Fri, Jun 11, 2021 at 09:10:56PM +0800, Dong Aisheng wrote: > Coherent dma on ARM64 also can't work with mapped system ram, > that means 'no-map' property must be specified in dts. > Add the missing check for ARM64 platforms as well. > Besides 'no-map' checking, 'linux,dma-default' feature is also > enabled for ARM64 along with this patch. Please can you explain _why_ it can't work? We don't need to tear down aliases from the linear map for the streaming DMA API, so why is this case different? Also, coherent devices wouldn't need this either way, would they? What problem are you solving here? Thanks, Will > > Cc: Christoph Hellwig > Cc: Marek Szyprowski > Cc: Robin Murphy > Signed-off-by: Dong Aisheng > --- > kernel/dma/coherent.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c > index 5b5b6c7ec7f2..d1831da7afba 100644 > --- a/kernel/dma/coherent.c > +++ b/kernel/dma/coherent.c > @@ -356,7 +356,7 @@ static int __init rmem_dma_setup(struct reserved_mem *rmem) > if (of_get_flat_dt_prop(node, "reusable", NULL)) > return -EINVAL; > > -#ifdef CONFIG_ARM > +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) > if (!of_get_flat_dt_prop(node, "no-map", NULL)) { > pr_err("Reserved memory: regions without no-map are not yet supported\n"); > return -EINVAL; > -- > 2.25.1 >